From 0150ff564771b418db8009ed15a1acb0fe2302ff Mon Sep 17 00:00:00 2001 From: ykcory Date: Thu, 28 Dec 2023 06:28:19 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=A0=BC=E5=BC=8F=E5=8C=96=20useLogin?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sys/login/useLogin.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/views/sys/login/useLogin.ts b/src/views/sys/login/useLogin.ts index 40a56b3..34b7616 100644 --- a/src/views/sys/login/useLogin.ts +++ b/src/views/sys/login/useLogin.ts @@ -3,9 +3,8 @@ import type { RuleObject } from 'ant-design-vue/lib/form/interface'; import { ref, computed, unref, Ref } from 'vue'; import { useI18n } from '/@/hooks/web/useI18n'; import { checkOnlyUser } from '/@/api/sys/user'; -import { defHttp } from '/@/utils/http/axios'; -import { OAUTH2_THIRD_LOGIN_TENANT_ID } from "/@/enums/cacheEnum"; -import { getAuthCache } from "/@/utils/auth"; +import { OAUTH2_THIRD_LOGIN_TENANT_ID } from '/@/enums/cacheEnum'; +import { getAuthCache } from '/@/utils/auth'; export enum LoginStateEnum { LOGIN, @@ -152,9 +151,9 @@ function checkUsername(rule, value, callback) { }); } } -async function checkPhone(rule, value, callback) { +async function checkPhone(_rule, value, callback) { const { t } = useI18n(); - var reg = /^1[3456789]\d{9}$/; + const reg = /^1[3456789]\d{9}$/; if (!reg.test(value)) { return Promise.reject(new Error('请输入正确手机号')); } else { @@ -177,14 +176,13 @@ export function isOAuth2AppEnv() { /** * 后台构造oauth2登录地址 * @param source - * @param tenantId */ export function sysOAuth2Login(source) { let url = `${window._CONFIG['domianURL']}/sys/thirdLogin/oauth2/${source}/login`; url += `?state=${encodeURIComponent(window.location.origin)}`; //update-begin---author:wangshuai ---date:20230224 for:[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------ - let tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID); - if(tenantId){ + const tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID); + if (tenantId) { url += `&tenantId=${tenantId}`; } //update-end---author:wangshuai ---date:20230224 for:[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------