Ver Fonte

认证信息创建或修改后刷新用户信息

sunjh há 6 anos atrás
pai
commit
cc8bc61dd6

+ 20 - 3
src/components/authen/AgencyAuthentication.vue

@@ -33,8 +33,11 @@
           <el-tag :type="authentication.authStatus.style">{{authentication.authStatus.text}}</el-tag>
         </el-form-item>
         <el-form-item v-if="!isModifyMode && authentication.authStatus.text == '认证失败'" label="失败原因" prop="name">
-          <el-link v-if="authentication.explain!=null&&authentication.explain!=''" type="danger" disabled>{{authentication.explain}}</el-link>
-          <el-link v-if="authentication.explain==null || authentication.explain==''" type="danger" disabled>管理员未填写</el-link>
+          <el-link v-if="authentication.explain!=null&&authentication.explain!=''" type="danger" disabled>
+            {{authentication.explain}}
+          </el-link>
+          <el-link v-if="authentication.explain==null || authentication.explain==''" type="danger" disabled>管理员未填写
+          </el-link>
         </el-form-item>
         <el-form-item label="对公账户" prop="name">
           <el-input v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
@@ -102,7 +105,10 @@ import {
   getAllServiceTypes,
   getCurrentAgencyAuthInfo,
   getCurrentAuthenInfo,
+  getCurrentUser,
+  getRolesPermissions,
   storageGet,
+  storageSave,
   updateAgencyAuthInfo
 } from '@/js/index'
 
@@ -207,7 +213,18 @@ export default {
       console.log(res)
       this.hideLoading()
       this.cancelModify()
-      notify('success', '认证信息修改成功')
+      notify('success', '认证信息修改成功,正在为您刷新用户信息')
+      getCurrentUser().then(res => {
+        storageSave('user', res)
+        this.user = res
+        //this.rolesPermissions = getRolesPermissions(res.roleList)
+        storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+        this.hideLoading()
+        notify('success', '用户信息刷新成功')
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '重新获取用户信息失败:' + error.data)
+      })
     },
     updateAuthInfoFail (error) {
       this.hideLoading()

+ 32 - 15
src/components/authen/AgencyAuthenticationCreate.vue

@@ -86,7 +86,15 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
-import {getAllAgencyResourceTypes, getAllServiceTypes, storageGet, uploadAgencyAuthenticationInfo} from '@/js/index'
+import {
+  getAllAgencyResourceTypes,
+  getAllServiceTypes,
+  getCurrentUser,
+  getRolesPermissions,
+  storageGet,
+  storageSave,
+  uploadAgencyAuthenticationInfo
+} from '@/js/index'
 
 export default {
   name: 'AgencyAuthenticationCreate',
@@ -166,22 +174,31 @@ export default {
     },
     submitInfoSuccess (res) {
       console.log(res)
-      this.hideLoading()
-      this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
-        .then(_ => {
-          //done()
-          this.$router.push({
-            name: 'AgencyAuthentication',
-            params: {userId: this.user.userVO.id}
+      getCurrentUser().then(res => {
+        storageSave('user', res)
+        this.user = res
+        //this.rolesPermissions = getRolesPermissions(res.roleList)
+        storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+        this.hideLoading()
+        this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
+          .then(_ => {
+            //done()
+            this.$router.push({
+              name: 'AgencyAuthentication',
+              params: {userId: this.user.userVO.id}
+            })
           })
-          this.hideDialog()
-        })
-        .catch(_ => {
-          this.$router.push({
-            name: 'AgencyAuthentication',
-            params: {userId: this.user.userVO.id}
+          .catch(_ => {
+            this.$router.push({
+              name: 'AgencyAuthentication',
+              params: {userId: this.user.userVO.id}
+            })
           })
-        })
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '重新获取用户信息失败:' + error.data)
+      })
+
     },
     submitInfoFail (error) {
       this.hideLoading()

+ 27 - 5
src/components/authen/EnterpriseAuthentication.vue

@@ -34,8 +34,11 @@
           <el-tag :type="authentication.authStatus.style">{{authentication.authStatus.text}}</el-tag>
         </el-form-item>
         <el-form-item v-if="!isModifyMode && authentication.authStatus.text == '认证失败'" label="失败原因" prop="name">
-          <el-link v-if="authentication.explain!=null&&authentication.explain!=''" type="danger" disabled>{{authentication.explain}}</el-link>
-          <el-link v-if="authentication.explain==null || authentication.explain==''" type="danger" disabled>管理员未填写</el-link>
+          <el-link v-if="authentication.explain!=null&&authentication.explain!=''" type="danger" disabled>
+            {{authentication.explain}}
+          </el-link>
+          <el-link v-if="authentication.explain==null || authentication.explain==''" type="danger" disabled>管理员未填写
+          </el-link>
         </el-form-item>
         <el-form-item label="公司法人姓名" prop="name">
           <el-input v-if="isModifyMode" v-model="authentication.legalPersonName"></el-input>
@@ -70,7 +73,15 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
-import {defaultValue, getCurrentEnterpriseAuthInfo, storageGet, updateEnterpriseAuthInfo} from '@/js/index'
+import {
+  defaultValue,
+  getCurrentEnterpriseAuthInfo,
+  getCurrentUser,
+  getRolesPermissions,
+  storageGet,
+  storageSave,
+  updateEnterpriseAuthInfo
+} from '@/js/index'
 
 export default {
   name: 'EnterpriseAuthentication',
@@ -88,7 +99,7 @@ export default {
         unifiedSocialCreditCode: '',
         address: '',
         authStatus: {},
-        explain:''
+        explain: ''
       },
       rules: {
         // name: [
@@ -172,7 +183,18 @@ export default {
       this.authentication.unifiedSocialCreditCode = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
       this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
       this.authentication.address = res.address == null ? '暂未填写' : res.address
-      notify('success', '认证信息修改成功')
+      notify('success', '认证信息修改成功,正在为您刷新用户信息')
+      getCurrentUser().then(res => {
+        storageSave('user', res)
+        this.user = res
+        //this.rolesPermissions = getRolesPermissions(res.roleList)
+        storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+        this.hideLoading()
+        notify('success', '用户信息刷新成功')
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '重新获取用户信息失败:' + error.data)
+      })
     },
     updateAuthInfoFail (error) {
       this.hideLoading()

+ 31 - 14
src/components/authen/EnterpriseAuthenticationCreate.vue

@@ -57,7 +57,13 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
-import {storageGet, uploadEnterpriseAuthenticationInfo} from '@/js/index'
+import {
+  getCurrentUser,
+  getRolesPermissions,
+  storageGet,
+  storageSave,
+  uploadEnterpriseAuthenticationInfo
+} from '@/js/index'
 
 export default {
   name: 'EnterpriseAuthenticationCreate',
@@ -131,21 +137,32 @@ export default {
     submitInfoSuccess (res) {
       this.hideLoading()
       console.log(res)
-      this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
-        .then(_ => {
-          //done()
-          this.$router.push({
-            name: 'EnterpriseAuthentication',
-            params: {userId: this.user.userVO.id}
+      getCurrentUser().then(res => {
+        storageSave('user', res)
+        this.user = res
+        //this.rolesPermissions = getRolesPermissions(res.roleList)
+        storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+        this.hideLoading()
+        //notify('success', '用户信息刷新成功')
+        this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
+          .then(_ => {
+            //done()
+            this.$router.push({
+              name: 'EnterpriseAuthentication',
+              params: {userId: this.user.userVO.id}
+            })
           })
-          this.hideDialog()
-        })
-        .catch(_ => {
-          this.$router.push({
-            name: 'EnterpriseAuthentication',
-            params: {userId: this.user.userVO.id}
+          .catch(_ => {
+            this.$router.push({
+              name: 'EnterpriseAuthentication',
+              params: {userId: this.user.userVO.id}
+            })
           })
-        })
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '重新获取用户信息失败:' + error.data)
+      })
+
     },
     submitInfoFail (error) {
       this.hideLoading()

+ 22 - 5
src/components/authen/IndividualAuthentication.vue

@@ -33,8 +33,11 @@
           <el-tag :type="authentication.authStatus.style">{{authentication.authStatus.text}}</el-tag>
         </el-form-item>
         <el-form-item v-if="!isModifyMode && authentication.authStatus.text == '认证失败'" label="失败原因" prop="name">
-          <el-link v-if="authentication.explain!=null&&authentication.explain!=''" type="danger" disabled>{{authentication.explain}}</el-link>
-          <el-link v-if="authentication.explain==null || authentication.explain==''" type="danger" disabled>管理员未填写</el-link>
+          <el-link v-if="authentication.explain!=null&&authentication.explain!=''" type="danger" disabled>
+            {{authentication.explain}}
+          </el-link>
+          <el-link v-if="authentication.explain==null || authentication.explain==''" type="danger" disabled>管理员未填写
+          </el-link>
         </el-form-item>
         <el-form-item label="银行卡账户" prop="name">
           <el-input v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
@@ -67,10 +70,13 @@ import {
   getAllAgencyResourceTypes,
   getAllServiceTypes,
   getCurrentIndividualAuthenInfo,
+  getCurrentUser,
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
+  getRolesPermissions,
   storageGet,
-  updateIndividualAuthInfo,
+  storageSave,
+  updateIndividualAuthInfo
 } from '@/js/index'
 
 export default {
@@ -88,7 +94,7 @@ export default {
         bankAccount: '',
         address: '',
         authStatus: {},
-        explain:''
+        explain: ''
       },
       rules: {
         // name: [
@@ -175,7 +181,18 @@ export default {
       this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
       this.authentication.address = res.address == null ? '暂未填写' : res.address
       this.cancelModify()
-      notify('success', '认证信息修改成功')
+      notify('success', '认证信息修改成功,正在为您刷新用户信息')
+      getCurrentUser().then(res => {
+        storageSave('user', res)
+        this.user = res
+        //this.rolesPermissions = getRolesPermissions(res.roleList)
+        storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+        this.hideLoading()
+        notify('success', '用户信息刷新成功')
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '重新获取用户信息失败:' + error.data)
+      })
     },
     updateAuthInfoFail (error) {
       this.hideLoading()

+ 27 - 13
src/components/authen/IndividualAuthenticationCreate.vue

@@ -57,9 +57,12 @@ import {notify} from '@/constants/index'
 import {
   getAllAgencyResourceTypes,
   getAllServiceTypes,
+  getCurrentUser,
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
+  getRolesPermissions,
   storageGet,
+  storageSave,
   uploadIndividualAuthenticationInfo,
 } from '@/js/index'
 
@@ -133,21 +136,32 @@ export default {
     submitInfoSuccess (res) {
       this.hideLoading()
       console.log(res)
-      this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
-        .then(_ => {
-          //done()
-          this.$router.push({
-            name: 'IndividualAuthentication',
-            params: {userId: this.user.userVO.id}
+      getCurrentUser().then(res => {
+        storageSave('user', res)
+        this.user = res
+        //this.rolesPermissions = getRolesPermissions(res.roleList)
+        storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+        this.hideLoading()
+        //notify('success', '用户信息刷新成功')
+        this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
+          .then(_ => {
+            //done()
+            this.$router.push({
+              name: 'IndividualAuthentication',
+              params: {userId: this.user.userVO.id}
+            })
+            this.hideDialog()
           })
-          this.hideDialog()
-        })
-        .catch(_ => {
-          this.$router.push({
-            name: 'IndividualAuthentication',
-            params: {userId: this.user.userVO.id}
+          .catch(_ => {
+            this.$router.push({
+              name: 'IndividualAuthentication',
+              params: {userId: this.user.userVO.id}
+            })
           })
-        })
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '重新获取用户信息失败:' + error.data)
+      })
     },
     submitInfoFail (error) {
       this.hideLoading()