Bläddra i källkod

登陆后注入用户名称

YaolongHan 4 år sedan
förälder
incheckning
9d2815848a
1 ändrade filer med 4 tillägg och 14 borttagningar
  1. 4 14
      src/store/index.js

+ 4 - 14
src/store/index.js

@@ -232,11 +232,8 @@ export default new Vuex.Store({
                         }
                         //   给oA头添加名称
                         // 指定条问题
-                        window.wd_fm_info = {
-                            profile: {
-                                username: encodeURIComponent(res.username),
-                            },
-                        }
+                        document.getElementById("wd-fm-id-fm-switch-profile").style.display= 'inline-block';
+                        document.getElementById("wd-fm-id-fm-switch-profile").innerText ='您好,'+ res.username;
                     }
                 })
                 .catch((err) => {
@@ -259,19 +256,12 @@ export default new Vuex.Store({
                     if (res.result === 'success') {
                         // commit('STOREACCESSLEVEL', res.level)
                         commit('SETAUTHMSG', res)
-                        window.wd_fm_info = {
-                            profile: {
-                                username: encodeURIComponent(res.username),
-                            },
-                        }
+                        document.getElementById("wd-fm-id-fm-switch-profile").style.display= 'inline-block';
+                        document.getElementById("wd-fm-id-fm-switch-profile").innerText ='您好,'+ res.username;
                     }
                 })
                 .catch((err) => {
                     console.log('getuserfo catch', err)
-                    // router.push({
-                    //     path: '/404',
-                    // })
-                    // commit('SETISREQUESTtAUTH', err)
                 })
         },
         async getFloors(context) {