From d60b42ea95f4061510cbf35bb508d24f3d04a735 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Wed, 13 Dec 2023 16:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=80=E9=94=AE=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get-univerify-manager.uvue | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/pages/API/get-univerify-manager/get-univerify-manager.uvue b/pages/API/get-univerify-manager/get-univerify-manager.uvue index 7c9ac806..90c68672 100644 --- a/pages/API/get-univerify-manager/get-univerify-manager.uvue +++ b/pages/API/get-univerify-manager/get-univerify-manager.uvue @@ -29,6 +29,11 @@ }, fail(err : PreLoginFail) { console.error("pre login fail => " + JSON.stringify(err)); + uni.showModal({ + title: '预登录失败', + content: JSON.parseObject(err.cause?.cause?.message ?? "")?.getString("errorDesc") ?? err.errMsg, + showCancel: false + }); } } as PreLoginOptions); }, @@ -48,6 +53,11 @@ }, fail: (err : PreLoginFail) => { console.error("pre login fail => " + JSON.stringify(err)); + uni.showModal({ + title: '预登录失败', + content: JSON.parseObject(err.cause?.cause?.message ?? "")?.getString("errorDesc") ?? err.errMsg, + showCancel: false + }); } } as PreLoginOptions); } @@ -71,26 +81,34 @@ openid: res.openId // 客户端一键登录接口返回的openid } }).then(res => { - uni.showModal({ - title: '取号成功', - content: res.result.getJSON("res")?.getString("phoneNumber"), - showCancel: false, - success: (_) => { - // 关闭登录页 - this.univerifyManager?.close(); - } - }); + // 关闭登录页 + this.univerifyManager?.close(); + setTimeout(() => { + uni.showModal({ + title: '取号成功', + content: res.result.getJSON("res")?.getString("phoneNumber"), + showCancel: false + }); + }, 100); }).catch(err => { console.error(JSON.stringify(err)); // 关闭登录页 this.univerifyManager?.close(); + setTimeout(() => { + uni.showModal({ + title: '取号失败', + content: (err as Error).message, + showCancel: false + }); + }, 100); }); }, fail: (err : LoginFail) => { console.error("login fail => " + err); - uni.showToast({ - title: "登录失败", - icon: "error" + uni.showModal({ + title: '登录失败', + content: JSON.parseObject(err.cause?.cause?.message ?? "")?.getString("errorDesc") ?? err.errMsg, + showCancel: false }); } } as LoginOptions); -- GitLab