lifanagju_citu il y a 7 mois
Parent
commit
146230ebc8
2 fichiers modifiés avec 2 ajouts et 6 suppressions
  1. 2 0
      layout/components/authModal/necessaryInfo/index.vue
  2. 0 6
      store/user.js

+ 2 - 0
layout/components/authModal/necessaryInfo/index.vue

@@ -90,6 +90,8 @@ onMounted(() => {
         formData.value[key] = baseInfo[key] || baseInfo[key] === 0 ? baseInfo[key] : formData.value[key] ? formData.value[key] : null
       })
     }
+    const phone = useUserStore?.userInfo?.phone || null
+    if (phone && !formData.value.phone) formData.value.phone = phone
   })
 })
 

+ 0 - 6
store/user.js

@@ -25,8 +25,6 @@ const defaultAccountInfo = {
   userId: ''
 }
 
-let phone = ''
-
 const tabUrl = [
   'pages/index/position',
   'pages/index/communicate',
@@ -67,7 +65,6 @@ export const userStore = defineStore('user', {
     },
 
     async handleRegister (query) {
-      phone = query.phone || ''
       const { data, code } = await userRegister(query)
       if (code === 0) {
         uni.showToast({
@@ -82,7 +79,6 @@ export const userStore = defineStore('user', {
     // 扫码注册登录
     async handleShareUserRegister (query) {
       try {
-        phone = query.phone || ''
         const { data, code } = await shareUserRegister(query)
         if (code === 0) {
           uni.showToast({
@@ -103,8 +99,6 @@ export const userStore = defineStore('user', {
 
     // 校验是否完善人才必填信息
     checkPersonBaseInfoFun(data) {
-      data = data || {}
-      if (phone && !data.phone) data.phone = phone; data.mobile = phone
       const necessaryInfoReady = checkPersonBaseInfo(data)
       data.necessaryInfoReady = necessaryInfoReady
       if (necessaryInfoReady) closeAuthModal()