Browse Source

fix(authentication): 添加用户ID检查防止未定义错误

在认证列表页面添加对userId.value的检查,避免未定义时继续执行请求
修改工作台管理页面的用户ID检查逻辑,增加对'undefined'字符串的判断
更新开发环境API地址配置
master
前端-胡立永 3 days ago
parent
commit
def46ebbf2
3 changed files with 8 additions and 4 deletions
  1. +4
    -0
      otherPages/authentication/list/index.vue
  2. +2
    -2
      pages/workbenchManage/index.vue
  3. +2
    -2
      utils/getUrl.js

+ 4
- 0
otherPages/authentication/list/index.vue View File

@ -175,6 +175,10 @@
try { try {
const { userTelephone } = store.state.user.userInfo const { userTelephone } = store.state.user.userInfo
if(!userId.value) {
return
}
const data = await getUserOne(userId.value) const data = await getUserOne(userId.value)
if (data) { if (data) {


+ 2
- 2
pages/workbenchManage/index.vue View File

@ -42,7 +42,7 @@
<view class="explain"> <view class="explain">
<view class="explain-text"> <view class="explain-text">
<text>{{ configList?.pet_teacher_statement?.paramValueText }}</text> <text>{{ configList?.pet_teacher_statement?.paramValueText }}</text>
<view class="font24 add-but col-white join" @click="handleBc"
<view class="font24 add-but col-white join" @click="handleJoin(2)"
style="background: #FF7935">申请加入 ></view> style="background: #FF7935">申请加入 ></view>
</view> </view>
<image class="explain-img" :src="configList?.pet_teacher_statement?.paramValueImage" <image class="explain-img" :src="configList?.pet_teacher_statement?.paramValueImage"
@ -231,7 +231,7 @@
const handleBc = async () => { const handleBc = async () => {
if (!userInfo.value || !userInfo.value.userId) {
if (!userInfo.value || !userInfo.value.userId || userInfo.value.userId == 'undefined') {
uni.navigateTo({ uni.navigateTo({
url: "/otherPages/authentication/list/index" url: "/otherPages/authentication/list/index"
}) })


+ 2
- 2
utils/getUrl.js View File

@ -3,10 +3,10 @@ const accountInfo = wx.getAccountInfoSync();
// current = accountInfo.miniProgram.envVersion; // current = accountInfo.miniProgram.envVersion;
const api = { const api = {
develop:"http://127.0.0.1:8002",
// develop:"http://127.0.0.1:8002",
// develop:"http://h5.xzaiyp.top", // develop:"http://h5.xzaiyp.top",
// develop:"https://api.catmdogd.com/prod-api", // 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", // 开发 // develop: "http://youyi-test.natapp1.cc/prod-api", // 开发
trial: "https://api.catmdogd.com/prod-api", //测试 trial: "https://api.catmdogd.com/prod-api", //测试
release: "https://api.catmdogd.com/prod-api", release: "https://api.catmdogd.com/prod-api",


Loading…
Cancel
Save