12312
This commit is contained in:
@ -599,7 +599,7 @@ export const selectUserDeptPage = (data = {}) => {
|
||||
///unifiedLogin
|
||||
export const unifiedLogin = (data) => {
|
||||
return request({
|
||||
url: api + `/unifiedLogin`,
|
||||
url: api + `/ssoLogin`,
|
||||
method: "POST",
|
||||
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",
|
||||
name: "login",
|
||||
component: () => import("@/views/login/index")
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
name: "home",
|
||||
component: () => import("@/views/home/index") //系统登录
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
path: "/KeyPopulations",
|
||||
name: "KeyPopulations",
|
||||
component: () => import("@/views/KeyPopulations/index") //系统登录
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
path: "/editPassword", // 注意:带有路径“/”的记录中的组件“默认”是一个不返回 Promise 的函数
|
||||
component: layout,
|
||||
redirect: "/IdentityManage",
|
||||
@ -486,7 +489,7 @@ export const publicRoutes = [
|
||||
{
|
||||
path: "/mpvPeo",
|
||||
name: "mpvPeo",
|
||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeo/index"),
|
||||
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeo/index"),
|
||||
meta: {
|
||||
title: "重点人管理",
|
||||
icon: "article"
|
||||
@ -495,7 +498,7 @@ export const publicRoutes = [
|
||||
{
|
||||
path: "/mpvPeoSh",
|
||||
name: "mpvPeoSh",
|
||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeoSh/index"),
|
||||
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvPeoSh/index"),
|
||||
meta: {
|
||||
title: "重点人审批",
|
||||
icon: "article"
|
||||
@ -504,7 +507,7 @@ export const publicRoutes = [
|
||||
{
|
||||
path: "/mpvGroup",
|
||||
name: "mpvGroup",
|
||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroup/index"),
|
||||
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroup/index"),
|
||||
meta: {
|
||||
title: "重点群体管理",
|
||||
icon: "article"
|
||||
@ -513,7 +516,7 @@ export const publicRoutes = [
|
||||
{
|
||||
path: "/mpvGroupSh",
|
||||
name: "mpvGroupSh",
|
||||
component: () =>import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroupSh/index"),
|
||||
component: () => import("@/views/backOfficeSystem/DeploymentDisposal/mpvGroupSh/index"),
|
||||
meta: {
|
||||
title: "重点群体审核",
|
||||
icon: "article"
|
||||
@ -545,7 +548,7 @@ export const publicRoutes = [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
|
@ -221,7 +221,7 @@ export default {
|
||||
removeAllItem();
|
||||
// 待补充 清理权限相关的配置
|
||||
if (isOatuh) {
|
||||
window.location.href = `http://80.149.27.78:8001/login`;
|
||||
window.location.href = `http://155.240.22.102:40992`;
|
||||
} else {
|
||||
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