Browse Source

优化显示

wuhb 2 months ago
parent
commit
f0987e2ca4
2 changed files with 12 additions and 3 deletions
  1. 2 1
      pages/out/detail.uvue
  2. 10 2
      pages/out/index.uvue

+ 2 - 1
pages/out/detail.uvue

@@ -157,7 +157,8 @@
     }
 
     const loadDetail = (): void => {
-        if (salseId.value.length === 0) return
+        const len = salseId.value.length as number
+        if (len === 0) return
         getProductSalseById(salseId.value).then((res: any) => {
             const resData = res as UTSJSONObject
 			const data = resData["data"] as UTSJSONObject

+ 10 - 2
pages/out/index.uvue

@@ -310,8 +310,16 @@
     const initUserInfo = () => {
         const userInfo = getUserInfo()
         if (userInfo != null) {
-            const userId = userInfo['userId'] || userInfo['user_id'] || userInfo['userid'] || userInfo['userName']
-            currentUserId = userId != null ? userId.toString() : ''
+            const userId = userInfo['userId']
+			if (userId != null) {
+				if (typeof userId === 'number') {
+					currentUserId = userId.toString()
+				} else if (typeof userId === 'string') {
+					currentUserId = userId
+				} else {
+					currentUserId = userId as string
+				}
+			}
         }
     }