baichun 5 years ago
parent
commit
67f1f231a2

+ 4 - 3
_src/components/panel/panel.vue

@@ -118,16 +118,17 @@ export default {
       if (flag) this.isShowSetting = !this.isShowSetting
       else this.isShowSetting = false
     },
-    handleLoginOut () {
+    async handleLoginOut () {
       this.isShowSetting = false
       // 初始vuex数据
       this.$store.commit('setUserInfo', null)
       this.$store.commit('initChatData')
       this.$store.commit('initGroupData')
 
-      this.$store.commit('chatAppLogin', false)
+      // this.$store.commit('chatAppLogin', false)
       this.$store.commit('toApp', false)
-      this.$store.dispatch('doScatterLogout')
+      await this.$store.dispatch('doScatterLogout')
+      location.reload()
     },
     handleFeedback () {
       API.base.feedback().then(({ data }) => {

+ 1 - 1
_src/mixins/login.js

@@ -161,7 +161,7 @@ export const accountLoginMixin = {
             window.ScatterJS = null
             if (getUserOpt('isChangeIndentity') == 1) {
               setUserOpt('isChangeIndentity', 0)
-              await (ScatterJS.scatter && ScatterJS.scatter.identity && ScatterJS.scatter.logout && ScatterJS.scatter.logout())
+              // await (ScatterJS.scatter && ScatterJS.scatter.identity && ScatterJS.scatter.logout && ScatterJS.scatter.logout())
             }
 
             try {

+ 3 - 2
_src/pages/h5/view/aboutMe.vue

@@ -84,13 +84,14 @@ export default {
     },
     loginOut () {
       this.$store.dispatch('doScatterLogout').then(() => {
-        this.$router.replace({ name: 'login', query: { from: '/me' } })
+        // this.$router.replace({ name: 'login', query: { from: '/me' } })
 
         this.$store.commit('setUserInfo', null)
         this.$store.commit('initChatData')
         this.$store.commit('initGroupData')
         this.$store.commit('chatAppLogin', false)
-        this.$store.commit('toApp', true)
+        // this.$store.commit('toApp', true)
+        location.reload()
       })
     },
     // 账号显示与隐藏

+ 1 - 71
_src/store/actions.js

@@ -77,76 +77,6 @@ export const actions = {
     }
   },
   /**
-   * 调起授权登录
-	 * @param {Object} store
-	 * @param {Object} params
-   */
-  async doScatterLoginCopy ({ dispatch, commit, state }, h5Router) {
-    if (!state.scatter) {
-      showError('Please install the scatter', 'Scatter')
-    } else {
-      if (getUserOpt('isChangeIndentity') == 1) {
-        await actions.doScatterLogout(...arguments)
-        localStorage.setItem('accounts', '')
-        setUserOpt('isChangeIndentity', 0)
-      }
-      alert('networkConfig before')
-      // 获取最快主网
-      let networkConfig = await getNetwork()
-      alert('networkConfig next')
-
-      // 调用getIdentity方法获取用户名
-      try {
-        var identity = await state.scatter.login({
-          accounts: [networkConfig]
-        })
-      } catch (error) {
-        if (error.type !== 'identity_rejected') {
-          showError(error.message)
-        }
-        return Promise.reject(error)
-      }
-
-      let accounts = identity.accounts.find(x => x.blockchain === 'eos')
-
-      let lastAccounts = localStorage.getItem('accounts')
-
-      if (lastAccounts && JSON.parse(lastAccounts).name !== accounts.name) {
-        await actions.doScatterLogout(...arguments)
-        h5Router.push({ path: '/login' })
-        commit('setUserInfo', null)
-        commit('initChatData')
-        commit('initGroupData')
-        commit('chatAppLogin', false)
-        commit('toApp', false)
-      }
-
-      commit('setAccount', accounts)
-      localStorage.setItem('accounts', JSON.stringify(accounts))
-
-      // 如果当前登录的用户名和cookie中保存的account不一致
-      // 则删除cookie中保存的account
-      // 避免某些用户在移动端钱包中切换账号时跳过注销流程导致账号不一致的问题
-      // if (Cookie.getCookie('account') !== accounts.name) {
-      //   Cookie.delCookie('account')
-      // }
-      // 设置全局EOS对象
-      window.EOS = state.scatter.eos(networkConfig, Eos, {})
-
-      // 调用scatter登录成功后获取用户EOS、GT
-      // dispatch('getUserEOS')
-      // dispatch('getUserGT')
-      await dispatch('getAccount')
-
-      // 每分钟刷新一次
-      // this.limitTimer = setInterval(() => {
-      //   dispatch('getAccount')
-      // }, 60000)
-
-      return Promise.resolve(true)
-    }
-  },
-  /**
    * eos账号绑定
    * @param {*} param0
    */
@@ -227,7 +157,7 @@ export const actions = {
     setUserOpt('isChangeIndentity', 0)
 
     // return state.scatter && state.scatter.identity ? state.scatter.logout && state.scatter.logout() : true
-    return (state.scatter && state.scatter.identity && state.scatter.logout && state.scatter.logout()) || true
+    return state.scatter && state.scatter.logout && state.scatter.logout()
   },
 
   /**

File diff suppressed because it is too large
+ 0 - 0
dist/css/pc.bdb56b85.css


File diff suppressed because it is too large
+ 0 - 0
dist/js/chunk-3ab2e3e3.7bdfd765.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/chunk-common.0280e57f.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/chunk-common.59254d0d.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/h5.cb14af83.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/pc.c2e72e45.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/pc.d387f279.js


File diff suppressed because it is too large
+ 0 - 0
dist/sw.js


File diff suppressed because it is too large
+ 0 - 0
mini.html


File diff suppressed because it is too large
+ 0 - 0
protected/views/h5.html


File diff suppressed because it is too large
+ 0 - 0
protected/views/pc.html


Some files were not shown because too many files changed in this diff