|
@@ -128,17 +128,20 @@
|
|
<view class="wxBtn">
|
|
<view class="wxBtn">
|
|
<view class="wxBtn_title">
|
|
<view class="wxBtn_title">
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
- <view class="text">手机号快捷登录</view>
|
|
|
|
|
|
+ <view class="text">快捷登录</view>
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
</view>
|
|
</view>
|
|
- <button
|
|
|
|
|
|
+ <button type="default" @click="quickLogin" class="wxloginBtn fl_c">
|
|
|
|
+ <image mode="widthFix" src="/static/icon_phone.png"></image>
|
|
|
|
+ </button>
|
|
|
|
+ <!-- <button
|
|
type="default"
|
|
type="default"
|
|
open-type="getPhoneNumber"
|
|
open-type="getPhoneNumber"
|
|
@getphonenumber="wxLogin"
|
|
@getphonenumber="wxLogin"
|
|
class="wxloginBtn fl_c"
|
|
class="wxloginBtn fl_c"
|
|
>
|
|
>
|
|
<image mode="widthFix" src="/static/icon_phone.png"></image>
|
|
<image mode="widthFix" src="/static/icon_phone.png"></image>
|
|
- </button>
|
|
|
|
|
|
+ </button> -->
|
|
</view>
|
|
</view>
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
</view>
|
|
</view>
|
|
@@ -158,6 +161,7 @@ RVQplIVs5z3MxcUa9ptKPHUTgh8xMCBvl8sUJKwkmn4vYWeDfHT22EL7Hr1pTMwU
|
|
hF6WiNlWfQTVoF1rhwIDAQAB
|
|
hF6WiNlWfQTVoF1rhwIDAQAB
|
|
-----END PUBLIC KEY-----`;
|
|
-----END PUBLIC KEY-----`;
|
|
import JSEncrypt from "@/pages4/static/jsencrypt.min.js";
|
|
import JSEncrypt from "@/pages4/static/jsencrypt.min.js";
|
|
|
|
+import { getOpenid } from "../../utils/authority";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -228,6 +232,7 @@ export default {
|
|
isBack: false,
|
|
isBack: false,
|
|
isDualAuth: false,
|
|
isDualAuth: false,
|
|
isAct: "",
|
|
isAct: "",
|
|
|
|
+ bindForm: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
@@ -249,7 +254,7 @@ export default {
|
|
onShow() {
|
|
onShow() {
|
|
// 获取code
|
|
// 获取code
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
- this.getwxCode();
|
|
|
|
|
|
+ // this.getwxCode();
|
|
// #endif
|
|
// #endif
|
|
},
|
|
},
|
|
onReady() {
|
|
onReady() {
|
|
@@ -559,7 +564,12 @@ export default {
|
|
this.$api.getInfo({ fromPlat: 1 }).then((resdata) => {
|
|
this.$api.getInfo({ fromPlat: 1 }).then((resdata) => {
|
|
if (resdata.data.code == 200) {
|
|
if (resdata.data.code == 200) {
|
|
this.$store.state.userInfo = resdata.data.data;
|
|
this.$store.state.userInfo = resdata.data.data;
|
|
-
|
|
|
|
|
|
+ if (this.bindForm.openId) {
|
|
|
|
+ this.$api.openIdLogin({
|
|
|
|
+ ...this.bindForm,
|
|
|
|
+ userId: resdata.data.data.userId,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
if (!this.isBack) {
|
|
if (!this.isBack) {
|
|
let goPath = "";
|
|
let goPath = "";
|
|
if (types == "wxlogin" || types == "smslogin") {
|
|
if (types == "wxlogin" || types == "smslogin") {
|
|
@@ -592,30 +602,20 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
- // } else {
|
|
|
|
- // //未完善信息,存为临时信息
|
|
|
|
- // uni.setStorageSync('user_account_temp', res.data.data.user_account);
|
|
|
|
- // uni.setStorageSync('token_temp', res.data.data.token);
|
|
|
|
- // this.$navTo.togo('/pages2/register/bind');
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
},
|
|
},
|
|
- // scanLoginCheck小程序校验PC登录二维码,执行登录获取到令牌,然后把扫码的路径最后面的6位标识码提交给后台就行
|
|
|
|
- // submitCode() {
|
|
|
|
- // console.log('跳转请求提交code到接口', this.scanCode)
|
|
|
|
- // this.$api.scanLoginCheck({
|
|
|
|
- // scanCode: this.scanCode
|
|
|
|
- // }).then((res) => {
|
|
|
|
- // if (res.data.code == 200) {
|
|
|
|
- // uni.navigateTo({
|
|
|
|
- // url: '/pages4/login/pcLoginSuccess'
|
|
|
|
- // })
|
|
|
|
- // } else {
|
|
|
|
- // this.$u.toast(res.data.msg)
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
|
|
+ async quickLogin() {
|
|
|
|
+ let openId = await getOpenid();
|
|
|
|
+ let res = await this.$api.openIdLogin({ openId });
|
|
|
|
+ if (res.data.code === 200) {
|
|
|
|
+ this.loginCallback(res);
|
|
|
|
+ } else {
|
|
|
|
+ this.bindForm = { openId, unionId: uni.getStorageSync("unionId") };
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: res.data.msg + "请用密码或验证码登录!",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|