From 4eaf406dd3571b7e94c649cbf0ea3f3f8ed7e968 Mon Sep 17 00:00:00 2001 From: linju Date: Mon, 9 Dec 2024 17:25:27 +0800 Subject: [PATCH] update uni-id-pages-x --- .../uni-id-pages-x-avatar.uvue | 2 +- uni_modules/uni-id-pages-x/init.uts | 42 ++----------------- .../userinfo/realnameAuth/realnameAuth.uvue | 2 +- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-avatar/uni-id-pages-x-avatar.uvue b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-avatar/uni-id-pages-x-avatar.uvue index b4da975..60a62f2 100644 --- a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-avatar/uni-id-pages-x-avatar.uvue +++ b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-avatar/uni-id-pages-x-avatar.uvue @@ -137,7 +137,7 @@ crop, success: (res) => { console.log('res', res); - let tempFiles = res.tempFiles as UTSJSONObject[]; + const tempFiles = res.tempFiles as ChooseImageTempFile[] let tempFile = tempFiles[0]; let tempFileName = tempFile['name'] as string | null let tempFilePath = tempFile['path'] as string | null diff --git a/uni_modules/uni-id-pages-x/init.uts b/uni_modules/uni-id-pages-x/init.uts index 0bcbd92..885fbc3 100644 --- a/uni_modules/uni-id-pages-x/init.uts +++ b/uni_modules/uni-id-pages-x/init.uts @@ -57,7 +57,7 @@ export default async function () { // return supportedLoginType?.includes(currentType) != true // }) const list:Array = []; - console.log('loginTypes: ',loginTypes); + // console.log('loginTypes: ',loginTypes); for (let i = 0; i < loginTypes.length; i++) { const type = loginTypes[i]; if (type != 'smsCode') { @@ -85,7 +85,7 @@ export default async function () { const univerifyManager = uni.getUniverifyManager(); univerifyManager.preLogin({ success() { - console.log("pre login success"); + // console.log("pre login success"); }, fail(err) { console.error("pre login fail => " + JSON.stringify(err)); @@ -151,8 +151,7 @@ export default async function () { // needLogin相关代码-start(此代码仅为版本兼容提示使用,如已知晓可删除) - const needLogin = config.getArray('needLogin') - if(needLogin != null){ + if(config['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" console.error(tipText) uni.showModal({ @@ -160,41 +159,6 @@ export default async function () { showCancel: false, 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 diff --git a/uni_modules/uni-id-pages-x/pages/userinfo/realnameAuth/realnameAuth.uvue b/uni_modules/uni-id-pages-x/pages/userinfo/realnameAuth/realnameAuth.uvue index 3fa318e..f51918b 100644 --- a/uni_modules/uni-id-pages-x/pages/userinfo/realnameAuth/realnameAuth.uvue +++ b/uni_modules/uni-id-pages-x/pages/userinfo/realnameAuth/realnameAuth.uvue @@ -146,7 +146,7 @@ }, fail: (e: IFacialRecognitionVerifyError) => { let title = "验证失败" - let content: string + let content: string; console.log( `[frv-debug] certifyId auth error: certifyId -> ${this.certifyId}, error -> ${JSON.stringify(e)}` -- GitLab