|
@@ -1,7 +1,7 @@
|
|
|
import api from '@/api'
|
|
|
import { showError, getUrlParam, getMeechatType, openBlankWindow, getUserOpt, setUserOpt, getShowLoginTyps } from '@/util/util'
|
|
|
import { mapActions, mapState, mapMutations } from 'vuex'
|
|
|
-import ScatterJS from 'scatter-js/dist/scatter.esm'
|
|
|
+import ScatterJS from 'scatterjs-core'
|
|
|
import EthHelper from '@/util/ethHelper.js'
|
|
|
import TronHelper from '@/util/tronHelper.js'
|
|
|
import { Message } from 'element-ui'
|
|
@@ -57,7 +57,6 @@ export const accountLoginMixin = {
|
|
|
this.curLoginType = getUserOpt('loginType') || 'eos'
|
|
|
|
|
|
if ((this.curLoginType == 'eos' || this.curLoginType == 'meetone')) {
|
|
|
- alert('checkLocalLogin succ')
|
|
|
if (top === self) {
|
|
|
await this.loginEosMeetoneCommon(this.curLoginType)
|
|
|
} else {
|
|
@@ -149,6 +148,9 @@ export const accountLoginMixin = {
|
|
|
|
|
|
return new Promise(async (resolve, reject) => {
|
|
|
this.setLogining(true)
|
|
|
+ document.addEventListener('scatterLoaded', () => {
|
|
|
+ console.log('ScatterJS.scatter')
|
|
|
+ })
|
|
|
// 连接scatter
|
|
|
ScatterJS.scatter.connect('MEE_CHAT').then(async connected => {
|
|
|
if (connected) {
|
|
@@ -159,7 +161,7 @@ export const accountLoginMixin = {
|
|
|
window.ScatterJS = null
|
|
|
if (getUserOpt('isChangeIndentity') == 1) {
|
|
|
setUserOpt('isChangeIndentity', 0)
|
|
|
- await (ScatterJS.scatter && ScatterJS.scatter.identity && ScatterJS.scatter.forgetIdentity && ScatterJS.scatter.forgetIdentity())
|
|
|
+ await (ScatterJS.scatter && ScatterJS.scatter.identity && ScatterJS.scatter.logout && ScatterJS.scatter.logout())
|
|
|
}
|
|
|
|
|
|
try {
|
|
@@ -191,7 +193,7 @@ export const accountLoginMixin = {
|
|
|
}
|
|
|
|
|
|
this.$store.commit('setAccount', '')
|
|
|
- await (ScatterJS.scatter && ScatterJS.scatter.identity && ScatterJS.scatter.forgetIdentity && ScatterJS.scatter.forgetIdentity())
|
|
|
+ await (ScatterJS.scatter && ScatterJS.scatter.identity && ScatterJS.scatter.logout && ScatterJS.scatter.logout())
|
|
|
}
|
|
|
} catch (error) {
|
|
|
this.$store.commit('setAccount', '')
|