|
|
@@ -181,10 +181,10 @@ export default {
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.options = options;
|
|
|
- authorize();
|
|
|
},
|
|
|
onShow() {
|
|
|
backOpenId(this.openidLogin);
|
|
|
+ authorize();
|
|
|
},
|
|
|
onReady() {
|
|
|
this.$refs.uForm1.setRules(this.rules);
|
|
|
@@ -199,10 +199,13 @@ export default {
|
|
|
addParams() {
|
|
|
let str = "?";
|
|
|
if (this.options.backBill) {
|
|
|
- str += "backBill=" + this.options.backBill;
|
|
|
+ str += "&backBill=" + this.options.backBill;
|
|
|
}
|
|
|
if (this.options.isBack) {
|
|
|
- str += "isBack=" + this.options.isBack;
|
|
|
+ str += "&isBack=" + this.options.isBack;
|
|
|
+ }
|
|
|
+ if (this.options.shareCode) {
|
|
|
+ str += "&shareCode=" + this.options.shareCode;
|
|
|
}
|
|
|
return str;
|
|
|
},
|
|
|
@@ -225,7 +228,7 @@ export default {
|
|
|
})
|
|
|
.then((data) => {
|
|
|
this.$u.toast("登录成功");
|
|
|
- this.openid && this.bindOpenId();
|
|
|
+ this.bindOpenId();
|
|
|
this.loginCallback(data);
|
|
|
})
|
|
|
.finally(() => {
|
|
|
@@ -272,18 +275,19 @@ export default {
|
|
|
},
|
|
|
// 绑定openid和unionid
|
|
|
bindOpenId() {
|
|
|
- checkBindGzh().then((res) => {
|
|
|
- if (!res) {
|
|
|
- OfficialLogin({
|
|
|
- gzhOpenid: this.openid,
|
|
|
- unionId: uni.getStorageSync("unionid"),
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ this.openid &&
|
|
|
+ checkBindGzh().then((res) => {
|
|
|
+ if (!res) {
|
|
|
+ OfficialLogin({
|
|
|
+ gzhOpenid: this.openid,
|
|
|
+ unionId: uni.getStorageSync("unionid"),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
loginCallback(data) {
|
|
|
this.$store.commit("LOGIN_CB", data);
|
|
|
- this.openid && this.bindOpenId();
|
|
|
+ this.bindOpenId();
|
|
|
this.$store.dispatch("getUserInfo").then((res) => {
|
|
|
if (this.options.backBill) {
|
|
|
let href = uni.getStorageSync("BillHerf");
|