Browse Source

修改登录获取不到用户信息会再次获取

zhangyu 5 years ago
parent
commit
417bcedbf0

+ 2 - 2
src/framework/components/messagesever/index.vue

@@ -2,7 +2,7 @@
  * @Author: zhangyu
  * @Date: 2019-08-26 15:22:13
  * @Info: 
- * @LastEditTime : 2020-01-03 10:59:36
+ * @LastEditTime : 2020-01-03 11:38:57
  -->
 <template>
   <div class="notification-box" v-clickOutside="handleClose" @click="handleClickRead">
@@ -152,7 +152,7 @@ export default {
     connect() {
       this.client = Stomp.client(MQTT_SERVICE)
       this.client.reconnect_delay = 5000
-      var clientid = `sagaMQ-${this.userInfo.userName}`
+      var clientid = `sagaMQ-${this.userInfo.userName}-${new Date().getTime()}`
       var headers = {
         'login': MQTT_USERNAME,
         'passcode': MQTT_PASSWORD,

+ 1 - 1
src/framework/layout/layout-store.js

@@ -104,7 +104,7 @@ export default {
       return new Promise((resolve, reject) => {
         frameworkApi.loadUserInfo().then(resp => {
           console.log(resp)
-          if (resp.Result == 'success') {
+          if (resp.Result == 'success' && resp.UserId) {
             state.userInfo = {userName: resp.Username, userId: resp.UserId}
             state.userId = resp.UserId
             storage.set('user_name', resp.Username)