提交 4eaf406d 编写于 作者: DCloud_JSON's avatar DCloud_JSON

update uni-id-pages-x

上级 e50dd806
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
crop, crop,
success: (res) => { success: (res) => {
console.log('res', res); console.log('res', res);
let tempFiles = res.tempFiles as UTSJSONObject[]; const tempFiles = res.tempFiles as ChooseImageTempFile[]
let tempFile = tempFiles[0]; let tempFile = tempFiles[0];
let tempFileName = tempFile['name'] as string | null let tempFileName = tempFile['name'] as string | null
let tempFilePath = tempFile['path'] as string | null let tempFilePath = tempFile['path'] as string | null
......
...@@ -57,7 +57,7 @@ export default async function () { ...@@ -57,7 +57,7 @@ export default async function () {
// return supportedLoginType?.includes(currentType) != true // return supportedLoginType?.includes(currentType) != true
// }) // })
const list:Array<string> = []; const list:Array<string> = [];
console.log('loginTypes: ',loginTypes); // console.log('loginTypes: ',loginTypes);
for (let i = 0; i < loginTypes.length; i++) { for (let i = 0; i < loginTypes.length; i++) {
const type = loginTypes[i]; const type = loginTypes[i];
if (type != 'smsCode') { if (type != 'smsCode') {
...@@ -85,7 +85,7 @@ export default async function () { ...@@ -85,7 +85,7 @@ export default async function () {
const univerifyManager = uni.getUniverifyManager(); const univerifyManager = uni.getUniverifyManager();
univerifyManager.preLogin({ univerifyManager.preLogin({
success() { success() {
console.log("pre login success"); // console.log("pre login success");
}, },
fail(err) { fail(err) {
console.error("pre login fail => " + JSON.stringify(err)); console.error("pre login fail => " + JSON.stringify(err));
...@@ -151,8 +151,7 @@ export default async function () { ...@@ -151,8 +151,7 @@ export default async function () {
// needLogin相关代码-start(此代码仅为版本兼容提示使用,如已知晓可删除) // needLogin相关代码-start(此代码仅为版本兼容提示使用,如已知晓可删除)
const needLogin = config.getArray<string>('needLogin') if(config['needLogin'] != null){
if(needLogin != null){
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({
...@@ -160,41 +159,6 @@ export default async function () { ...@@ -160,41 +159,6 @@ export default async function () {
showCancel: false, showCancel: false,
confirmText:"知道了" confirmText:"知道了"
}); });
}else{
const checkNeedLogin = (url:string):boolean=>{
if(state.isLogin){
return false
}
if (needLogin != null) {
return needLogin.every((item:string):boolean => {
return item == url || new RegExp(item).test(url)
})
}else{
return false
}
}
uni.addInterceptor('navigateTo',{
invoke:(e:NavigateToOptions)=>{
if (checkNeedLogin(e.url)) {
uni.showToast({
title: '请先登录',
icon: 'none'
})
e.url = "/uni_modules/uni-id-pages-x/pages/login/login?uniIdRedirectUrl=" + encodeURIComponent(e.url)
}
}
})
uni.addInterceptor('redirectTo',{
invoke:(e:RedirectToOptions)=>{
if (checkNeedLogin(e.url)) {
uni.showToast({
title: '请先登录',
icon: 'none'
})
e.url = "/uni_modules/uni-id-pages-x/pages/login/login?uniIdRedirectUrl=" + encodeURIComponent(e.url)
}
}
})
} }
// needLogin相关代码-end // needLogin相关代码-end
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
}, },
fail: (e: IFacialRecognitionVerifyError) => { fail: (e: IFacialRecognitionVerifyError) => {
let title = "验证失败" let title = "验证失败"
let content: string let content: string;
console.log( console.log(
`[frv-debug] certifyId auth error: certifyId -> ${this.certifyId}, error -> ${JSON.stringify(e)}` `[frv-debug] certifyId auth error: certifyId -> ${this.certifyId}, error -> ${JSON.stringify(e)}`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册