sunjh 6 lat temu
rodzic
commit
c9547b4f61
1 zmienionych plików z 68 dodań i 17 usunięć
  1. 68 17
      src/components/commons/Header.vue

+ 68 - 17
src/components/commons/Header.vue

@@ -313,7 +313,9 @@
 import {
   defaultValue,
   deleteAuthInfo,
-  getCurrentAuthenInfo,
+  getCurrentAgencyAuthInfo,
+  getCurrentEnterpriseAuthInfo,
+  getCurrentIndividualAuthenInfo,
   getCurrentUser,
   getRolesPermissions,
   logout,
@@ -427,13 +429,44 @@ export default {
       this.fullScreenLoading = false
     },
     handleClickAuthReject () {
-      this.getAuthInfo(this.showAuthRejectDialog)
+      if (this.user.userVO.authType == 'agency'){
+        this.$router.push({
+          name:'AgencyAuthentication'
+        })
+      }
+      if (this.user.userVO.authType == 'enterprise'){
+        this.$router.push({
+          name:'IndividualAuthentication'
+        })
+      }
+      if (this.user.userVO.authType == 'personal'){
+        this.$router.push({
+          name:'IndividualAuthentication'
+        })
+      }
+
+      //this.getAuthInfo()
     },
     handleClickAuthPass () {
-      this.getAuthInfo(this.showAuthPassDialog)
+      if (this.user.userVO.authType == 'agency'){
+        this.$router.push({
+          name:'AgencyAuthentication'
+        })
+      }
+      if (this.user.userVO.authType == 'enterprise'){
+        this.$router.push({
+          name:'IndividualAuthentication'
+        })
+      }
+      if (this.user.userVO.authType == 'personal'){
+        this.$router.push({
+          name:'IndividualAuthentication'
+        })
+      }
+      //this.getAuthInfo()
     },
     handleClickAuthChecking () {
-      this.getAuthInfo(this.showAuthCheckingDialog)
+      this.getAuthInfo()
     },
     showAuthRejectDialog () {
       this.isShowAuthRejectDialog = true
@@ -466,23 +499,41 @@ export default {
         notify('error', '删除认证信息失败:' + error.data)
       })
     },
-    getAuthInfo (successMethod) {
+    getAuthInfo () {
       this.showLoading()
-      getCurrentAuthenInfo().then((res) => {
-        console.log(res)
-        this.authInfo = res
-        this.hideLoading()
-        successMethod()
-      }).catch((error) => {
-        this.hideLoading()
-        notify('error', '加载用户认证信息失败:' + error.data)
-      })
+      if (this.user.userVO.authType == 'agency') {
+        getCurrentAgencyAuthInfo(this.user.userVO.id, this.getCurrentAgencyAuthInfoSuccess, this.getCurrentAgencyAuthInfoFail)
+      }
+      if (this.user.userVO.authType == 'personal') {
+        getCurrentIndividualAuthenInfo(this.user.userVO.id, this.getCurrentIndividualAuthenInfoSuccess, this.getCurrentIndividualAuthenInfoFail)
+      }
+      if (this.user.userVO.authType == 'enterprise') {
+        getCurrentEnterpriseAuthInfo(this.user.userVO.id, this.getCurrentEnterpriseAuthInfoSuccess, this.getCurrentEnterpriseAuthInfoFail)
+      }
+    },
+    getCurrentAgencyAuthInfoSuccess () {
+      this.hideLoading()
+    },
+    getCurrentAgencyAuthInfoFail () {
+      this.hideLoading()
+    },
+    getCurrentIndividualAuthenInfoSuccess () {
+      this.hideLoading()
+    },
+    getCurrentIndividualAuthenInfoFail () {
+      this.hideLoading()
+    },
+    getCurrentEnterpriseAuthInfoSuccess () {
+      this.hideLoading()
+    },
+    getCurrentEnterpriseAuthInfoFail () {
+      this.hideLoading()
     },
     handleUpdateAuthInfo () {
       this.hideAuthPassDialog()
       this.hideAuthRejectDialog()
       this.hideAuthCheckingDialog()
-      if (this.authInfo.type == '个人') {
+      if (this.user.userVO.authType == 'personal') {
         this.$router.push({
           name: 'IndividualAuthentication',
           params: {
@@ -490,7 +541,7 @@ export default {
           }
         })
       }
-      if (this.authInfo.type == '企业') {
+      if (this.authInfo.type == 'enterprise') {
         this.$router.push({
           name: 'EnterpriseAuthentication',
           params: {
@@ -498,7 +549,7 @@ export default {
           }
         })
       }
-      if (this.authInfo.type == '机构') {
+      if (this.authInfo.type == 'agency') {
         this.$router.push({
           name: 'AgencyAuthentication',
           params: {