From def46ebbf289aea79a0b0bd202240cb60933bc4c Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Wed, 4 Jun 2025 14:12:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(authentication):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7ID=E6=A3=80=E6=9F=A5=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E4=B9=89=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在认证列表页面添加对userId.value的检查,避免未定义时继续执行请求 修改工作台管理页面的用户ID检查逻辑,增加对'undefined'字符串的判断 更新开发环境API地址配置 --- otherPages/authentication/list/index.vue | 4 ++++ pages/workbenchManage/index.vue | 4 ++-- utils/getUrl.js | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/otherPages/authentication/list/index.vue b/otherPages/authentication/list/index.vue index 87d1ae1..1e62d23 100644 --- a/otherPages/authentication/list/index.vue +++ b/otherPages/authentication/list/index.vue @@ -175,6 +175,10 @@ try { const { userTelephone } = store.state.user.userInfo + if(!userId.value) { + return + } + const data = await getUserOne(userId.value) if (data) { diff --git a/pages/workbenchManage/index.vue b/pages/workbenchManage/index.vue index eebffcb..7fb92ad 100644 --- a/pages/workbenchManage/index.vue +++ b/pages/workbenchManage/index.vue @@ -42,7 +42,7 @@ {{ configList?.pet_teacher_statement?.paramValueText }} - 申请加入 > { - if (!userInfo.value || !userInfo.value.userId) { + if (!userInfo.value || !userInfo.value.userId || userInfo.value.userId == 'undefined') { uni.navigateTo({ url: "/otherPages/authentication/list/index" }) diff --git a/utils/getUrl.js b/utils/getUrl.js index ac138f6..1d1a292 100644 --- a/utils/getUrl.js +++ b/utils/getUrl.js @@ -3,10 +3,10 @@ const accountInfo = wx.getAccountInfoSync(); // current = accountInfo.miniProgram.envVersion; const api = { - develop:"http://127.0.0.1:8002", + // develop:"http://127.0.0.1:8002", // develop:"http://h5.xzaiyp.top", // develop:"https://api.catmdogd.com/prod-api", - // develop:"https://pet-admin.hhlm1688.com/api", + develop:"https://pet-admin.hhlm1688.com/api", // develop: "http://youyi-test.natapp1.cc/prod-api", // 开发 trial: "https://api.catmdogd.com/prod-api", //测试 release: "https://api.catmdogd.com/prod-api",