修正了Login.vue里"renewing"的问题,但仍然不能调用 randomSecword(),这句导致报错 "window is not defined"。猜测是 bitcore-mnemonic 不能在前端页面里使用。

This commit is contained in:
luk.lu
2018-11-17 16:10:13 +08:00
parent 390d3ed15e
commit 3c934baa07
5 changed files with 14 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ export default {
mnemonic: '',
errorMnemonic: '',
signing: false,
renewing: false,
},
getters: {
@@ -36,7 +37,7 @@ export default {
actions: {
async login({ state, commit }) {
commit('updateSign', true)
const account = (await ticApi.secword2Account(state.mnemonic)) || {}
const account = (await ticApi.secword2account(state.mnemonic)) || {}
console.log(account)
commit('updateSign', false)
if (await ticApi.isAddress(account.address)) {
@@ -48,7 +49,7 @@ export default {
},
async createSecword({ state, commit }) {
alert('entering createSecword')
let secword = await ticApi.randomSecword('English')
let secword = await ticApi.randomSecword() // 这句导致报错 "window is not defined"。猜测是 bitcore-mnemonic 不能在前端页面里使用。
alert('after secword')
console.info('secword=' + secword)
alert('secword=' + secword)