| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <view class="login">
- <en-loading></en-loading>
- </view>
- </template>
- <script>
- import EnLoading from "../../components/en-utils/en-loading/en-loading";
- import tools from "../../common/js/tools";
- import {login} from "@/api/member";
- import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
- export default {
- components: {
- EnLoading
- },
- data() {
- return {
- }
- },
- onLoad(query) {
- this.getAccount()
- },
- mounted() {
- },
- methods: {
- async getAccount(){
- console.log('--------------dssadsa')
- tokenpocketBnb.getAccounts().then(async (Address) => {
- console.log('Address:' + Address)
- // let data = await tokenpocketBnb.getTransactionData('0xFbb82E21F36D67FCb1b8aAade20C2b0a9F5aC6d2', 0.0001)
- // tokenpocketBnb.sendTransaction(data)
- // console.log(data)
- if (Address) {
- this.login(Address)
- } else {
- tools.toError(this.$t('index.error.errorMsg.noAddress'))
- }
- }).catch((e)=>{
- tools.toError(this.$t('index.error.errorMsg.noAddress'))
- })
- },
- login(Address){
- login({'address':Address}).then((res)=>{
- if(res.code===1){
- tools.setLoginInfo(res.data)
- setTimeout(()=>{
- uni.reLaunch({
- url: '/pages/index/index'
- })
- },50)
- }else {
- uni.reLaunch({
- url: 'pages/login/register?address='+Address
- })
- }
- })
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- @import url("/static/css/icon-common.css") ;
- </style>
|