chore: 增加登出地址长度的限制

--bug=1031705 --user=刘瑞斌 [系统设置] github#27040MeterSphere对接OIDC后无法正常忽略MeterSphere登录页面 https://www.tapd.cn/55049933/s/1426284
This commit is contained in:
CaptainB 2023-10-16 10:33:56 +08:00 committed by 刘瑞斌
parent e477be9c1b
commit 147c7e4f8f
4 changed files with 16 additions and 14 deletions

View File

@ -23,11 +23,6 @@ if (window.location.pathname.startsWith('/' + packageJSON.name)) {
}
let urlParams = getUrlParams(window.location.href);
// OIDC 返回三方登录地址的话保存到本地,下次可以直接跳转
let oidcLoginUrl = urlParams['oidcLoginUrl']
if (oidcLoginUrl) {
localStorage.setItem('oidcLoginUrl', oidcLoginUrl);
}
const instance = axios.create({
baseURL, // url = base url + request url

View File

@ -370,14 +370,19 @@ export function checkMicroMode() {
}
export function getUrlParams(url) {
const arrSearch = url.split("?").pop().split("#").shift().split("&");
if (!url) url = window.location.href;
// 通过 ? 分割获取后面的参数字符串
let urlStr = url.split('?')[1]
// 创建空对象存储参数
let obj = {};
arrSearch.forEach((item) => {
const [k, v] = item.split("=");
obj[k] = v;
return obj;
});
return obj;
// 再通过 & 将每一个参数单独分割出来
let paramsArr = urlStr?.split('&')
for(let i = 0,len = paramsArr?.length;i < len;i++){
// 再通过 = 将每一个参数分割为 key:value 的形式
let arr = paramsArr[i].split('=')
obj[arr[0]] = arr[1];
}
return obj
}
/**

2
lombok.config Normal file
View File

@ -0,0 +1,2 @@
lombok.addLombokGeneratedAnnotation = true
lombok.equalsAndHashCode.callSuper=call

View File

@ -182,13 +182,13 @@
<el-form-item prop="configuration.loginUrl">
<template v-slot:label>
Login Endpoint
<el-tooltip content="Login URL: https://cloud2.metersphere.com, 输入后将自动转到第三方登录页面"
<el-tooltip content="Login URL: https://cloud.metersphere.com, 输入后将自动转到第三方登录页面"
effect="light"
trigger="hover">
<i class="el-icon-info"></i>
</el-tooltip>
</template>
<el-input v-model="form.configuration.loginUrl" show-word-limit maxlength="200"/>
<el-input v-model="form.configuration.loginUrl" show-word-limit maxlength="1000"/>
</el-form-item>
</el-col>
</el-row>