style: 格式化 useLogin 文件

pull/960/head
ykcory 2023-12-28 06:28:19 +08:00
parent 21294a2922
commit 0150ff5647
1 changed files with 6 additions and 8 deletions

View File

@ -3,9 +3,8 @@ import type { RuleObject } from 'ant-design-vue/lib/form/interface';
import { ref, computed, unref, Ref } from 'vue'; import { ref, computed, unref, Ref } from 'vue';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { checkOnlyUser } from '/@/api/sys/user'; import { checkOnlyUser } from '/@/api/sys/user';
import { defHttp } from '/@/utils/http/axios'; import { OAUTH2_THIRD_LOGIN_TENANT_ID } from '/@/enums/cacheEnum';
import { OAUTH2_THIRD_LOGIN_TENANT_ID } from "/@/enums/cacheEnum"; import { getAuthCache } from '/@/utils/auth';
import { getAuthCache } from "/@/utils/auth";
export enum LoginStateEnum { export enum LoginStateEnum {
LOGIN, 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(); const { t } = useI18n();
var reg = /^1[3456789]\d{9}$/; const reg = /^1[3456789]\d{9}$/;
if (!reg.test(value)) { if (!reg.test(value)) {
return Promise.reject(new Error('请输入正确手机号')); return Promise.reject(new Error('请输入正确手机号'));
} else { } else {
@ -177,14 +176,13 @@ export function isOAuth2AppEnv() {
/** /**
* oauth2 * oauth2
* @param source * @param source
* @param tenantId
*/ */
export function sysOAuth2Login(source) { export function sysOAuth2Login(source) {
let url = `${window._CONFIG['domianURL']}/sys/thirdLogin/oauth2/${source}/login`; let url = `${window._CONFIG['domianURL']}/sys/thirdLogin/oauth2/${source}/login`;
url += `?state=${encodeURIComponent(window.location.origin)}`; url += `?state=${encodeURIComponent(window.location.origin)}`;
//update-begin---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------ //update-begin---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------
let tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID); const tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID);
if(tenantId){ if (tenantId) {
url += `&tenantId=${tenantId}`; url += `&tenantId=${tenantId}`;
} }
//update-end---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------ //update-end---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------