🎨 update

This commit is contained in:
2024-12-24 00:37:50 +08:00
parent 927f2d63a4
commit 69ee63ca4e
14 changed files with 63 additions and 19 deletions

View File

@@ -201,7 +201,7 @@ async function commentSubmit(point: any) {
message.success(t('comment.commentSuccess'));
} else {
await comment.getSlideCaptchaData();
message.warning(result.message || t('comment.commentError'));
message.warning(result.msg || t('comment.commentError'));
}
}

View File

@@ -22,7 +22,7 @@
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
border-radius: 50%;
.reply-popover{
.reply-popover {
padding: 0;
}
}
@@ -61,8 +61,9 @@
font-weight: 600;
cursor: pointer;
}
.reply-name:hover {
color: rgba(15, 15, 16, 0.68);
color: rgba(15, 15, 16, 0.68);
}
.reply-tag {
@@ -94,6 +95,10 @@
//margin-top: 5px;
.reply-text {
overflow: auto;
white-space: normal; /* 允许自动换行 */
word-wrap: break-word; /* 在长单词内部进行换行 */
overflow-wrap: break-word; /* 在长单词内部进行换行 */
}
.reply-images {

View File

@@ -206,15 +206,17 @@ async function replySubmit(point: any) {
is_liked: false,
reply_nickname: props.item.nickname,
};
if (!comment.replyVisibility[props.item.id].data.comments) {
if (!comment.replyVisibility[props.item.id].data) {
comment.replyVisibility[props.item.id].data.comments = []; // 初始化 comments 数组
}
comment.replyVisibility[props.item.id].data.comments.unshift(tmpData);
comment.commentMap[props.item.id].reply_count++;
comment.replyVisibility[props.item.id].visible = true;
comment.closeReplyInput();
replyContent.value = "";
await comment.clearFileList();
showSubmitCaptcha.value = false;
comment.replyLoading[props.item.id] = false;
message.success(t('comment.replySuccess'));
} else {
await comment.getSlideCaptchaData();

View File

@@ -60,6 +60,12 @@
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 525px;
.reply-text-child {
white-space: normal; /* 允许自动换行 */
word-wrap: break-word; /* 在长单词内部进行换行 */
overflow-wrap: break-word; /* 在长单词内部进行换行 */
}
.reply-action-item-child {
margin-top: 10px;

View File

@@ -210,14 +210,16 @@ async function replyReplySubmit(point: any) {
reply_nickname: props.item.nickname,
reply_to: result.data.reply_to,
};
if (!comment.replyVisibility[props.item.id].data.comments) {
if (!comment.replyVisibility[props.item.id].data) {
comment.replyVisibility[props.item.id].data.comments = []; // 初始化 comments 数组
}
comment.replyVisibility[props.item.id].data.comments.unshift(tmpData);
comment.commentMap[props.item.id].reply_count++;
comment.replyVisibility[props.item.id].visible = true;
replyReplyContent.value = "";
await comment.clearFileList();
showSubmitCaptcha.value = false;
comment.replyLoading[props.item.id] = false;
// await getReplyList();
comment.closeReplyInput();

View File

@@ -1,6 +1,6 @@
import {defineStore} from "pinia";
import {reactive, ref} from "vue";
import {Comment} from "@/types/comment";
import {Comment, CommentContent} from "@/types/comment";
import {cancelCommentLikeApi, commentLikeApi, commentListApi, replyListApi} from "@/api/comment";
import {message} from "ant-design-vue";
import {getSlideCaptchaDataApi} from "@/api/captcha";
@@ -69,6 +69,16 @@ export const useCommentStore = defineStore(
* 显示回复输入框
*/
const handleShowReplyInput = (index: any) => {
if (!replyVisibility.value[index]) {
replyVisibility.value[index] = {
visible: false, data: {
comments: [] as CommentContent[],
current: 0,
total: 0,
size: 0,
} as Comment
};
}
showReplyInput.value = showReplyInput.value === index ? null : index;
};
/**
@@ -95,7 +105,14 @@ export const useCommentStore = defineStore(
};
if (!replyVisibility.value[commentId]) {
// 如果不存在这个评论的状态,初始化
replyVisibility.value[commentId] = {visible: false, data: {} as Comment};
replyVisibility.value[commentId] = {
visible: false, data: {
comments: [] as CommentContent[],
current: 0,
total: 0,
size: 0,
} as Comment
};
await getReplyList(params);
} else {
// 切换可见性
@@ -136,7 +153,7 @@ export const useCommentStore = defineStore(
};
const result: any = await commentLikeApi(params);
if (result && result.code !== 200) {
message.error(result.message);
message.error(result.msg);
return false;
}
return true;
@@ -153,7 +170,7 @@ export const useCommentStore = defineStore(
};
const result: any = await cancelCommentLikeApi(params);
if (result && result.code !== 200) {
message.error(result.message);
message.error(result.msg);
return false;
}
return true;

View File

@@ -30,7 +30,7 @@ export const useAuthStore = defineStore(
*/
async function getGithubRedirectUrl() {
const res: any = await getGithubUrl(clientId.value);
if (res && res.code === 200 && res.data) {
if (res && res.code === 200) {
githubRedirectUrl.value = res.data;
}
}

5
src/types/response.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
export interface Response {
code: number;
data?: any;
msg: string;
}

View File

@@ -57,7 +57,7 @@ export const service = createAlova({
// 令牌
method.config.headers['X-Nonce'] = CryptoJS.lib.WordArray.random(16).toString();
// 签名
if (method.meta?.signature) {
method.config.headers['X-Content-Security'] = generateKeySecretSignature(0, method.type, method.url, method.config.params, method.data);
}

View File

@@ -387,7 +387,7 @@ async function phoneLoginSubmit() {
}, 1000);
} else {
loginLoading.value = false;
message.error(res.message);
message.error(res.msg);
}
})
.catch((error: any) => {
@@ -475,8 +475,9 @@ async function checkAccountLoginCaptcha(angle: number) {
router.push('/main/photo/all');
}, 1000);
} else {
showAccountRotateCaptcha.value = false;
loginLoading.value = false;
message.error(res.message);
message.error(res.msg);
}
}
@@ -490,7 +491,7 @@ async function sendMessageByPhone(params: any): Promise<boolean> {
message.success(t('login.sendCaptchaSuccess'));
return true;
} else {
message.error(res.message);
message.error(res.msg);
return false;
}
}

View File

@@ -111,6 +111,8 @@ async function handleListenMessage() {
setTimeout(() => {
router.push('/main/photo/all');
}, 1000);
} else {
message.warning(t('login.loginError'));
}
});
}

View File

@@ -154,7 +154,7 @@ const updateQrcodeSize = () => {
};
function generateQrCodeUrl(): string {
return import.meta.env.VITE_APP_WEB_URL + "/upscale/app?user_id=" + user.user.uid + "&token=" + user.user.access_token;
return import.meta.env.VITE_APP_WEB_URL + "/upscale/app?user_id=" + user.user.uid + "&token=" + user.token.accessToken;
}
/**