Commit 3bfe6f3c by xiongyuwen

no message

parent 962770a7
...@@ -78,17 +78,19 @@ export default { ...@@ -78,17 +78,19 @@ export default {
{ {
this.$router.push(`/category`); this.$router.push(`/category`);
}else{ }else{
this.code = this.getQueryVariable("code"); this.code = this.getQueryVariable("code");
this.state = this.getQueryVariable("state"); this.state = this.getQueryVariable("state");
if (preurl) { if (preurl) {
this.preurl = preurl; this.preurl = preurl;
} }
if (this.code) { if (!!this.code) {
this.getStaffInfo(this.code); this.getStaffInfo(this.code);
} else { } else {
this.pcwxgetCode();
this.createCode(); this.createCode();
this.create4kCode(); this.create4kCode();
this.pcwxgetCode();
} }
if (this.forums && this.forums.set_site && this.forums.set_site.site_mode) { if (this.forums && this.forums.set_site && this.forums.set_site.site_mode) {
this.site_mode = this.forums.set_site.site_mode; this.site_mode = this.forums.set_site.site_mode;
...@@ -245,10 +247,11 @@ export default { ...@@ -245,10 +247,11 @@ export default {
}); });
}, },
getStaffInfo(code) { getStaffInfo(code) {
let _this=this; let url=`https://discuz.bailuntec.com/api/login?code=${code}&state=${this.state}`
//this.$message.warning(url);
axios axios
.get( .get(
`https://discuz.bailuntec.com/api/login?code=${code}&state=${this.state}` url
) )
.then((res) => { .then((res) => {
this.userId = res.data.data.relationships.users.data.id; this.userId = res.data.data.relationships.users.data.id;
...@@ -273,7 +276,9 @@ export default { ...@@ -273,7 +276,9 @@ export default {
} }
} }
} }
}); }).catch((err) => {
this.$message.warning(err+url);
});
}, },
getQueryVariable(variable) { getQueryVariable(variable) {
var query = window.location.search.substring(1); var query = window.location.search.substring(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment