添加了部分接口
This commit is contained in:
@@ -2,6 +2,7 @@ import axios from '../config/axiosConfig'
|
||||
|
||||
import { AxiosRequestConfig, CustomSuccessData } from 'axios';
|
||||
import { getValue } from '@/utils/common';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
// 泛型接口
|
||||
export interface Get {
|
||||
@@ -11,7 +12,9 @@ export interface Get {
|
||||
axios.interceptors.response.use((response)=>{
|
||||
return response;
|
||||
},(error)=>{
|
||||
return error;
|
||||
|
||||
message.error(error.response.data.message)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户绑定银行卡列表
|
||||
*/
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user