提交 30e7dc89 编写于 作者: jlj05024111@163.com's avatar jlj05024111@163.com

feat: 更新无权限时重新登录的逻辑,更新环境参数映射文件

上级 7e8ed31b
...@@ -15,4 +15,5 @@ enableGridRowBreak:ENABLEGRIDROWBREAK ...@@ -15,4 +15,5 @@ enableGridRowBreak:ENABLEGRIDROWBREAK
publicKey:PUBLICKEY publicKey:PUBLICKEY
enableRSA:ENABLERSA enableRSA:ENABLERSA
customParams:CUSTOMPARAMS customParams:CUSTOMPARAMS
redirectWhiteList: REDIRECTWHITELIST redirectWhiteList: REDIRECTWHITELIST
\ No newline at end of file disabledLogin:DISABLEDLOGIN
\ No newline at end of file
...@@ -25,32 +25,8 @@ export class UnauthorizedHandler { ...@@ -25,32 +25,8 @@ export class UnauthorizedHandler {
if (!ibiz.env.casLoginUrl) { if (!ibiz.env.casLoginUrl) {
throw new RuntimeError('找不到环境参数casLoginUrl'); throw new RuntimeError('找不到环境参数casLoginUrl');
} }
const { origin } = window.location;
const baseUrl = `${origin}${ibiz.env.baseUrl}`;
// 登录后返回来的登录的地址
const backUrl = `${baseUrl}/cas/v7/login${qs.stringify(
{
RU: UrlHelper.fullPath,
base: baseUrl,
},
{ addQueryPrefix: true },
)}`;
// 要跳转的cas的登录页和参数
const hasQueryPrefix = ibiz.env.casLoginUrl.indexOf('?') !== -1;
const targetUrl =
ibiz.env.casLoginUrl +
(hasQueryPrefix ? '&' : '?') +
qs.stringify(
{
service: backUrl,
},
{ addQueryPrefix: false },
);
// 跳转cas登录地址 // 跳转cas登录地址
safeRedirect(targetUrl, { type: 'href' }); safeRedirect(ibiz.env.casLoginUrl, { type: 'href' });
} }
/** /**
...@@ -63,10 +39,6 @@ export class UnauthorizedHandler { ...@@ -63,10 +39,6 @@ export class UnauthorizedHandler {
* @returns {*} {Promise<void>} * @returns {*} {Promise<void>}
*/ */
protected static async normalLogin(): Promise<void> { protected static async normalLogin(): Promise<void> {
if (ibiz.env.noAuthRedirectUrl) {
safeRedirect(ibiz.env.noAuthRedirectUrl, { type: '_self' });
return;
}
// 禁止跳转登录视图时不处理 // 禁止跳转登录视图时不处理
if (!ibiz.env.disabledLogin) { if (!ibiz.env.disabledLogin) {
const ru = window.location.hash.replace('#', ''); const ru = window.location.hash.replace('#', '');
......
...@@ -36,9 +36,6 @@ const router = new Router({ ...@@ -36,9 +36,6 @@ const router = new Router({
path: '/login', path: '/login',
name: 'loginView', name: 'loginView',
beforeEnter: async (_to, _from, next) => { beforeEnter: async (_to, _from, next) => {
if (ibiz.env.noAuthRedirectUrl) {
safeRedirect(ibiz.env.noAuthRedirectUrl, { type: '_self' });
}
if (ibiz.env.disabledLogin) { if (ibiz.env.disabledLogin) {
next(false); next(false);
} else { } else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册