✨ feat: 添加sso redirect页面
This commit is contained in:
parent
913e88c3ea
commit
94d56d71be
|
@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request'
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
|
|
||||||
const whiteList = ['/login', '/register', '/LoginSso']
|
const whiteList = ['/login', '/register', '/LoginSso', '/LoginRedirect']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
|
|
|
@ -51,6 +51,11 @@ export const constantRoutes = [
|
||||||
component: () => import('@/views/login-sso'),
|
component: () => import('@/views/login-sso'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/LoginRedirect',
|
||||||
|
component: () => import('@/views/login-redirect'),
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/register',
|
path: '/register',
|
||||||
component: () => import('@/views/register'),
|
component: () => import('@/views/register'),
|
||||||
|
|
|
@ -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>
|
|
@ -7,11 +7,6 @@ export default {
|
||||||
name: "LoginSso",
|
name: "LoginSso",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loginRules: {},
|
|
||||||
//验证码开关
|
|
||||||
captchaOnOff: true,
|
|
||||||
//注册开关
|
|
||||||
register: false,
|
|
||||||
//重定向
|
//重定向
|
||||||
redirect: undefined
|
redirect: undefined
|
||||||
};
|
};
|
||||||
|
@ -24,7 +19,6 @@ export default {
|
||||||
loginSso() {
|
loginSso() {
|
||||||
//获取地址栏中的code
|
//获取地址栏中的code
|
||||||
const code = this.$route.query.code;
|
const code = this.$route.query.code;
|
||||||
console.log("code="+code)
|
|
||||||
//调用登录的接口
|
//调用登录的接口
|
||||||
if(code==''||code==undefined||code==null){
|
if(code==''||code==undefined||code==null){
|
||||||
//请求中不带code,拦截为正常登录
|
//请求中不带code,拦截为正常登录
|
||||||
|
|
Loading…
Reference in New Issue