From 4f5893f87a3d5c23431836b3e9a26a24254583f3 Mon Sep 17 00:00:00 2001 From: cs10086 <1291454411@qq.com> Date: Fri, 11 Sep 2026 17:48:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=A9=BA=E7=99=BD/=E5=A4=B1=E6=95=88=E5=A4=96=E9=93=BE/?= =?UTF-8?q?=E4=BA=91=E5=87=BD=E6=95=B0=E8=B6=8A=E6=9D=83=EF=BC=8C=E8=A1=A5?= =?UTF-8?q?=E9=BD=90=E7=BC=BA=E5=A4=B1=E9=A1=B5=E9=9D=A2=E4=B8=8E=E7=A7=8D?= =?UTF-8?q?=E5=AD=90=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 阻断性缺陷 - list.vue 是 0 字节空文件、slist.vue 与 search/search.vue 从未存在, 而前者是 tabBar 首页、后者是 tabBar「搜索」页 —— 开屏即白屏。 按 .nvue 原型与详情页契约重建三页(CSS 渐变主视觉、分类筛选、搜索历史/热搜/联想)。 - parse-image-url.js 对空封面调 undefined.startsWith 直接抛错,列表页整页崩。 - 云函数目录缺 uni-cms-articles / uni-cms-categories / uni-cms-unlock-record schema 与 schema.ext.js,线上内容渲染与解锁逻辑无配置可用。 ## 越权与数据一致性 - uni-cms-articles:del/update/add 全部无鉴权,未登录即可删任意文章、 改他人文章作者与阅读量。补 login + 作者归属校验,作者与计数改为服务端取值。 - comments.likeComment/relikeComment:直接采信客户端传入的 user_id, 可冒名点赞刷计数。改为以令牌为准,并纳入事务。 - comments.updateComment:对数组取 .author_id,权限判断恒失败; 字段名 updateTime 与 ip_location 类型与 schema 不符。 - comments.deleteComment:`!root_id === 0` 优先级错误导致计数恒不减; 且误更新 uni-cms-articles、按不存在的 type 字段删点赞明细产生孤儿数据。 - cms-articles-like/collect:查重条件混入本次请求时间戳,防重永远失效, 可无限重复刷计数;补唯一索引并事务化。 - cms-vote:读-改-写票数导致并发丢票,记录与统计非原子;改为事务 + 原子自增。 - cms-articles-log:忽略传入 user_id 直接返回全表,泄露全站浏览记录。 - article_info:get() 使用未定义变量必崩;读接口全部无鉴权。 - user-info:公开资料接口可查任意用户 last_login_ip。 ## 资源与数据 - 全项目清空失效的签名外链(expire_at 均为 2025-03,必然 403), 改为本地生成资源:6 套文章模板、8 个编辑器图标、2 张文章配图。 - 新增分类 / 模板 / 礼物 / 热搜词种子数据,并在 db_init.json 登记, 同时补上点赞、收藏、投票、浏览日志的唯一索引。 ## 功能 - 草稿箱:预览页拆出「发布」与「存为草稿」,作品列表按状态筛选并显示徽标。 原实现有 4 个 tab 但只有 1 个有内容,且 article_status 在 UI 上无体现。 - 编辑中断恢复:接上原本空实现的「编辑草稿」回调,区分新建与编辑已有文章。 ## 工具 - tools/audit-project.js:编码 / 页面路由 / 云调用 / 云函数鉴权 / 敏感信息检查 - tools/check-vue.js:SFC 脚本语法(词法扫描处理 import·export 与条件编译) - tools/verify.js:一键验证;两个检查器各带自测,防止"永远通过" - tools/gen-*.py:模板与图标资源生成脚本 --- README.md | Bin 2790 -> 2880 bytes components/cu-editor/cu-editor.vue | 60 +- .../qk/qk-send-sms-code/qk-send-sms-code.vue | 62 +- .../articleContentDetail.vue | 50 +- pages/index/index.vue | 42 +- pages/test/test.vue | 235 +++--- pages2/editCms/editCms.vue | 52 +- pages2/editCms/preview.vue | 153 ++-- pages2/edit_list/edit_list.vue | 152 +++- pages2/setting/bind-mobile/bind-mobile.vue | 51 +- static/article/wz1.png | Bin 0 -> 21848 bytes static/article/wz2.png | Bin 0 -> 19678 bytes static/editor-icons/image.png | Bin 0 -> 2839 bytes static/editor-icons/is_vote.png | Bin 0 -> 2809 bytes static/editor-icons/not_image.png | Bin 0 -> 2083 bytes static/editor-icons/stop.png | Bin 0 -> 5658 bytes static/editor-icons/text.png | Bin 0 -> 1669 bytes static/editor-icons/title.png | Bin 0 -> 581 bytes static/editor-icons/video.png | Bin 0 -> 2086 bytes static/editor-icons/vote.png | Bin 0 -> 1789 bytes static/template/dark.png | Bin 0 -> 18474 bytes static/template/default.png | Bin 0 -> 19929 bytes static/template/gold.png | Bin 0 -> 19678 bytes static/template/light.png | Bin 0 -> 18180 bytes static/template/no-cover.png | Bin 0 -> 4491 bytes static/template/olive.png | Bin 0 -> 19139 bytes static/template/steel.png | Bin 0 -> 19437 bytes tools/audit-project.js | 787 ++++++++++++++++++ tools/check-vue.js | 539 ++++++++++++ tools/gen-editor-icons.py | 163 ++++ tools/gen-template-assets.py | 138 +++ tools/verify.js | 233 ++++++ .../cloudfunctions/article_info/index.obj.js | 235 +++--- .../cms-articles-collect/index.obj.js | 87 +- .../cms-articles-like/index.obj.js | 73 +- .../cms-articles-log/index.obj.js | 75 +- .../cloudfunctions/cms-vote/index.obj.js | 232 ++---- .../cloudfunctions/comments/index.obj.js | 248 +++--- .../ext-storage-co/index.obj.js | 22 +- .../uni-cms-articles/index.obj.js | 274 +++--- .../cloudfunctions/user-info/index.obj.js | 71 +- .../database/cms-articles-collect.schema.json | 62 +- .../database/cms-articles-like.schema.json | 60 +- .../database/cms-articles-log.schema.json | 82 +- .../database/cms-temp.init_data.json | 68 ++ uniCloud-alipay/database/cms-vote.schema.json | 49 +- uniCloud-alipay/database/db_init.json | 190 ++++- uniCloud-alipay/database/gifts.init_data.json | 26 + .../database/opendb-search-hot.init_data.json | 12 +- .../database/opendb-search-log.schema.json | 46 +- .../database/uni-cms-articles.schema.ext.js | 350 ++++++++ .../database/uni-cms-articles.schema.json | 236 ++++++ .../uni-cms-categories.init_data.json | 58 ++ .../database/uni-cms-categories.schema.json | 1 + .../uni-cms-unlock-record.schema.json | 49 ++ .../uni-cms-article/common/parse-image-url.js | 165 ++-- .../uni-cms-article/pages/detail/detail.vue | 2 +- .../uni-cms-article/pages/list/list.nvue | 2 +- .../uni-cms-article/pages/list/list.vue | 286 +++++++ .../uni-cms-article/pages/list/slist.vue | 228 +++++ .../uni-cms-article/pages/search/search.vue | 652 +++++++++++++++ .../pages/personalpage/personalpage.vue | 11 +- 62 files changed, 5565 insertions(+), 1104 deletions(-) create mode 100644 static/article/wz1.png create mode 100644 static/article/wz2.png create mode 100644 static/editor-icons/image.png create mode 100644 static/editor-icons/is_vote.png create mode 100644 static/editor-icons/not_image.png create mode 100644 static/editor-icons/stop.png create mode 100644 static/editor-icons/text.png create mode 100644 static/editor-icons/title.png create mode 100644 static/editor-icons/video.png create mode 100644 static/editor-icons/vote.png create mode 100644 static/template/dark.png create mode 100644 static/template/default.png create mode 100644 static/template/gold.png create mode 100644 static/template/light.png create mode 100644 static/template/no-cover.png create mode 100644 static/template/olive.png create mode 100644 static/template/steel.png create mode 100644 tools/audit-project.js create mode 100644 tools/check-vue.js create mode 100644 tools/gen-editor-icons.py create mode 100644 tools/gen-template-assets.py create mode 100644 tools/verify.js create mode 100644 uniCloud-alipay/database/cms-temp.init_data.json create mode 100644 uniCloud-alipay/database/gifts.init_data.json create mode 100644 uniCloud-alipay/database/uni-cms-articles.schema.ext.js create mode 100644 uniCloud-alipay/database/uni-cms-articles.schema.json create mode 100644 uniCloud-alipay/database/uni-cms-categories.init_data.json create mode 100644 uniCloud-alipay/database/uni-cms-categories.schema.json create mode 100644 uniCloud-alipay/database/uni-cms-unlock-record.schema.json create mode 100644 uni_modules/uni-cms-article/pages/list/slist.vue create mode 100644 uni_modules/uni-cms-article/pages/search/search.vue diff --git a/README.md b/README.md index d89cea0a6be990e6b3ccd745e263c794e28d06d0..cc7ffa6148e718d821319b56874c568d65395c32 100644 GIT binary patch literal 2880 zcmai0T~8ZF6n)=cF%o@9schPiMpfUMv{KThs#>X4rK-w0_69aJy9lpCTIIn6jBRXV zD2DK1z@`M;B-jujn6(W*raLpcPyB_R*)a}jP>O^#J0JJnx%ZrNr-#tV6}FS3i^q;# zQxx&_H0f(hS{V|2H`t66FnoW?Zy0!QiQGJjG3C-Fp4dU^<*T6f3W ziV}eFx1FYiukcXptd;5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A|Fu`qI#RtVM0nrzR@8OeGo(R(6g%;J>?7}Vq> z&WGmb^DPmOU6jvi&egJE+2xp#&-8oZ63GS=$-bsvM8n~c_}x%uY)gW>6kF^=?0dma zm&wI6bz&UH=pERNAi_)aL(cx(*hsiSI9hI;nJzYZ(?fTR>Z4zepU=Lx>xO=9f;IC_ zK3y7U2fa>yblEWGywr#h`?WlFD)`_nVm7sEcTwccGn(1Pr>%`OgI=8kVy-?$+)sPK zo((`=hj$a+jo_z&f3D2Um|@TNU?y)`^a%S-!+E(H{Pcv=ya8PiZ-3y7Yb`%{cLkmF zym&W%JvJ?>qE)S`m+w^$ns5KaZ{YlJndc*SlQ=4k?<59zD*a%z^2VgXKHtD(pKP2+ z4_zANm~a>18(JrJW#NU4GxwzkZ6)sgb7Sjr%mvwBwn4rJTIFuL_m}RoZCiIel~#)R zb^{d}q36IU!|cQyGmd-xz##5=D$wzXo;NejC%f~$6~@Rn0E+{_wa}?m;yyCc$C_nr lxL_d%S-hdrYg%FkTGpgD{{aBtbD#hK diff --git a/components/cu-editor/cu-editor.vue b/components/cu-editor/cu-editor.vue index 66fe963..8106e80 100644 --- a/components/cu-editor/cu-editor.vue +++ b/components/cu-editor/cu-editor.vue @@ -564,7 +564,7 @@ export default { templateConfig: [ { value: 0, - src: "https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/temp.jpg?expire_at=1741101642&er_sign=9c89032edb940439a476e2ca0ff1e0ba", + src: "/static/template/default.png", checked: true, }, ], @@ -1040,33 +1040,59 @@ export default { } }, // 去预览 + // 预览页(pages2/editCms/preview)读取的是 storage 里的 "cms" 对象, + // 因此这里必须写入同一份结构,否则预览是空白页。 toPreview() { - // uni.navigateTo({ - // url: "/pages/preview/preview", - // }); + const musicSrc = (this.musicConfig && this.musicConfig.src) || ''; + const templateSrc = this.templateConfig[this.currentTemplate] + ? this.templateConfig[this.currentTemplate].src + : ''; + + const finish = (html) => { + const cms = uni.getStorageSync("cms") || {}; + uni.setStorageSync("cms", { + ...cms, + music_url_id: musicSrc ? { src: musicSrc } : cms.music_url_id, + temptele_src: templateSrc, + cmsLst: [{ type: "text", html, text: "", delta: {} }], + }); + uni.navigateTo({ url: "/pages2/editCms/preview" }); + }; + + // 有音乐才需要落盘,没配音乐时直接进预览 + if (!musicSrc) { + this.editorCtx.getContents({ + success: (res) => finish(handleHtmlImage(res.html, true)), + fail: () => finish(""), + }); + return; + } + uni.getFileSystemManager().saveFile({ - tempFilePath: this.musicConfig.src, + tempFilePath: musicSrc, success: (saveRes) => { const savedFilePath = saveRes.savedFilePath; // 获取持久化存储的路径 - uni.setStorageSync("musicSrc", savedFilePath); - uni.setStorageSync( - "templateSrc", - this.templateConfig[this.currentTemplate].src - ); this.editorCtx.getContents({ success: (res) => { - console.log(res); - uni.setStorageSync("html", handleHtmlImage(res.html, true)); - }, - complete: (res) => { - uni.navigateTo({ - url: "/pages/preview/preview", + const cms = uni.getStorageSync("cms") || {}; + uni.setStorageSync("cms", { + ...cms, + music_url_id: { src: savedFilePath }, + temptele_src: templateSrc, + cmsLst: [{ type: "text", html: handleHtmlImage(res.html, true), text: "", delta: {} }], }); }, + complete: () => { + uni.navigateTo({ url: "/pages2/editCms/preview" }); + }, }); }, fail: (e) => { - console.log(e); + console.error('音乐文件保存失败,跳过音乐直接预览:', e); + this.editorCtx.getContents({ + success: (res) => finish(handleHtmlImage(res.html, true)), + fail: () => finish(""), + }); }, }); }, diff --git a/components/qk/qk-send-sms-code/qk-send-sms-code.vue b/components/qk/qk-send-sms-code/qk-send-sms-code.vue index 385d707..249e5ea 100644 --- a/components/qk/qk-send-sms-code/qk-send-sms-code.vue +++ b/components/qk/qk-send-sms-code/qk-send-sms-code.vue @@ -44,6 +44,24 @@ default(){ return 'login' } + }, + /** + * uni-id 短信场景,取值 login-by-sms / reset-pwd-by-sms / bind-mobile-by-sms / set-pwd-by-sms + */ + scene:{ + type: String, + default(){ + return 'login-by-sms' + } + }, + /** + * 图形验证码;服务端要求图形验证码校验时必传 + */ + captcha:{ + type: String, + default(){ + return '' + } } }, data() { @@ -68,32 +86,34 @@ this.sendMsg(); }) }, - sendMsg() { + async sendMsg() { let reg_phone = /^1\d{10}$/; if(!reg_phone.test(this.phone))return uni.showToast({ title: '手机号格式错误', icon: 'none' }); - uniCloud.callFunction({ - name:'uni-id-cf', - data:{ - action:'sendSmsCode', - params:{ - "mobile": this.phone, - "type": this.codeType - }, - }, - success: ({result}) => { - console.log(result); - uni.showToast({ - title: "短信验证码发送成功", - icon: 'none' - }); - this.reverseNumber = Number(this.count); - this.getCode(); - this.$emit('getCode'); - } - }) + try { + const uniIdCo = uniCloud.importObject('uni-id-co') + // scene 用 uni-id 的短信场景常量,与 codeType(login/register/bind)区分开 + await uniIdCo.sendSmsCode({ + mobile: String(this.phone), + scene: this.scene, + captcha: this.captcha + }); + uni.showToast({ + title: "短信验证码发送成功", + icon: 'none' + }); + this.reverseNumber = Number(this.count); + this.getCode(); + this.$emit('getCode'); + } catch (e) { + console.error('短信验证码发送失败:', e); + uni.showToast({ + title: e.errMsg || '发送失败,请稍后重试', + icon: 'none' + }); + } }, getCode() { if (this.reverseNumber == 0) { diff --git a/pages/articleContentDetail/articleContentDetail.vue b/pages/articleContentDetail/articleContentDetail.vue index 27234fb..8db2034 100644 --- a/pages/articleContentDetail/articleContentDetail.vue +++ b/pages/articleContentDetail/articleContentDetail.vue @@ -33,7 +33,7 @@ 住在大城市里,"军民鱼水情"只是句日常的用语,并没有真正切实的体会。 1952年的冬天,我团接到上级命令,前往朝鲜战场。这兴奋劲像个麻雀,跳跃不停。经过战前培训,我们坐着向北驰去的列车。一路上歌声不断,当列车到达山东济南时,站台上摆着热气腾腾的饭菜,我们狼吞虎咽地吃着可口的饭菜,这比在列车上吃饼干要好百倍了。经过一天多的劳累,在大年除夕的那天,我们到达了安东。快速转移到一个街坊后,多数人都安排好了住所,可我们班还剩六名战士没法安排,连长还在为难。 @@ -43,7 +43,7 @@ 我们住进小屋,六个人挤在一张床上睡觉,可怎么都睡不着。平时说的"军民鱼水情",今天真的出现了吗?老乡说:"志愿军出国作战,到了安东,哪能汽车16团汽车修理工叫他们在野外露营?我俩到我娘那里住一张建群宿就行。"这几句朴实无华的话,真是"鱼水情"的真实体验。 @@ -92,71 +92,71 @@ @@ -176,7 +176,7 @@ setup() { const hbComment = ref(null) const avatar = ref("") - const templateSrc = ref("https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/bg.jpg?expire_at=1741101988&er_sign=c9732cddaaead925cf110d9a11751231") + const templateSrc = ref("/static/template/default.png") const commentData = ref(null) const reqFlag = ref(false) @@ -195,7 +195,7 @@ success: function(res) { if (res.confirm) { uni.redirectTo({ - url: '/pages/login/login' + url: '/pages3/uni_modules/uni-id-pages/pages/login/login-withoutpwd' }) } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 467b147..fc37a52 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,6 +1,10 @@ @@ -11,6 +15,7 @@ setup() { onLoad(() => { setTimeout(() => { + // 首页是 tabBar 页面,必须用 switchTab uni.switchTab({ url: "/uni_modules/uni-cms-article/pages/list/list" }) @@ -22,8 +27,41 @@ diff --git a/pages/test/test.vue b/pages/test/test.vue index 50be127..b2a5e5c 100644 --- a/pages/test/test.vue +++ b/pages/test/test.vue @@ -1,118 +1,147 @@ diff --git a/pages2/editCms/editCms.vue b/pages2/editCms/editCms.vue index dc4f410..a98a404 100644 --- a/pages2/editCms/editCms.vue +++ b/pages2/editCms/editCms.vue @@ -120,7 +120,7 @@ mode="scaleToFill" width="100rpx" height="100rpx" - src="https://qnycdn.mymoyu.top/static/icon/stop.png"> + src="/static/editor-icons/stop.png"> @@ -190,7 +190,7 @@ diff --git a/uni_modules/uni-cms-article/pages/list/slist.vue b/uni_modules/uni-cms-article/pages/list/slist.vue new file mode 100644 index 0000000..05aca87 --- /dev/null +++ b/uni_modules/uni-cms-article/pages/list/slist.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/uni_modules/uni-cms-article/pages/search/search.vue b/uni_modules/uni-cms-article/pages/search/search.vue new file mode 100644 index 0000000..0edc2f5 --- /dev/null +++ b/uni_modules/uni-cms-article/pages/search/search.vue @@ -0,0 +1,652 @@ + + + + + + + diff --git a/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue b/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue index f995b17..fbc534c 100644 --- a/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue +++ b/uni_modules/zetank-personalpage/pages/personalpage/personalpage.vue @@ -404,7 +404,9 @@ if (res.code === 200 ) { this.userinfo = res.data; this.gender = res.data.gender; - this.userinfo.city = res.data.last_login_ip; + // last_login_ip 属于隐私字段,公开资料接口已不再返回。 + // 个人主页不展示登录地点,留空即可。 + this.userinfo.city = ''; this.userinfo.nickname = res.data.nickname; this.userinfo.avatar_file = res.data.avatar_file; this.userinfo._id = res.data._id; @@ -564,12 +566,13 @@ this.data_clear(); }, async getHistoryList() { - return uniCloud.importObject("cms-articles-log").getHistoryList({ + // 云对象方法返回 Promise,必须先 await 才能取到 { code, data } + const res = await uniCloud.importObject("cms-articles-log").getHistoryList({ user_id: this.userinfo._id - }).data.data; + }); + return (res && res.data) || []; }, async getHistory() { - console.log(this.userinfo._id); return uniCloud.importObject("cms-articles-log").getHistory(this.userinfo._id); }, // 滚动事件 (需在up配置onScroll:true才生效)