From 3c29b7c38fdc68cc793164ae154165f951032520 Mon Sep 17 00:00:00 2001 From: ingkele <598792849@qq.com> Date: Fri, 23 Oct 2026 19:23:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8A=A5=E5=91=8A=E9=A1=B5uid=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=A2=9E=E5=8A=A0storage=E5=85=9C=E5=BA=95=EF=BC=88?= =?UTF-8?q?=E4=B8=8Ewap=E7=AB=AF=E5=90=8C=E6=AD=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/contract/index.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pages/contract/index.vue b/pages/contract/index.vue index 51a741f..6315ae2 100644 --- a/pages/contract/index.vue +++ b/pages/contract/index.vue @@ -1515,6 +1515,15 @@ }, methods: { dayjs, + // 获取当前登录用户uid(vuex优先,storage兜底) + getUid() { + let uid = (typeof vk.getVuex === 'function' && vk.getVuex('$user.userInfo._id')) || '' + if (!uid) { + const cache = vk.getStorageSync('uni_id_user_info') || {} + uid = cache._id || cache.uid || '' + } + return uid + }, menuSelect(e) { this.menuIndex = String(e) this.formData.status = Number(e) @@ -1772,7 +1781,7 @@ try { const res = await vk.callFunction({ url: 'client/ai/pub/getMyReports', - data: { pageIndex: 1, pageSize: 50, uid: vk.getVuex('$user.userInfo._id') || '' } + data: { pageIndex: 1, pageSize: 50, uid: this.getUid() } }); if (res.code === 0 && res.data && res.data.rows) { this.reportList = res.data.rows.map(r => ({ @@ -1835,7 +1844,7 @@ file_id: r.fileId, file_name: r.fileName, file_size: r.fileSize || 0, - uid: vk.getVuex('$user.userInfo._id') || '' + uid: this.getUid() } }); if (res.code === 0) { @@ -1895,7 +1904,7 @@ file_base64: fileBase64, file_name: file.name, file_size: file.size, - uid: vk.getVuex('$user.userInfo._id') || '', + uid: this.getUid(), upload_only: true } }); @@ -1942,7 +1951,7 @@ file_id: this.reviewFileId, file_name: this.reviewFile.name, file_size: this.reviewFile.size, - uid: vk.getVuex('$user.userInfo._id') || '' + uid: this.getUid() } });