native的登录页面增加返回nonce

This commit is contained in:
cebgcontract 2022-05-05 13:20:03 +08:00
parent 7eab23e6f8
commit 8ffa7da8b1
2 changed files with 9 additions and 2 deletions

View File

@ -84,6 +84,7 @@ export default class ChainManager {
net_id: AppModule.chainId
})
nonce = preRequest.nonce + ''
AppModule.updateNonce(nonce)
}
await UserModule.Login({
@ -115,6 +116,8 @@ export default class ChainManager {
await UserModule.LogOut()
}
AppModule.updateStep(0)
}
if (preRequest.nonce) {
AppModule.updateNonce(preRequest.nonce + '')
}
} catch (err) {

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<chain-modal></chain-modal>
</div>
</template>
<script lang="ts">
@ -8,11 +8,13 @@ import { Component, Vue } from 'vue-property-decorator'
import ChainManager from '@/chain/ChainManager'
import { UserModule } from '@/store/modules/user'
import { AppModule } from '@/store/modules/app'
import ChainModal from '@/components/core/ChainModal.vue'
export const COCOS_SCHEMA = 'nativechain'
@Component({
name: 'NativeLogin',
components: {
ChainModal
}
})
@ -41,8 +43,10 @@ export default class NativeLogin extends Vue {
act: 'login',
account: AppModule.accountId,
chainid: AppModule.chainId,
token: UserModule.token
token: UserModule.token,
nonce: AppModule.nonce
}
console.log(data)
self.response(data)
}
if (this.logined) {