|
@@ -15,7 +15,8 @@ import { OAUTH2_THIRD_LOGIN_TENANT_ID } from '/@/enums/cacheEnum';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
|
|
|
import _ from 'lodash';
|
|
|
-import { AUTO_LOGIN_URL_QUERY } from '../constant';
|
|
|
+import { AUTO_LOGIN_URL_QUERY, SKIP_SSO_URL_QUERY } from '../constant';
|
|
|
+import { useSso } from '/@/hooks/web/useSso';
|
|
|
|
|
|
const LOGIN_PATH = PageEnum.BASE_LOGIN;
|
|
|
//auth2登录路由
|
|
@@ -107,7 +108,12 @@ export function createPermissionGuard(router: Router) {
|
|
|
document.title = to.meta.title;
|
|
|
return;
|
|
|
}
|
|
|
- // query中要求自动登录的执行登录逻辑
|
|
|
+ // query如果没有明确要求跳过sso则执行sso登录
|
|
|
+ if (to.query[SKIP_SSO_URL_QUERY.key] !== SKIP_SSO_URL_QUERY.val) {
|
|
|
+ await useSso().ssoLogin();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // query中要求自动登录的执行自动登录
|
|
|
if (to.query[AUTO_LOGIN_URL_QUERY.key] === AUTO_LOGIN_URL_QUERY.val) {
|
|
|
const userStore = useUserStoreWithOut();
|
|
|
await userStore.autoLogin({
|