12312
This commit is contained in:
@ -599,7 +599,7 @@ export const selectUserDeptPage = (data = {}) => {
|
|||||||
///unifiedLogin
|
///unifiedLogin
|
||||||
export const unifiedLogin = (data) => {
|
export const unifiedLogin = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: api + `/unifiedLogin`,
|
url: api + `/ssoLogin`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
|
@ -130,23 +130,26 @@ export const privateRoutes = [
|
|||||||
/**
|
/**
|
||||||
* 公开路由表
|
* 公开路由表
|
||||||
*/
|
*/
|
||||||
export const publicRoutes = [
|
export const publicRoutes = [{
|
||||||
{
|
path: "/oatuh_login",
|
||||||
|
component: () => import("@/views/login/oatuh_login") //统一登录
|
||||||
|
},
|
||||||
|
{
|
||||||
path: "/login",
|
path: "/login",
|
||||||
name: "login",
|
name: "login",
|
||||||
component: () => import("@/views/login/index")
|
component: () => import("@/views/login/index")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
name: "home",
|
name: "home",
|
||||||
component: () => import("@/views/home/index") //系统登录
|
component: () => import("@/views/home/index") //系统登录
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/KeyPopulations",
|
path: "/KeyPopulations",
|
||||||
name: "KeyPopulations",
|
name: "KeyPopulations",
|
||||||
component: () => import("@/views/KeyPopulations/index") //系统登录
|
component: () => import("@/views/KeyPopulations/index") //系统登录
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/editPassword", // 注意:带有路径“/”的记录中的组件“默认”是一个不返回 Promise 的函数
|
path: "/editPassword", // 注意:带有路径“/”的记录中的组件“默认”是一个不返回 Promise 的函数
|
||||||
component: layout,
|
component: layout,
|
||||||
redirect: "/IdentityManage",
|
redirect: "/IdentityManage",
|
||||||
@ -486,7 +489,7 @@ export const publicRoutes = [
|
|||||||
{
|
{
|
||||||
path: "/mpvPeo",
|
path: "/mpvPeo",
|
||||||
name: "mpvPeo",
|
name: "mpvPeo",
|
||||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeo/index"),
|
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeo/index"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "重点人管理",
|
title: "重点人管理",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
@ -495,7 +498,7 @@ export const publicRoutes = [
|
|||||||
{
|
{
|
||||||
path: "/mpvPeoSh",
|
path: "/mpvPeoSh",
|
||||||
name: "mpvPeoSh",
|
name: "mpvPeoSh",
|
||||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeoSh/index"),
|
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeoSh/index"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "重点人审批",
|
title: "重点人审批",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
@ -504,7 +507,7 @@ export const publicRoutes = [
|
|||||||
{
|
{
|
||||||
path: "/mpvGroup",
|
path: "/mpvGroup",
|
||||||
name: "mpvGroup",
|
name: "mpvGroup",
|
||||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroup/index"),
|
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroup/index"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "重点群体管理",
|
title: "重点群体管理",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
@ -513,7 +516,7 @@ export const publicRoutes = [
|
|||||||
{
|
{
|
||||||
path: "/mpvGroupSh",
|
path: "/mpvGroupSh",
|
||||||
name: "mpvGroupSh",
|
name: "mpvGroupSh",
|
||||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroupSh/index"),
|
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroupSh/index"),
|
||||||
meta: {
|
meta: {
|
||||||
title: "重点群体审核",
|
title: "重点群体审核",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
@ -545,7 +548,7 @@ export const publicRoutes = [
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
@ -221,7 +221,7 @@ export default {
|
|||||||
removeAllItem();
|
removeAllItem();
|
||||||
// 待补充 清理权限相关的配置
|
// 待补充 清理权限相关的配置
|
||||||
if (isOatuh) {
|
if (isOatuh) {
|
||||||
window.location.href = `http://80.149.27.78:8001/login`;
|
window.location.href = `http://155.240.22.102:40992`;
|
||||||
} else {
|
} else {
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
}
|
}
|
||||||
|
42
src/views/login/oatuh_login.vue
Normal file
42
src/views/login/oatuh_login.vue
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<template></template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted } from "vue";
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
import {
|
||||||
|
setItem
|
||||||
|
} from "@/utils/storage";
|
||||||
|
const loginDialog = ref(false);
|
||||||
|
const deptList = ref([]);
|
||||||
|
const store = useStore();
|
||||||
|
function redirectAuth() {
|
||||||
|
|
||||||
|
let token = location.hash.slice(20) || null;
|
||||||
|
if (token != null) {
|
||||||
|
token = token.replace(/\ +/g, "");
|
||||||
|
setItem("SSOTOKEN", token)
|
||||||
|
handleLogin({ token: token});
|
||||||
|
} else {
|
||||||
|
window.location.href = `http://155.240.22.102:40992`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleLogin = (e) => {
|
||||||
|
store.dispatch("user/oatuhLogin", e).then((res) => {
|
||||||
|
// 登录后操作
|
||||||
|
if (res.deptList.length === 1) {
|
||||||
|
window.location.hash = "/";
|
||||||
|
} else {
|
||||||
|
deptList.value = [...res.deptList];
|
||||||
|
loginDialog.value = true;
|
||||||
|
authorization.value = res.jwtToken;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
redirectAuth();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
Reference in New Issue
Block a user