This commit is contained in:
asd
2020-10-20 17:06:20 +08:00
parent f460fe9f23
commit 1f009d09e6
6 changed files with 215 additions and 53 deletions

View File

@@ -478,9 +478,31 @@ interface CommentlData{
msg: string;
total: number;
}
interface ReplylistData{
data: CommentList[];
code: number;
msg: string;
score?:string,
total: number;
}
export async function getcommentlist(data?:any) {
const res=await get<CommentlData>('comments',data)
return res
console.log(data.type==2)
if(data.type==2){
const res=await get<CommentlData>('comments',data)
return res
}else{
const res=await get<ReplylistData>('comments',data)
console.log(res)
return res
}
// if(data.type==2){
// return res
// }
}
/**
@@ -495,8 +517,22 @@ interface SendData{
}
export async function addcomment(data?:any):Promise<void> {
const res=await post<SendData>('comments',data)
if(res.code==0){
message.success("发布成功")
}
}
/**
* 删除评论
*/
export async function delreply(data?:any) {
const res = await del<Liveaddrule>('comments/'+data);
if(res.code==0){
message.success("删除成功")
}
return res
}
/**
* 发送验证码
* @param phone 手机号