style: 格式化 useLogin 文件
parent
21294a2922
commit
0150ff5647
|
@ -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,13 +176,12 @@ 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);
|
||||
const tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID);
|
||||
if (tenantId) {
|
||||
url += `&tenantId=${tenantId}`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue