Commit 7333aca6 by 李嘉林

修改登录功能

parent 78f973bc
......@@ -6,7 +6,7 @@ console.log(process.env,'-----------------config------')
export default {
//登录
miniLogin(options){
return requestGET(`${process.env.OLSHOP_URL}/wx/mini_login`,options)
return requestPOST(`${process.env.OLSHOP_URL}/wx/mini_login`,options)
},
//绑定
bindUser(options){
......
......@@ -80,7 +80,8 @@ export default {
test_unionId: "",
fromType:'',//来源类型 mini:小程序跳转到当前登录页
scene:'',//场景
ossLink: ''//第三方点击进入链接
ossLink: '',//第三方点击进入链接
wxUserInfo:{},
};
},
onShow() {
......@@ -165,12 +166,15 @@ export default {
}
},
init() {
let _this = this;
return new Promise((resolve, reject) => {
login
.miniLogin({ code: this.code,
spokesmanRelId : '',
spokesmanGroupId : '',
spokesmanShopId : ''
spokesmanShopId : '',
nickname: _this.wxUserInfo.nickName,
headImgUrl: _this.wxUserInfo.avatarUrl
})
.then(res => {
if (res.data.code == 200) {
......@@ -204,6 +208,7 @@ export default {
}
},
getUserProfile() {
let _this = this;
if(this.content&&!this.checked) {
wx.showToast({
title: '您还未同意协议',
......@@ -220,6 +225,7 @@ export default {
wx.getUserProfile({
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (e) => {
_this.wxUserInfo = e.userInfo;
this.init()
.then(res => {
//存入openid
......@@ -250,8 +256,10 @@ export default {
});
}
} else {
if (res.data.data.isHaveUnion == "true") {
//有账号
// haveBindUserPhone
// 是否必须绑定手机号(0必须绑定,1不需要绑定
//有账号或不需要绑定手机号
if (res.data.data.isHaveUnion == "true" || this.mpApp.globalData.shopInfo.haveBindUserPhone == '1') {
this.backParams += `&sessionid=${
res.data.data.sessionId
}&needCertified=${res.data.data.NEED_CERTIFIED}`;
......
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