diff --git a/frontend/src/api/modules/user/index.ts b/frontend/src/api/modules/user/index.ts index e0625dda33..7a10aa02c5 100644 --- a/frontend/src/api/modules/user/index.ts +++ b/frontend/src/api/modules/user/index.ts @@ -81,7 +81,7 @@ export function getWeComInfo() { export function getWeComCallback(code: string) { return MSR.get( { url: GetWeComCallbackUrl, params: { code } }, - { ignoreCancelToken: true, errorMessageMode: 'message' } + { ignoreCancelToken: true, errorMessageMode: 'modal' } ); } @@ -92,7 +92,7 @@ export function getDingInfo() { export function getDingCallback(code: string) { return MSR.get( { url: GetDingCallbackUrl, params: { code } }, - { ignoreCancelToken: true, errorMessageMode: 'message' } + { ignoreCancelToken: true, errorMessageMode: 'modal' } ); } export function logout() { diff --git a/frontend/src/views/login/components/dingTalkQrCode.vue b/frontend/src/views/login/components/dingTalkQrCode.vue index 7d487955eb..74e5cc2aad 100644 --- a/frontend/src/views/login/components/dingTalkQrCode.vue +++ b/frontend/src/views/login/components/dingTalkQrCode.vue @@ -73,9 +73,9 @@ }, }); // 也可以在不跳转页面的情况下,使用code进行授权 - console.log(authCode); }, (errorMsg) => { + Message.error(`errorMsg of errorCbk: ${errorMsg}`); // 这里一般需要展示登录失败的具体原因,可以使用toast等轻提示 console.error(`errorMsg of errorCbk: ${errorMsg}`); } diff --git a/frontend/src/views/login/components/weComQrCode.vue b/frontend/src/views/login/components/weComQrCode.vue index 5e723bd64a..8637489c7f 100644 --- a/frontend/src/views/login/components/weComQrCode.vue +++ b/frontend/src/views/login/components/weComQrCode.vue @@ -16,7 +16,7 @@ import { getFirstRouteNameByPermission, routerNameHasPermission } from '@/utils/permission'; import * as ww from '@wecom/jssdk'; - import { WWLoginPanelSizeType, WWLoginRedirectType, WWLoginType } from '@wecom/jssdk'; + import { WWLoginErrorResp, WWLoginPanelSizeType, WWLoginRedirectType, WWLoginType } from '@wecom/jssdk'; const { t } = useI18n(); @@ -74,7 +74,8 @@ }, }); }, - onLoginFail(err: any) { + onLoginFail(err: WWLoginErrorResp) { + Message.error(`errorMsg of errorCbk: ${err.errMsg}`); console.log(err); }, });