提交 2ea33f18 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修复因为uniVerify驼峰法与plus.oauth.getServices获取到的名称不保持一致导致的登陆项配置无效

上级 349ccbc1
......@@ -46,8 +46,8 @@ export default function() {
}
//控制登陆优先级
if (url == '/pages/ucenter/login-page/index/index') {
//一键登录(uniVerify)、账号(username)、验证码登陆(短信smsCode)
if (login[0] == 'uniVerify') {
//一键登录(univerify)、账号(username)、验证码登陆(短信smsCode)
if (login[0] == 'univerify') {
// console.log(e.url,url);
if (e.url == url) {
e.url += '?'
......
......@@ -38,12 +38,12 @@
oauthServices: []
}
},
props: {
agree:{
type:Boolean,
default(){
return false
}
props: {
agree:{
type:Boolean,
default(){
return false
}
},
config: {
type: Object,
......@@ -105,7 +105,7 @@
//去掉配置项中不存在的项
for (var i = 0; i < servicesList.length; i++) {
if (!this.loginConfig.includes(servicesList[i].id)) {
console.log(servicesList[i].id);
console.log('去掉配置项中不存在的项',servicesList[i].id);
servicesList.splice(i, 1)
}
}
......@@ -119,7 +119,8 @@
oauthServices.forEach(({
id
}) => {
if (this.config[id].isChecked) {
console.log(9527,id);
if (this.config[id].isChecked&&this.loginConfig.includes(id)) {
this.servicesList.push({
...this.config[id],
id
......@@ -137,7 +138,7 @@
console.error('获取服务供应商失败:' + JSON.stringify(err));
})
// #endif
// #ifdef MP-WEIXIN
// #ifdef MP-WEIXIN
let id = 'weixin'
if (this.loginConfig.includes(id)) {
this.servicesList.push({
......@@ -169,13 +170,13 @@
})
}
},
login_before(type, navigateBack = true) {
if(!this.agree){
return uni.showToast({
title: '你未同意隐私政策协议',
icon: 'none'
});
}
login_before(type, navigateBack = true) {
if(!this.agree){
return uni.showToast({
title: '你未同意隐私政策协议',
icon: 'none'
});
}
console.log(arguments);
let oauthService = this.oauthServices.find((service) => service.id == type)
......@@ -325,4 +326,4 @@
margin-top: 4px;
font-size: 26rpx;
}
</style>
</style>
{
"name" : "uni-starter",
"appid" : "__UNI__E5373F7",
"appid" : "__UNI__03B096E",
"description" : "集成了商用项目开发常见功能的项目模板",
"versionName" : "1.0.0",
"versionCode" : "100",
......@@ -32,7 +32,8 @@
"modules" : {
"Fingerprint" : {},
"Share" : {},
"Push" : {}
"Push" : {},
"OAuth" : {}
},
/* 应用发布信息 */
"distribute" : {
......
......@@ -25,7 +25,7 @@ module.exports = {
"/uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
"/pages/ucenter/userinfo/uploadCutImageToUnicloud"
],
"login": ["smsCode","uniVerify", "username", "weixin", "apple"],
"login": ["smsCode","univerify", "username", "weixin", "apple"],
/*
根据数组的第0项,决定登陆方式的第一优先级。
未列举到的,或设备环境不支持的选项,将被隐藏。
......
......@@ -124,10 +124,10 @@ exports.main = async (event, context) => {
mobile: params.mobile,
code: params.code
});
res = await uniID.bindMobile({
uid: params.uid,
mobile: params.mobile,
code: params.code
res = await uniID.bindMobile({
uid: params.uid,
mobile: params.mobile,
code: params.code
})
console.log(res);
break;
......@@ -186,7 +186,7 @@ exports.main = async (event, context) => {
await loginLog(res)
break;
case 'login_by_univerify':
res = await uniID.loginByUniverify(params)
res = await uniID.loginByuniverify(params)
await loginLog(res)
break;
case 'login_by_apple':
......@@ -199,14 +199,14 @@ exports.main = async (event, context) => {
case 'logout':
res = await uniID.logout(event.uniIdToken)
break;
case 'sendSmsCode':
return uniID.setVerifyCode({
mobile: params.mobile,
code:'123456',
type: params.type
})
case 'sendSmsCode':
return uniID.setVerifyCode({
mobile: params.mobile,
code:'123456',
type: params.type
})
// 简单限制一下客户端调用频率
const ipLimit = await db.collection('uni-verify').where({
......@@ -323,4 +323,4 @@ exports.main = async (event, context) => {
//返回数据给客户端
return res
};
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册