Commit 0f39f6a6 by LJM

js

parent a5275ccf
......@@ -11,6 +11,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-weixin:before {
content: "\e600";
}
.icon-wuliu:before {
content: "\e75f";
}
......
......@@ -3,7 +3,7 @@
<text class="logo"></text>
<text class="title">SCMWMS</text>
<button class="share row rowCenter verCenter" @tap="getUserProfileChange">
<text class="iconfont icon-jinggao1"></text>
<text class="iconfont icon-weixin"></text>
<text class="t1">微信授权登录</text>
</button>
<view class="copyright">©2022深圳市猎芯供应链有限公司 ALL RIGHTS RESERVED</view>
......@@ -48,19 +48,24 @@ export default {
wx.getUserProfile({
desc: '用于完善会员资料',
success: res => {
self.request(API.getWechatInfo, 'GET', { code: self.code }, true).then(data => {
console.log(data);
if (data.err_code === 0) {
uni.setStorageSync('openid', data.data.openid);
uni.setStorageSync('session_key', data.data.session_key);
uni.setStorageSync('unionid', data.data.unionid);
uni.navigateTo({
url: '/pages/mine/login'
});
self.request(API.getWechatInfo, 'GET', { code: self.code }, true).then(res => {
if (res.err_code === 0) {
if (res.data.token == '') {
uni.setStorageSync('openid', res.data.wechat_info.openid);
uni.setStorageSync('session_key', res.data.wechat_info.session_key);
uni.setStorageSync('unionid', res.data.wechat_info.unionid);
uni.navigateTo({
url: '/pages/mine/login'
});
} else {
uni.setStorageSync('token', res.data.token);
uni.navigateBack({
delta: 2
});
}
} else {
uni.showToast({
title: data.err_msg,
title: res.err_msg,
icon: 'none',
duration: 2000
});
......
......@@ -51,12 +51,13 @@ export default {
});
return false;
}
let unionid = uni.getStorageSync('unionid');
this.request(API.login, 'POST', { account: this.account, passwd: this.passwd }, true).then(res => {
this.request(API.login, 'POST', { account: this.account, passwd: this.passwd, unionid: unionid }, true).then(res => {
if (res.err_code === 0) {
uni.setStorageSync('token', res.data.token);
uni.navigateBack({
delta: 2
delta: 3
});
} else {
uni.showToast({
......
No preview for this file type
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 sign in to comment