|
@@ -16,7 +16,6 @@
|
|
|
<!-- #ifdef MP-ALIPAY -->
|
|
|
<view class="login-btn">
|
|
|
<button open-type="getAuthorize" @getAuthorize="onGetAuthorize" @error="onAuthError" scope='phoneNumber'>支付宝登录</button>
|
|
|
- <button @click="onCode">获取code</button>
|
|
|
</view>
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifndef MP-ALIPAY -->
|
|
@@ -188,9 +187,9 @@
|
|
|
$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
|
|
|
uni.hideLoading();
|
|
|
if (res.code == 0) {
|
|
|
- console.log(res);
|
|
|
+ console.log("11111",res);
|
|
|
uni.setStorageSync('userInfo', res.data)
|
|
|
- if (res.data.aliUserId) {
|
|
|
+ if (res.data.aliuserId) {
|
|
|
uni.$u.toast('登录成功');
|
|
|
setTimeout(() => {
|
|
|
uni.navigateBack({
|
|
@@ -205,16 +204,12 @@
|
|
|
uni.hideLoading();
|
|
|
})
|
|
|
},
|
|
|
- onAuthError(e) {
|
|
|
- console.log("err",e);
|
|
|
- },
|
|
|
onGetAuthorize(e){
|
|
|
let _this = this
|
|
|
if (!_this.checked) {
|
|
|
uni.$u.toast('请阅读并勾选底部协议');
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
my.getPhoneNumber({
|
|
|
success: (res) => {
|
|
|
uni.showLoading({
|
|
@@ -225,33 +220,18 @@
|
|
|
identity: 1,
|
|
|
noToken: true
|
|
|
}).then(res=>{
|
|
|
+ console.log("res",res);
|
|
|
if(res.code == 0){
|
|
|
uni.setStorageSync('token', res.token)
|
|
|
_this.getBaseInfoAli()
|
|
|
+ }else{
|
|
|
+ uni.hideLoading();
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- fail: (res) => {
|
|
|
- console.log("faukres",res);
|
|
|
- console.log('getPhoneNumber_fail');
|
|
|
- },
|
|
|
- });
|
|
|
- console.log("phone",e);
|
|
|
+ })
|
|
|
},
|
|
|
- onCode() {
|
|
|
- console.log("1111");
|
|
|
- my.getAuthCode ({
|
|
|
- scopes : ['auth_user'],
|
|
|
- success: (res) => {
|
|
|
- console.log(res);
|
|
|
- my.alert({
|
|
|
- content: res.authCode,
|
|
|
- });
|
|
|
- },
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|