From b2e41c9a7b5dade563db6547f0abc545b8e7419b Mon Sep 17 00:00:00 2001 From: zzc <1761997216@qq.com> Date: Tue, 3 Feb 2026 09:47:25 +0800 Subject: [PATCH] fix: make audit --- api/system.js | 7 +++++++ pages/make/index.vue | 41 +++++++++++++++++++++++++++++++++++++++-- utils/request.js | 4 ++-- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/api/system.js b/api/system.js index 7749d56..1463c86 100644 --- a/api/system.js +++ b/api/system.js @@ -52,3 +52,10 @@ export const getRecommendList = async (page = 1) => { method: "get", }); }; + +export const msgCheckApi = async (content) => { + return request({ + url: "/api/common/msg-check?content=" + content, + method: "get", + }); +}; diff --git a/pages/make/index.vue b/pages/make/index.vue index 811ca14..ef63138 100644 --- a/pages/make/index.vue +++ b/pages/make/index.vue @@ -197,7 +197,6 @@ - 祝福对象 @@ -251,6 +251,7 @@ placeholder="请输入署名" placeholder-style="color:#ccc" maxlength="5" + @blur="handleSignatureBlur" /> @@ -405,7 +406,12 @@ import { getCardTemplateContentList, getCardTemplateTitleList, } from "@/api/make"; -import { createShareToken, abilityCheck, getShareReward } from "@/api/system"; +import { + createShareToken, + abilityCheck, + getShareReward, + msgCheckApi, +} from "@/api/system"; import { onShareAppMessage, onLoad, @@ -546,7 +552,38 @@ const handleTitleTouchMove = (e) => { }; const targetName = ref("祝您"); +const oldTargetName = ref("祝您"); const signatureName = ref(userStore?.userInfo?.nickName || "xxx"); +const oldSignatureName = ref(userStore?.userInfo?.nickName || "xxx"); + +const handleTargetNameBlur = async () => { + if (!targetName.value || targetName.value === oldTargetName.value) return; + const res = await msgCheckApi(targetName.value); + if (!res.success) { + uni.showToast({ + title: res.message || "消息不符合发布规范,请稍作修改后再试", + icon: "none", + }); + targetName.value = oldTargetName.value; + } else { + oldTargetName.value = targetName.value; + } +}; + +const handleSignatureBlur = async () => { + if (!signatureName.value || signatureName.value === oldSignatureName.value) + return; + const res = await msgCheckApi(signatureName.value); + if (!res.success) { + uni.showToast({ + title: res.message || "消息不符合发布规范,请稍作修改后再试", + icon: "none", + }); + signatureName.value = oldSignatureName.value; + } else { + oldSignatureName.value = signatureName.value; + } +}; const userAvatar = ref( userStore?.userInfo?.avatarUrl || "https://file.lihailezzc.com/resource/96023631c6ab9c3496b7620097af3d6f.png", diff --git a/utils/request.js b/utils/request.js index 113e60b..022bc02 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,6 +1,6 @@ -const BASE_URL = "https://api.ai-meng.com"; +// const BASE_URL = "https://api.ai-meng.com"; // const BASE_URL = 'http://127.0.0.1:3999' -// const BASE_URL = "http://192.168.1.3:3999"; +const BASE_URL = "http://192.168.1.3:3999"; // const BASE_URL = "http://192.168.31.253:3999"; import { useUserStore } from "@/stores/user";