From 0eced1f917648a71f509a2af0639846be87a7a73 Mon Sep 17 00:00:00 2001 From: Anne_LXM <54163582+anne-lxm@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:44:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=BD=93=E4=B8=8D?= =?UTF-8?q?=E6=BB=A1=E8=B6=B3=E4=B8=80=E9=94=AE=E7=99=BB=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=9B=9E=E9=80=80=E6=97=A0=E6=B3=95=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E7=99=BB=E5=BD=95=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/login/login-withoutpwd.vue | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue index a938597..64a6bcf 100644 --- a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue +++ b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue @@ -94,15 +94,31 @@ onReady() { // 是否优先启动一键登录。即:页面一加载就启动一键登录 //#ifdef APP-PLUS - if (this.type == "univerify") { - const pages = getCurrentPages(); - currentWebview = pages[pages.length - 1].$getAppWebview(); - currentWebview.setStyle({ - "top": "2000px" // 隐藏当前页面窗体 + if (config.loginTypes.includes('univerify') && this.type == "univerify") { + uni.preLogin({ + provider: 'univerify', + success: () => { + const pages = getCurrentPages(); + currentWebview = pages[pages.length - 1].$getAppWebview(); + currentWebview.setStyle({ + "top": "2000px" // 隐藏当前页面窗体 + }) + // this.type == this.loginTypes[1] + // console.log('开始一键登录'); + this.$refs.uniFabLogin.login_before('univerify') + }, + fail: (err) => { + console.log(err); + if (config.loginTypes.length > 1) { + this.$refs.uniFabLogin.login_before(config.loginTypes[1]) + } else { + uni.showModal({ + content: err.message, + showCancel: false + }); + } + } }) - this.type == this.loginTypes[1] - // console.log('开始一键登录'); - this.$refs.uniFabLogin.login_before('univerify') } //#endif }, -- GitLab