| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <template>
- <view class="login">
- <en-loading></en-loading>
- </view>
- </template>
- <script>
- import EnLoading from "../../components/en-utils/en-loading/en-loading";
- import bitkeepTron from "../../common/wallet/bitkeep-wallet/bitkeep-tron";
- import tools from "../../common/js/tools";
- import {member} from "@/api/member";
- export default {
- components: {
- EnLoading
- },
- data() {
- return {
- }
- },
- onLoad(query) {
- this.getAccount()
- },
- mounted() {
- },
- methods: {
- getAccount(){
- bitkeepTron.getAccounts().then((Address)=>{
- if(Address){
- this.login(Address)
- }else {
- tools.toError('信息获取失败!')
- }
- }).catch((e)=>{
- tools.toError('信息获取失败!')
- })
- },
- login(Address){
- member({'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>
|