li.shaoyi 2 anos atrás
pai
commit
116634aa6c

+ 24 - 22
src/business/login/index.ts

@@ -59,13 +59,30 @@ export function useLogin() {
         eventBus.$emit('LoginNotify') // 登录成功通知
     }
 
-    const autoLogin = () => {
-        const encryptedData = localData.getValue('autoLoginEncryptedData')
-        if (encryptedData) {
-            const decryptedString = decryptAES(encryptedData)
-            return loginAction(JSON.parse(decryptedString))
-        } else {
-            return Promise.reject('自动登录失败')
+    // 初始化业务数据
+    const initBaseData = async (autoLogin = false) => {
+        logining.value = true
+        try {
+            // 等待加载业务数据
+            await loadBaseData()
+            // 自动登录
+            if (autoLogin) {
+                const encryptedData = localData.getValue('autoLoginEncryptedData')
+                if (encryptedData) {
+                    try {
+                        const decryptedString = decryptAES(encryptedData)
+                        return await loginAction(JSON.parse(decryptedString))
+                    } catch (err) {
+                        console.error(err)
+                        eventBus.$emit('LogoutNotify')
+                    }
+                }
+            }
+            if (token.value) {
+                await loadUserData()
+            }
+        } finally {
+            logining.value = false
         }
     }
 
@@ -97,21 +114,6 @@ export function useLogin() {
         callback && callback()
     }
 
-    // 初始化业务数据
-    const initBaseData = async (enableAutoLogin = false) => {
-        logining.value = true
-        try {
-            await loadBaseData() // 等待加载业务数据
-            if (enableAutoLogin) {
-                await autoLogin()
-            } else if (token.value) {
-                await loadUserData()
-            }
-        } finally {
-            logining.value = false
-        }
-    }
-
     return {
         logining,
         formData,

+ 3 - 1
src/packages/mobile/views/mine/order/detail/transfer/index.vue

@@ -29,7 +29,7 @@
                 <Cell title="合同单号" :value="details.transferid" :is-link="!!details.contractaddr"
                     @click="openPDF(details?.contractaddr)" />
             </CellGroup>
-            <CellGroup title="点价信息" v-if="details.pointflag">
+            <CellGroup title="点价信息" v-if="details.pointflag && userId === details.firstbuyuserid">
                 <Cell title="已点价格" :value="details.pointprice" />
                 <Cell title="已点收益" :value="details.pointincome" />
             </CellGroup>
@@ -55,9 +55,11 @@ import { useRequest } from '@/hooks/request'
 import { queryTHJPurchaseTransferOrderDetail } from '@/services/api/order'
 import { useSpotPresaleTransferCancel } from "@/business/trade"
 import { handleNumberValue, parsePercent, formatDate } from '@/filters'
+import { loginStore } from '@/stores'
 import plus from '@/utils/h5plus'
 
 const { router, getQueryString } = useNavigation()
+const { userId } = loginStore.$mapGetters()
 const { transferCancelSubmit } = useSpotPresaleTransferCancel()
 const { data: details } = useRequest(queryTHJPurchaseTransferOrderDetail, {
     params: {

+ 1 - 0
src/types/model/order.d.ts

@@ -667,6 +667,7 @@ declare namespace Model {
         desaddress: string; // 目的地地址
         enddate: string; // 到期日期(交收日期)
         enddatemonth: string; // 到期月份
+        firstbuyuserid: number;
         lastprice: number; // [实际价]到期价格
         payeddeposit: number; // 买方已付定金(预付款(含定金))
         pointflag: boolean; // 是否已点价