添加了部分接口 #33
@ -2,6 +2,7 @@ import axios from '../config/axiosConfig'
|
|||||||
|
|
||||||
import { AxiosRequestConfig, CustomSuccessData } from 'axios';
|
import { AxiosRequestConfig, CustomSuccessData } from 'axios';
|
||||||
import { getValue } from '@/utils/common';
|
import { getValue } from '@/utils/common';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
// 泛型接口
|
// 泛型接口
|
||||||
export interface Get {
|
export interface Get {
|
||||||
@ -11,7 +12,9 @@ export interface Get {
|
|||||||
axios.interceptors.response.use((response)=>{
|
axios.interceptors.response.use((response)=>{
|
||||||
return response;
|
return response;
|
||||||
},(error)=>{
|
},(error)=>{
|
||||||
return error;
|
|
||||||
|
message.error(error.response.data.message)
|
||||||
|
return Promise.reject(error)
|
||||||
})
|
})
|
||||||
|
|
||||||
const get: Get = async function (url: string,data?: object) {
|
const get: Get = async function (url: string,data?: object) {
|
||||||
|
101
src/api/index.ts
101
src/api/index.ts
@ -61,3 +61,104 @@ export async function userinfo(){
|
|||||||
money: user.data?.money
|
money: user.data?.money
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户绑定银行卡列表
|
||||||
|
*/
|
||||||
|
interface Wallect {
|
||||||
|
wallectid: number;
|
||||||
|
memberid: number;
|
||||||
|
type: number;
|
||||||
|
account: string;
|
||||||
|
mname: string;
|
||||||
|
bankcode: string;
|
||||||
|
bankname: string;
|
||||||
|
deleted_at: null;
|
||||||
|
created_at: string;
|
||||||
|
updated_at: string;
|
||||||
|
typeName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getwallect(){
|
||||||
|
const res = await get<Array<Wallect>>('wallect')
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订阅者列表
|
||||||
|
*/
|
||||||
|
interface Teacherliked {
|
||||||
|
memberid: number;
|
||||||
|
name: string;
|
||||||
|
img: string;
|
||||||
|
live: string;
|
||||||
|
birthday: string;
|
||||||
|
mtongue: string;
|
||||||
|
interest: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
export async function getteacherliked(){
|
||||||
|
const res = await get<Array<Teacherliked>>('teacherliked');
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface VideoList{
|
||||||
|
videoid: number;
|
||||||
|
memberid: number;
|
||||||
|
title: string;
|
||||||
|
img: string;
|
||||||
|
fileid: string;
|
||||||
|
fileurl: string;
|
||||||
|
fileduration: string;
|
||||||
|
status: number;
|
||||||
|
desc: string;
|
||||||
|
deleted_at: null;
|
||||||
|
created_at: string;
|
||||||
|
updated_at: string;
|
||||||
|
statusname: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getvideolist() {
|
||||||
|
const res = await get<Array<VideoList>>('video')
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface LiveList {
|
||||||
|
liveid: number;
|
||||||
|
memberid: number;
|
||||||
|
title: string;
|
||||||
|
img: string;
|
||||||
|
fileid: string;
|
||||||
|
fileurl: string;
|
||||||
|
fileduration: string;
|
||||||
|
vodurl: string;
|
||||||
|
vodid: string;
|
||||||
|
vodduration: string;
|
||||||
|
dateline: string;
|
||||||
|
livetime: number;
|
||||||
|
livenumber: number;
|
||||||
|
status: number;
|
||||||
|
livestatus: number;
|
||||||
|
students: string;
|
||||||
|
desc: string;
|
||||||
|
deleted_at: null;
|
||||||
|
created_at: string;
|
||||||
|
updated_at: string;
|
||||||
|
statusname: string;
|
||||||
|
starttime: string;
|
||||||
|
begin: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getlivelist() {
|
||||||
|
const res = await get<Array<LiveList>>('live');
|
||||||
|
console.log(res);
|
||||||
|
}
|
@ -204,6 +204,7 @@
|
|||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import NavBottom from "@/components/NavBottom.vue";
|
import NavBottom from "@/components/NavBottom.vue";
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
|
import { getwallect } from '@/api';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "Wallet",
|
name: "Wallet",
|
||||||
components: {
|
components: {
|
||||||
@ -212,6 +213,7 @@ export default defineComponent({
|
|||||||
setup() {
|
setup() {
|
||||||
const ifchina = false;
|
const ifchina = false;
|
||||||
const ifmingxi = true;
|
const ifmingxi = true;
|
||||||
|
getwallect()
|
||||||
function navto(index: number){
|
function navto(index: number){
|
||||||
let url = "";
|
let url = "";
|
||||||
switch (index){
|
switch (index){
|
||||||
|
@ -146,6 +146,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref } from "vue";
|
import { defineComponent, ref } from "vue";
|
||||||
import LiveItem from "@/components/LiveItem.vue";
|
import LiveItem from "@/components/LiveItem.vue";
|
||||||
|
import { getlivelist } from '@/api';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
LiveItem,
|
LiveItem,
|
||||||
@ -153,6 +154,7 @@ export default defineComponent({
|
|||||||
setup() {
|
setup() {
|
||||||
const page = ref(6);
|
const page = ref(6);
|
||||||
const tabindex = ref(1);
|
const tabindex = ref(1);
|
||||||
|
getlivelist()
|
||||||
function tabchange(e: number): void {
|
function tabchange(e: number): void {
|
||||||
tabindex.value=e
|
tabindex.value=e
|
||||||
}
|
}
|
||||||
|
@ -361,12 +361,14 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { getteacherliked } from '@/api';
|
||||||
import { defineComponent, ref } from "vue";
|
import { defineComponent, ref } from "vue";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "Subscriber",
|
name: "Subscriber",
|
||||||
components: {},
|
components: {},
|
||||||
setup() {
|
setup() {
|
||||||
const page = ref(6);
|
const page = ref(6);
|
||||||
|
getteacherliked()
|
||||||
return {
|
return {
|
||||||
page,
|
page,
|
||||||
};
|
};
|
||||||
|
@ -156,6 +156,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref } from "vue";
|
import { defineComponent, ref } from "vue";
|
||||||
import VideoItem from "@/components/VideoItem.vue";
|
import VideoItem from "@/components/VideoItem.vue";
|
||||||
|
import { getvideolist } from '@/api';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
VideoItem,
|
VideoItem,
|
||||||
@ -163,6 +164,7 @@ export default defineComponent({
|
|||||||
setup() {
|
setup() {
|
||||||
const page = ref(6);
|
const page = ref(6);
|
||||||
const tabindex = ref(1);
|
const tabindex = ref(1);
|
||||||
|
getvideolist()
|
||||||
function tabchange(e: number): void {
|
function tabchange(e: number): void {
|
||||||
tabindex.value=e
|
tabindex.value=e
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user