feat: 添加sso redirect页面

This commit is contained in:
LokerL 2024-11-24 18:21:49 +08:00
parent 913e88c3ea
commit 94d56d71be
4 changed files with 30 additions and 7 deletions

View File

@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register', '/LoginSso']
const whiteList = ['/login', '/register', '/LoginSso', '/LoginRedirect']
router.beforeEach((to, from, next) => {
NProgress.start()

View File

@ -51,6 +51,11 @@ export const constantRoutes = [
component: () => import('@/views/login-sso'),
hidden: true
},
{
path: '/LoginRedirect',
component: () => import('@/views/login-redirect'),
hidden: true
},
{
path: '/register',
component: () => import('@/views/register'),

View File

@ -0,0 +1,24 @@
<template>
<div></div>
</template>
<script>
export default {
name: "LoginRedirect",
data() {
return {
authorizeUrl: "https://iam.sd-port.com:18010/idp/oauth2/authorize",
clientId: "hfxyjwzxjc",
redirectUri: "http://10.167.96.13/prod-api/redirectToAuth&response_type=code&state=123",
};
},
created() {
this.loginRedirect();
},
methods: {
loginRedirect() {
window.location = `${this.authorizeUrl}?client_id=${this.clientId}&redirect_uri=${this.redirectUri}`
},
}
};
</script>

View File

@ -7,11 +7,6 @@ export default {
name: "LoginSso",
data() {
return {
loginRules: {},
//
captchaOnOff: true,
//
register: false,
//
redirect: undefined
};
@ -24,7 +19,6 @@ export default {
loginSso() {
//code
const code = this.$route.query.code;
console.log("code="+code)
//
if(code==''||code==undefined||code==null){
//code