🚸 optimized error response

This commit is contained in:
2024-12-18 16:26:52 +08:00
parent 68a8e3e5c4
commit 8ab873f5ce
23 changed files with 69 additions and 38 deletions

View File

@@ -171,7 +171,7 @@ async function commentSubmit(point: any) {
key: comment.slideCaptchaData.captKey,
};
const result: any = await commentSubmitApi(commentParams);
if (result.code === 200) {
if (result && result.code === 200) {
const tmpData: any = {
user_id: user.user.uid,
content: result.data.content,

View File

@@ -172,7 +172,6 @@ import {
} from "@ant-design/icons-vue";
import {useThrottleFn} from "@vueuse/core";
import useStore from "@/store";
import {useRouter} from "vue-router";
import ReplyInput from "@/components/CommentReply/src/ReplyInput/ReplyInput.vue";
import ReplyList from "@/components/CommentReply/src/ReplyList/ReplyList.vue";
import MessageReport from "@/components/CommentReply/src/MessageReport/MessageReport.vue";
@@ -181,6 +180,7 @@ import UserInfoCard from "@/components/CommentReply/src/UserInfoCard/UserInfoCar
const {t} = useI18n();
const router = useRouter();
const route =useRoute();
const comment = useStore().comment;
@@ -274,7 +274,7 @@ async function cancelCommentLike(item: any) {
*/
async function paginationCommentChange(page: number, pageSize: number) {
router.push({
path: "/main",
path: route.path,
query: {
type: router.currentRoute.value.query.type,
page: page,
@@ -290,7 +290,7 @@ async function getHotCommentList() {
comment.commentLoading = true;
getCommentList(1, 5, true).then(() => {
router.push({
path: "/main",
path: route.path,
query: {
type: "hot",
page: router.currentRoute.value.query.page,
@@ -308,7 +308,7 @@ async function getLatestCommentList() {
comment.commentLoading = true;
getCommentList(1, 5, false).then(() => {
router.push({
path: "/main",
path: route.path,
query: {
type: "latest",
page: router.currentRoute.value.query.page,

View File

@@ -186,7 +186,7 @@ async function replySubmit(point: any) {
key: comment.slideCaptchaData.captKey,
};
const result: any = await replySubmitApi(replyParams);
if (result.code === 200) {
if (result && result.code === 200) {
const tmpData: any = {
id: result.data.id,
content: result.data.content,

View File

@@ -189,7 +189,7 @@ async function replyReplySubmit(point: any) {
key: comment.slideCaptchaData.captKey,
};
const result: any = await replyReplySubmitApi(replyParams);
if (result.code === 200) {
if (result && result.code === 200) {
const tmpData: any = {
id: result.data.id,
content: result.data.content,