style: 格式化 user 文件

pull/960/head
ykcory 2023-12-28 05:58:45 +08:00
parent 1cf9667705
commit cafa592ef5
1 changed files with 16 additions and 16 deletions

View File

@ -18,7 +18,7 @@ import { isArray } from '/@/utils/is';
import { useGlobSetting } from '/@/hooks/setting'; import { useGlobSetting } from '/@/hooks/setting';
import { JDragConfigEnum } from '/@/enums/jeecgEnum'; import { JDragConfigEnum } from '/@/enums/jeecgEnum';
import { useSso } from '/@/hooks/web/useSso'; import { useSso } from '/@/hooks/web/useSso';
import { isOAuth2AppEnv } from "/@/views/sys/login/useLogin"; import { isOAuth2AppEnv } from '/@/views/sys/login/useLogin';
interface UserState { interface UserState {
userInfo: Nullable<UserInfo>; userInfo: Nullable<UserInfo>;
token?: string; token?: string;
@ -183,13 +183,13 @@ export const useUserStore = defineStore({
//update-end-author:liusq date:2022-5-5 for: 登录成功后缓存拖拽模块的接口前缀 //update-end-author:liusq date:2022-5-5 for: 登录成功后缓存拖拽模块的接口前缀
// update-begin-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题 // update-begin-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题
let redirect = router.currentRoute.value?.query?.redirect as string; const redirect = router.currentRoute.value?.query?.redirect as string;
// 判断是否有 redirect 重定向地址 // 判断是否有 redirect 重定向地址
//update-begin---author:wangshuai ---date:20230424 for【QQYUN-5195】登录之后直接刷新页面导致没有进入创建组织页面------------ //update-begin---author:wangshuai ---date:20230424 for【QQYUN-5195】登录之后直接刷新页面导致没有进入创建组织页面------------
if (redirect && goHome) { if (redirect && goHome) {
//update-end---author:wangshuai ---date:20230424 for【QQYUN-5195】登录之后直接刷新页面导致没有进入创建组织页面------------ //update-end---author:wangshuai ---date:20230424 for【QQYUN-5195】登录之后直接刷新页面导致没有进入创建组织页面------------
// 当前页面打开 // 当前页面打开
window.open(redirect, '_self') window.open(redirect, '_self');
return data; return data;
} }
// update-end-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题 // update-end-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题
@ -284,21 +284,21 @@ export const useUserStore = defineStore({
} }
//update-begin---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------ //update-begin---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------
//退出登录的时候需要用的应用id //退出登录的时候需要用的应用id
if(isOAuth2AppEnv()){ if (isOAuth2AppEnv()) {
let tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID); const tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID);
removeAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID); removeAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID);
goLogin && await router.push({ name:"Login",query:{ tenantId:tenantId }}) goLogin && (await router.push({ name: 'Login', query: { tenantId: tenantId } }));
}else{ } else {
// update-begin-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题 // update-begin-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题
goLogin && (await router.push({ goLogin &&
path: PageEnum.BASE_LOGIN, (await router.push({
query: { path: PageEnum.BASE_LOGIN,
// 传入当前的路由,登录成功后跳转到当前路由 query: {
redirect: router.currentRoute.value.fullPath, // 传入当前的路由,登录成功后跳转到当前路由
} redirect: router.currentRoute.value.fullPath,
})); },
}));
// update-end-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题 // update-end-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题
} }
//update-end---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------ //update-end---author:wangshuai ---date:20230224 for[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------
}, },