提交 c01efd43 编写于 作者: A Anne_LXM

调整 一键登录要求的版本号

上级 6f088a13
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<text class="list-item-text">账号密码登录</text> <text class="list-item-text">账号密码登录</text>
<uni-id-pages-x-icons type="right-arrow" color="#999" /> <uni-id-pages-x-icons type="right-arrow" color="#999" />
</view> </view>
<!-- #ifdef APP && (uniVersion > 3.99 || uniVersion == 3.99) --> <!-- #ifdef APP && uniVersion >= 3.98 -->
<view class="list-item" @click="toLogin('univerify')" v-if="hasUniverify"> <view class="list-item" @click="toLogin('univerify')" v-if="hasUniverify">
<text class="list-item-text">一键登录</text> <text class="list-item-text">一键登录</text>
<uni-id-pages-x-icons type="right-arrow" color="#999" /> <uni-id-pages-x-icons type="right-arrow" color="#999" />
......
export default { export default {
"debug":true, "debug":true,
"agreements":{ "agreements":{
"serviceUrl": "https://uniapp.dcloud.io/", // 用户服务协议链接 "serviceUrl": "https://uniapp.dcloud.io/", // 用户服务协议链接
"privacyUrl": "https://uniapp.dcloud.io/", // 隐私政策条款链接 "privacyUrl": "https://uniapp.dcloud.io/", // 隐私政策条款链接
/* /*
* 哪些场景下显示 * 哪些场景下显示
* 1. register注册(包括登录并注册,如:短信验证码登录,一键登录) * 1. register注册(包括登录并注册,如:短信验证码登录,一键登录)
* 2. login登录(如:用户名密码登录,短信验证码登录) * 2. login登录(如:用户名密码登录,短信验证码登录)
*/ */
"scopeList": [ "scopeList": [
"register","login","realNameVerify","univerify" "register","login","realNameVerify","univerify"
] ]
}, },
"loginTypes":[ "loginTypes":[
"smsCode", "smsCode",
// #ifdef APP && ( uniVersion > 3.99 || uniVersion == 3.99) // #ifdef APP && uniVersion >= 3.98
"univerify", "univerify",
// #endif // #endif
"username", "username",
// 以下登录方式 uni-app x 暂不支持 // 以下登录方式 uni-app x 暂不支持
/* /*
"qq", "qq",
"xiaomi", "xiaomi",
...@@ -33,15 +33,15 @@ export default { ...@@ -33,15 +33,15 @@ export default {
"univerify", "univerify",
"apple" "apple"
// #endif // #endif
*/ */
], ],
/** /**
* 密码强度 * 密码强度
* super(超强:密码必须包含大小写字母、数字和特殊符号,长度范围:8-16位之间) * super(超强:密码必须包含大小写字母、数字和特殊符号,长度范围:8-16位之间)
* strong(强: 密密码必须包含字母、数字和特殊符号,长度范围:8-16位之间) * strong(强: 密密码必须包含字母、数字和特殊符号,长度范围:8-16位之间)
* medium (中:密码必须为字母、数字和特殊符号任意两种的组合,长度范围:8-16位之间) * medium (中:密码必须为字母、数字和特殊符号任意两种的组合,长度范围:8-16位之间)
* weak(弱:密码必须包含字母和数字,长度范围:6-16位之间) * weak(弱:密码必须包含字母和数字,长度范围:6-16位之间)
* 为空或false则不验证密码强度 * 为空或false则不验证密码强度
*/ */
passwordStrength: 'weak' passwordStrength: 'weak'
} as UTSJSONObject } as UTSJSONObject
...@@ -15,7 +15,7 @@ const loginTypes = configLoginTypes == null ? [] as string[] : configLoginTypes; ...@@ -15,7 +15,7 @@ const loginTypes = configLoginTypes == null ? [] as string[] : configLoginTypes;
const debug = config.getBoolean('debug') as boolean; const debug = config.getBoolean('debug') as boolean;
// #ifdef APP && ( uniVersion > 3.99 || uniVersion == 3.99) // #ifdef APP && uniVersion >= 3.98
import Univerify from '@/uni_modules/uni-id-pages-x/lib/Univerify.uts' import Univerify from '@/uni_modules/uni-id-pages-x/lib/Univerify.uts'
// #endif // #endif
...@@ -78,7 +78,7 @@ export default async function () { ...@@ -78,7 +78,7 @@ export default async function () {
}) })
} }
// #ifdef APP // #ifdef APP && uniVersion >= 3.98
// 如果uni-id-pages配置的登录功能有一键登录,有则执行预登录(异步) // 如果uni-id-pages配置的登录功能有一键登录,有则执行预登录(异步)
if (loginTypes.includes('univerify')) { if (loginTypes.includes('univerify')) {
const myUniverify = new Univerify() const myUniverify = new Univerify()
...@@ -152,8 +152,8 @@ export default async function () { ...@@ -152,8 +152,8 @@ export default async function () {
// needLogin相关代码-start(此代码仅为版本兼容提示使用,如已知晓可删除) // needLogin相关代码-start(此代码仅为版本兼容提示使用,如已知晓可删除)
const needLogin = config.getArray<string>('needLogin') const needLogin = config.getArray<string>('needLogin')
const uniCompileVersionCode = uni.getSystemInfoSync().uniCompileVersionCode as number const uniCompileVersionCode = uni.getSystemInfoSync().uniCompileVersionCode
if(needLogin != null && (uniCompileVersionCode > 3.99 || uniCompileVersionCode == 3.99) ){ if(needLogin != null && (uniCompileVersionCode >= 3.99 ) ){
const tipText = "uni-id-pages x v1.0.4+ 不再支持配置项config.needLogin,请升级HBuilderX 版本为3.99+,使用更强大 uni-id-router替代。详情查看:https://uniapp.dcloud.net.cn/uniCloud/uni-id/summary.html#uni-id-router" const tipText = "uni-id-pages x v1.0.4+ 不再支持配置项config.needLogin,请升级HBuilderX 版本为3.99+,使用更强大 uni-id-router替代。详情查看:https://uniapp.dcloud.net.cn/uniCloud/uni-id/summary.html#uni-id-router"
console.error(tipText) console.error(tipText)
uni.showModal({ uni.showModal({
......
...@@ -17,11 +17,11 @@ const loginTypes = config.getArray<string>('loginTypes'); ...@@ -17,11 +17,11 @@ const loginTypes = config.getArray<string>('loginTypes');
// buttonsList.push(buttons) // buttonsList.push(buttons)
// }) // })
// #ifdef uniVersion < 3.99 // #ifdef uniVersion < 3.98
// #endif // #endif
// #ifdef APP && (uniVersion > 3.99 || uniVersion == 3.99) // #ifdef APP && uniVersion >= 3.98
const univerifyManager = uni.getUniverifyManager(); const univerifyManager = uni.getUniverifyManager();
export default class Univerify { export default class Univerify {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<script> <script>
import { state } from '@/uni_modules/uni-id-pages-x/store.uts'; import { state } from '@/uni_modules/uni-id-pages-x/store.uts';
import config from '@/uni_modules/uni-id-pages-x/config.uts'; import config from '@/uni_modules/uni-id-pages-x/config.uts';
// #ifdef APP // #ifdef APP && uniVersion >= 3.98
import Univerify from '@/uni_modules/uni-id-pages-x/lib/Univerify.uts' import Univerify from '@/uni_modules/uni-id-pages-x/lib/Univerify.uts'
// #endif // #endif
export default { export default {
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
methods: { methods: {
login(){}, login(){},
verify(){ verify(){
// #ifdef APP // #ifdef APP && uniVersion >= 3.98
const univerifyManager = new Univerify() const univerifyManager = new Univerify()
univerifyManager.verify(true) univerifyManager.verify(true)
// #endif // #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册