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

View File

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