refactor: OIDC登录时记录登录地址到浏览器本地存储

This commit is contained in:
CaptainB 2023-04-24 17:51:47 +08:00
parent d8c8ad8394
commit 85521a60c9
2 changed files with 6 additions and 8 deletions

View File

@ -24,7 +24,7 @@
<script> <script>
import MsDialogFooter from "../MsDialogFooter"; import MsDialogFooter from "../MsDialogFooter";
import {getUrlParams, removeGoBackListener} from "../../utils"; import {removeGoBackListener} from "../../utils";
import MsTableOperatorButton from "../MsTableOperatorButton"; import MsTableOperatorButton from "../MsTableOperatorButton";
import {EMAIL_REGEX, PHONE_REGEX} from "../../utils/regex"; import {EMAIL_REGEX, PHONE_REGEX} from "../../utils/regex";
import {useUserStore} from "@/store"; import {useUserStore} from "@/store";
@ -79,13 +79,6 @@ export default {
}, },
}; };
}, },
created() {
let urlParams = getUrlParams(window.location.href);
let oidcLoginUrl = urlParams['oidcLoginUrl']
if (oidcLoginUrl) {
localStorage.setItem('oidcLoginUrl', oidcLoginUrl);
}
},
methods: { methods: {
cancel() { cancel() {
this.$emit("cancel"); this.$emit("cancel");

View File

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