|
|
@@ -1,5 +1,5 @@
|
|
|
<script>
|
|
|
-// import {register} from "@/api/member";
|
|
|
+import {register} from "@/api/member";
|
|
|
import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
|
|
|
|
|
|
export default {
|
|
|
@@ -18,28 +18,30 @@ export default {
|
|
|
methods: {
|
|
|
async getAccount(){
|
|
|
console.log('---------------------------------',tokenpocketBnb)
|
|
|
- // tokenpocketBnb.getAccounts().then(async (Address) => {
|
|
|
- // console.log(Address)
|
|
|
- // if (Address) {
|
|
|
- // this.formData.address=Address
|
|
|
- // this.login()
|
|
|
- // } else {
|
|
|
- // // tools.goToError(2)
|
|
|
- // }
|
|
|
- // }).catch((e)=>{
|
|
|
- // console.log(e)
|
|
|
- // // tools.goToError(2)
|
|
|
- // })
|
|
|
+ tokenpocketBnb.getAccounts().then(async (Address) => {
|
|
|
+ console.log(Address)
|
|
|
+ if (Address) {
|
|
|
+ this.formData.address=Address
|
|
|
+ this.login()
|
|
|
+ } else {
|
|
|
+ // tools.goToError(2)
|
|
|
+ }
|
|
|
+ }).catch((e)=>{
|
|
|
+ console.log(e)
|
|
|
+ // tools.goToError(2)
|
|
|
+ })
|
|
|
},
|
|
|
login(){
|
|
|
- // register(this.formData).then((res) => {
|
|
|
- // if(res.code === 1) {
|
|
|
- // localStorage.setItem('token',res.data.token)
|
|
|
- // this.$router.push('/cc_list')
|
|
|
- // }else {
|
|
|
- // this.$message.error(res.msg)
|
|
|
- // }
|
|
|
- // })
|
|
|
+ register(this.formData).then((res) => {
|
|
|
+ if(res.code === 1) {
|
|
|
+ localStorage.setItem('token',res.data.token)
|
|
|
+ this.$router.push('/cc_list')
|
|
|
+ } if(res.code === 403) {
|
|
|
+ this.$router.push('/invite')
|
|
|
+ }else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
goToUrl() {
|
|
|
this.$router.push('/invite')
|