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