🎨 updated comment code framework / add comment verification

This commit is contained in:
landaiqing
2024-09-26 01:15:29 +08:00
parent e4b9214840
commit 96ae754efd
22 changed files with 1997 additions and 1258 deletions

View File

@@ -1,7 +1,7 @@
import {service} from "@/utils/alova/service.ts";
/**
* 获取验证码图片数据
* 获取旋转验证码图片数据
*/
export const getRotatedCaptchaData = () => {
return service.Get('/api/captcha/rotate/get', {
@@ -29,3 +29,14 @@ export const checkRotatedCaptcha = (angle: any, key: any) => {
);
};
/**
* 获取滑动验证码图片数据
*/
export const getSlideCaptchaDataApi = () => {
return service.Get('/api/captcha/slide/generate', {
meta: {
ignoreToken: false
},
});
};

View File

@@ -11,6 +11,8 @@ export const commentSubmitApi = (params: any) => {
images: params.images,
topic_id: params.topic_id,
author: params.author,
point: params.point,
key: params.key,
},
{
name: 'comment-submit',
@@ -33,6 +35,8 @@ export const replySubmitApi = (params: any) => {
reply_id: params.reply_id,
reply_user: params.reply_user,
author: params.author,
point: params.point,
key: params.key,
},
{
name: 'reply-submit',
@@ -52,6 +56,8 @@ export const commentListApi = (params: any) => {
page: params.page,
size: params.size,
topic_id: params.topic_id,
user_id: params.user_id,
is_hot: params.is_hot,
},
{
cacheFor: {
@@ -75,6 +81,7 @@ export const replyListApi = (params: any) => {
size: params.size,
comment_id: params.comment_id,
topic_id: params.topic_id,
user_id: params.user_id,
},
{
cacheFor: {
@@ -104,6 +111,8 @@ export const replyReplySubmitApi = (params: any) => {
reply_id: params.reply_id,
reply_user: params.reply_user,
author: params.author,
point: params.point,
key: params.key,
},
{
name: 'reply-reply-submit',
@@ -113,3 +122,38 @@ export const replyReplySubmitApi = (params: any) => {
}
);
};
/**
* @description 评论点赞
* @param params
*/
export const commentLikeApi = (params: any) => {
return service.Post('/api/auth/comment/like', {
user_id: params.user_id,
comment_id: params.comment_id,
topic_id: params.topic_id,
},
{
meta: {
ignoreToken: false,
},
}
);
};
/**
* @description 评论取消点赞
* @param params
*/
export const cancelCommentLikeApi = (params: any) => {
return service.Post('/api/auth/comment/cancel_like', {
user_id: params.user_id,
comment_id: params.comment_id,
topic_id: params.topic_id,
},
{
meta: {
ignoreToken: false,
},
}
);
};