Explorar el Código

提交认证信息后刷新认证状态

sunjh hace 6 años
padre
commit
62d6a14564

+ 5 - 1
src/components/authen/IndividualAuthenticationCreate.vue

@@ -134,7 +134,6 @@ export default {
       uploadIndividualAuthenticationInfo(this.user.userVO.id, newAuthentication, this.submitInfoSuccess, this.submitInfoFail)
     },
     submitInfoSuccess (res) {
-      this.hideLoading()
       console.log(res)
       getCurrentUser().then(res => {
         storageSave('user', res)
@@ -143,9 +142,11 @@ export default {
         storageSave('rolesPermissions', getRolesPermissions(res.roleList))
         this.hideLoading()
         //notify('success', '用户信息刷新成功')
+        this.sendBusMessage()
         this.$confirm('认证信息提交成功,将于10个工作日内审核完成')
           .then(_ => {
             //done()
+
             this.$router.push({
               name: 'IndividualAuthentication',
               params: {userId: this.user.userVO.id}
@@ -219,6 +220,9 @@ export default {
     },
     hideLoading () {
       this.loading = false
+    },
+    sendBusMessage(){
+      this.$root.$emit('user',this.user)
     }
   },
   created: function () {

+ 12 - 0
src/components/commons/Header.vue

@@ -354,6 +354,14 @@ export default {
 
     })
   },
+  watch:{
+    'user.authStatus'(val){
+      this.user.authStatus = val
+      console.log('changed')
+      console.log(this.user.authStatus)
+    },
+    deep:true
+  },
   methods: {
     openNavBarFunc () {
       this.openNavBar = !this.openNavBar
@@ -599,6 +607,10 @@ export default {
     }
   },
   created () {
+    var self = this
+    this.$root.$on('user',function (val) {
+      self.user = val
+    })
   },
   beforeMount () {
     this.setUserInfo()

+ 3 - 0
src/main.js

@@ -182,6 +182,9 @@ Vue.config.productionTip = false
 new Vue({
   el: '#app',
   router,
+  data:{
+    Bus:new Vue()
+  },
   components: {App},
   template: '<App/>'
 })