提交 5d621eca authored 作者: GOD_ZYX's avatar GOD_ZYX

审核 统一采用 账号登录

上级 9e9980ba
...@@ -16,7 +16,7 @@ const BindAccount = { ...@@ -16,7 +16,7 @@ const BindAccount = {
/* 调用接口 - 使用账号登录 */ /* 调用接口 - 使用账号登录 */
wx.request({ wx.request({
url: util.config.URL_PATH + '/tenant/user/account-login', url: util.config.URL_PATH + '/tenant/user/account-login',
data: { username: _bind.account, password: _bind.pwd }, method: 'POST', header: { skey: wx.getStorageSync('userSession').sessionKey, tenant: 'sofia' }, data: { username: _bind.account, password: _bind.pwd }, method: 'POST', header: { skey: wx.getStorageSync('userSession').sessionKey, tenant: util.config.tenant },
success: function (res) { success: function (res) {
if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; } if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
wx.hideToast() wx.hideToast()
...@@ -25,7 +25,7 @@ const BindAccount = { ...@@ -25,7 +25,7 @@ const BindAccount = {
url: util.config.URL_PATH + '/tenant/user/getinfo', url: util.config.URL_PATH + '/tenant/user/getinfo',
data: {}, method: 'GET', header: { data: {}, method: 'GET', header: {
skey: wx.getStorageSync('userSession').sessionKey, skey: wx.getStorageSync('userSession').sessionKey,
tenant: 'sofia' tenant: util.config.tenant
}, },
success: res => { success: res => {
if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; } if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
......
...@@ -26,7 +26,7 @@ const BindPhone = { ...@@ -26,7 +26,7 @@ const BindPhone = {
wx.showToast({ title: '验证码请求中', icon: 'none' }) wx.showToast({ title: '验证码请求中', icon: 'none' })
wx.request({ wx.request({
url: util.config.URL_PATH + '/tenant/user/get-code', url: util.config.URL_PATH + '/tenant/user/get-code',
data: { mobile: _bind.phone }, method: 'POST', header: { tenant: 'sofia' }, data: { mobile: _bind.phone }, method: 'POST', header: { tenant: util.config.tenant },
success: function (res) { success: function (res) {
if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return ; } if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return ; }
wx.hideToast() wx.hideToast()
...@@ -49,7 +49,7 @@ const BindPhone = { ...@@ -49,7 +49,7 @@ const BindPhone = {
/* 调用接口 - 使用验证码登录 */ /* 调用接口 - 使用验证码登录 */
wx.request({ wx.request({
url: util.config.URL_PATH + '/tenant/user/code-login', url: util.config.URL_PATH + '/tenant/user/code-login',
data: { mobile: _bind.phone, code: _bind.code }, method: 'POST', header: { skey: wx.getStorageSync('userSession').sessionKey, tenant: 'sofia' }, data: { mobile: _bind.phone, code: _bind.code }, method: 'POST', header: { skey: wx.getStorageSync('userSession').sessionKey, tenant: util.config.tenant },
success: function (res) { success: function (res) {
if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return ; } if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return ; }
wx.hideToast() wx.hideToast()
...@@ -59,7 +59,7 @@ const BindPhone = { ...@@ -59,7 +59,7 @@ const BindPhone = {
url: util.config.URL_PATH + '/tenant/user/getinfo', url: util.config.URL_PATH + '/tenant/user/getinfo',
data: {}, method: 'GET', header: { data: {}, method: 'GET', header: {
skey: wx.getStorageSync('userSession').sessionKey, skey: wx.getStorageSync('userSession').sessionKey,
tenant: 'sofia' tenant: util.config.tenant
}, },
success: res => { success: res => {
if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; } if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view wx:else class="countdown">已发送({{bindphone.countDown}}s)</view> <view wx:else class="countdown">已发送({{bindphone.countDown}}s)</view>
</view> </view>
<view class="confirm" bindtap="codeConfirm">确定</view> <view class="confirm" bindtap="codeConfirm">确定</view>
<view class="other-login" bindtap="accountLogin">账号登录</view> <view wx:if="{{isUseAccountLogin}}" class="other-login" bindtap="accountLogin">账号登录</view>
</view> </view>
</view> </view>
</template> </template>
\ No newline at end of file
...@@ -14,7 +14,9 @@ Page({ ...@@ -14,7 +14,9 @@ Page({
// 绑定手机号 相关 // 绑定手机号 相关
bindphone: { isShow: '', getCode: true, countDown: 60, phone: '', code: '' }, bindphone: { isShow: '', getCode: true, countDown: 60, phone: '', code: '' },
// 绑定账号 相关 // 绑定账号 相关
bindaccount: { isShow: '', account: '', pwd: '' } bindaccount: { isShow: '', account: '', pwd: '' },
// 是否 可以使用登录
isUseAccountLogin: true
}, },
goOutSite: function () { goOutSite: function () {
// wx.navigateTo({ // wx.navigateTo({
...@@ -25,7 +27,16 @@ Page({ ...@@ -25,7 +27,16 @@ Page({
}) })
}, },
/* 进入页面,先判断是否获取用户信息 */ /* 进入页面,先判断是否获取用户信息 */
onReady: function () { wx.hideLoading() }, onReady: function () {
/* 判别 是否显示 账号登录 */
wx.request({
url: util.config.URL_PATH + '/tenant/switch/lock',
data: {}, method: 'GET', header: { tenant: util.config.tenant }, success: res => {
this.setData({ 'isUseAccountLogin': res.data.switch })
}
})
wx.hideLoading();
},
// e.detail.userInfo, // e.detail.userInfo,
/* 按键授权,微信新版 - 获取用户信息 - 授权方式 */ /* 按键授权,微信新版 - 获取用户信息 - 授权方式 */
getUserInfo: function (e) { this.getInfo() }, getUserInfo: function (e) { this.getInfo() },
......
...@@ -8,6 +8,7 @@ const config = { ...@@ -8,6 +8,7 @@ const config = {
// outSiteLink: 'https://kelley2.ezijing.com', // 测试外链 // outSiteLink: 'https://kelley2.ezijing.com', // 测试外链
URL_PATH: 'https://api.ezijing.com', // 正式域名 URL_PATH: 'https://api.ezijing.com', // 正式域名
outSiteLink: 'https://e-learning.ezijing.com', // 正式外链 outSiteLink: 'https://e-learning.ezijing.com', // 正式外链
tenant: 'sofia'
} }
/* 请求接口统一 重定义 */ /* 请求接口统一 重定义 */
const requestApi = (obj) => { const requestApi = (obj) => {
...@@ -16,7 +17,7 @@ const requestApi = (obj) => { ...@@ -16,7 +17,7 @@ const requestApi = (obj) => {
data: obj.data || '', // 不必填 data: obj.data || '', // 不必填
header: { header: {
'skey': wx.getStorageSync('userSession').sessionKey, 'skey': wx.getStorageSync('userSession').sessionKey,
'tenant': 'sofia', 'tenant': config.tenant,
'content-type': 'application/x-www-form-urlencoded', 'content-type': 'application/x-www-form-urlencoded',
// 测试用 // 测试用
// 'Cookie': '_idt=jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8; _ga=GA1.2.1777311393.1531910388; Hm_lvt_64d86060eda3e464ab4928484860b4ea=1531998677; pt_37c2513b=uid=K0MVCaW1zOQbL9Hlh4nwcA&nid=0&vid=j38J/KRanp7TFqxsiK0Ryw&vn=14&pvn=3&sact=1533523932802&to_flag=0&pl=NbnhKybdedL6K-YTE0zzsQ*pt*1533523932802; _pk_id.8.50b6=5e9684d55d7b51d1.1534129436.5.1534223988.1534222943.; Hm_lvt_35891a16eff03ec8bb219e4a00dbaf7a=1534307203; looyu_id=3aa78c2b7a744584f9f6fef015c4157b66_10036753%3A6; Qs_lvt_217181=1534307202; pt_s_6d83a9d6=vt=1534308606705&cad=; Hm_lpvt_35891a16eff03ec8bb219e4a00dbaf7a=1534308607; Qs_pv_217181=4039008301502242300%2C2643992663734177300%2C23948192170497664%2C3823352575569261000; pt_6d83a9d6=uid=EXg24v5T9wUibq5/wWWZCg&nid=0&vid=4NDbaXQ0RlX8HEv7TTSzkA&vn=8&pvn=2&sact=1534308606705&to_flag=1&pl=Rcddj0FCL0MTlYRofJeCeA*pt*1534308606705; Hm_lvt_81efeffaf531027591c4d577ee4a5cb4=1533525823,1534473796; _SUP=00da585a6b1b53bd453d1b30cbf9812ff9ef0313e4f5756651f3218543452c27a%3A2%3A%7Bi%3A0%3Bs%3A4%3A%22_SUP%22%3Bi%3A1%3Bs%3A144%3A%22MFpTR3h1QmtTSlM1Z3JvLmVscG1heGUuMTBzYWMtZWRPWnFoeDdsMFlCTkFiTFNjZFl3UVVDZkVwa3N3UlgxZEFVQTlkTnFhRU54c3RLUGEtMTI1LVRHVDAuNDI3NDQ0ODQ4ODA1MzQ5MDU%3D%22%3B%7D; Hm_lpvt_81efeffaf531027591c4d577ee4a5cb4=1535072424; _pk_id.7.50b6=a73f1add4efca30d.1531815381.52.1535110040.1535110040.; _pk_ses.7.50b6=*' // 'Cookie': '_idt=jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8; _ga=GA1.2.1777311393.1531910388; Hm_lvt_64d86060eda3e464ab4928484860b4ea=1531998677; pt_37c2513b=uid=K0MVCaW1zOQbL9Hlh4nwcA&nid=0&vid=j38J/KRanp7TFqxsiK0Ryw&vn=14&pvn=3&sact=1533523932802&to_flag=0&pl=NbnhKybdedL6K-YTE0zzsQ*pt*1533523932802; _pk_id.8.50b6=5e9684d55d7b51d1.1534129436.5.1534223988.1534222943.; Hm_lvt_35891a16eff03ec8bb219e4a00dbaf7a=1534307203; looyu_id=3aa78c2b7a744584f9f6fef015c4157b66_10036753%3A6; Qs_lvt_217181=1534307202; pt_s_6d83a9d6=vt=1534308606705&cad=; Hm_lpvt_35891a16eff03ec8bb219e4a00dbaf7a=1534308607; Qs_pv_217181=4039008301502242300%2C2643992663734177300%2C23948192170497664%2C3823352575569261000; pt_6d83a9d6=uid=EXg24v5T9wUibq5/wWWZCg&nid=0&vid=4NDbaXQ0RlX8HEv7TTSzkA&vn=8&pvn=2&sact=1534308606705&to_flag=1&pl=Rcddj0FCL0MTlYRofJeCeA*pt*1534308606705; Hm_lvt_81efeffaf531027591c4d577ee4a5cb4=1533525823,1534473796; _SUP=00da585a6b1b53bd453d1b30cbf9812ff9ef0313e4f5756651f3218543452c27a%3A2%3A%7Bi%3A0%3Bs%3A4%3A%22_SUP%22%3Bi%3A1%3Bs%3A144%3A%22MFpTR3h1QmtTSlM1Z3JvLmVscG1heGUuMTBzYWMtZWRPWnFoeDdsMFlCTkFiTFNjZFl3UVVDZkVwa3N3UlgxZEFVQTlkTnFhRU54c3RLUGEtMTI1LVRHVDAuNDI3NDQ0ODQ4ODA1MzQ5MDU%3D%22%3B%7D; Hm_lpvt_81efeffaf531027591c4d577ee4a5cb4=1535072424; _pk_id.7.50b6=a73f1add4efca30d.1531815381.52.1535110040.1535110040.; _pk_ses.7.50b6=*'
...@@ -102,7 +103,7 @@ const loginApi = (obj, callback) => { ...@@ -102,7 +103,7 @@ const loginApi = (obj, callback) => {
wx.request({ wx.request({
url: config.URL_PATH + '/tenant/user/applets-login', url: config.URL_PATH + '/tenant/user/applets-login',
data: { code: obj.code, encrypted_data: obj.encryptedData, iv: obj.iv }, method: 'POST', header: { data: { code: obj.code, encrypted_data: obj.encryptedData, iv: obj.iv }, method: 'POST', header: {
tenant: 'sofia' tenant: config.tenant
}, },
success: res => { callback(res, obj); } success: res => { callback(res, obj); }
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论