|
|
@@ -92,18 +92,27 @@
|
|
|
},
|
|
|
methods:{
|
|
|
copyData(){
|
|
|
- this.$copyText(this.code).then(function () {
|
|
|
- tools.success("Copy Success")
|
|
|
- }, function () {
|
|
|
- tools.success("Copy Failed")
|
|
|
- })
|
|
|
+ if (this.code===''){
|
|
|
+ this.$router.push({ path: '/login' })
|
|
|
+ }else {
|
|
|
+ this.$copyText(this.code).then(function () {
|
|
|
+ tools.success("Copy Success")
|
|
|
+ }, function () {
|
|
|
+ tools.success("Copy Failed")
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
getInfo(){
|
|
|
- userInfo().then((res)=>{
|
|
|
- if(res.code == 1){
|
|
|
- this.code = res.data.invite_code;
|
|
|
- }
|
|
|
- })
|
|
|
+ let token= localStorage.getItem('userToken')
|
|
|
+ if (token){
|
|
|
+ userInfo().then((res)=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.code = res.data.invite_code;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
}
|