[update] 头部菜单增加企业端单点登录
This commit is contained in:
@@ -38,4 +38,7 @@ window._CONFIG["sendPostCode"] = "300300"
|
|||||||
window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo";
|
window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo";
|
||||||
|
|
||||||
// 来款内部部署的ip
|
// 来款内部部署的ip
|
||||||
window._CONFIG["intranetUrl"] = "http://localhost:21825/";
|
window._CONFIG["intranetUrl"] = "http://localhost:21825/";
|
||||||
|
|
||||||
|
// 企业端ip
|
||||||
|
window._CONFIG["enterpriseTerminal"] = "http://localhost:3001/";
|
||||||
@@ -40,4 +40,7 @@ window._CONFIG["sendPostCode"] = "300300"
|
|||||||
window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo";
|
window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo";
|
||||||
|
|
||||||
// 来款内部部署的ip
|
// 来款内部部署的ip
|
||||||
window._CONFIG["intranetUrl"] = "http://10.10.10.46:8055/";
|
window._CONFIG["intranetUrl"] = "http://10.10.10.46:8055/";
|
||||||
|
|
||||||
|
// 企业端ip
|
||||||
|
window._CONFIG["enterpriseTerminal"] = "http://10.10.10.46:8066/";
|
||||||
@@ -36,3 +36,6 @@ window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookExpressIn
|
|||||||
|
|
||||||
// 来款内部部署的ip
|
// 来款内部部署的ip
|
||||||
window._CONFIG["intranetUrl"] = "http://10.12.8.1/";
|
window._CONFIG["intranetUrl"] = "http://10.12.8.1/";
|
||||||
|
|
||||||
|
// 企业端ip
|
||||||
|
window._CONFIG["enterpriseTerminal"] = "http://cwp.catarc.org.cn/";
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import {UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
|
|||||||
const loginIdmPlatform = (params) => postAction(`/sys/singleSignOn?code=${params.code}`)
|
const loginIdmPlatform = (params) => postAction(`/sys/singleSignOn?code=${params.code}`)
|
||||||
// idm 系统单点登录 通过token获取userInfo
|
// idm 系统单点登录 通过token获取userInfo
|
||||||
const getUserInfo = (params) => getAction(`/sys/user/getUserInfoByToken`, params)
|
const getUserInfo = (params) => getAction(`/sys/user/getUserInfoByToken`, params)
|
||||||
|
// 单点登录企业端
|
||||||
|
const ssLoginEnterTerminal = (params) => postAction('/company/adminGetToken', params)
|
||||||
//角色管理
|
//角色管理
|
||||||
const addRole = (params)=>postAction('/sys/role/add',params)
|
const addRole = (params)=>postAction('/sys/role/add',params)
|
||||||
const editRole = (params)=>postAction('/sys/role/edit',params)
|
const editRole = (params)=>postAction('/sys/role/edit',params)
|
||||||
@@ -198,6 +200,7 @@ export {
|
|||||||
getContactsByCompanyNoLimit,
|
getContactsByCompanyNoLimit,
|
||||||
loginIdmPlatform,
|
loginIdmPlatform,
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
|
ssLoginEnterTerminal,
|
||||||
companyAdminResetPassword,
|
companyAdminResetPassword,
|
||||||
companyAdminEnable,
|
companyAdminEnable,
|
||||||
queryCompanyInfoById
|
queryCompanyInfoById
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="user-wrapper" :class="theme">
|
<div class="user-wrapper" :class="theme">
|
||||||
|
<!-- 1.增加企业端单点登录 -->
|
||||||
|
<a-button type="link" class="single-login-btn" @click="singleLoginEnterTerminal" v-has="'enterpriseTerminal:singleSignLogin'">企业端</a-button>
|
||||||
<header-notice class="action"/>
|
<header-notice class="action"/>
|
||||||
<a-dropdown>
|
<a-dropdown>
|
||||||
<span class="action action-full ant-dropdown-link user-dropdown-menu">
|
<span class="action action-full ant-dropdown-link user-dropdown-menu">
|
||||||
@@ -76,6 +78,8 @@ import { getFileAccessHttpUrl, getAction } from '@/api/manage'
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
|
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
|
||||||
import UserAuthorizationCode from './UserAuthorizationCode'
|
import UserAuthorizationCode from './UserAuthorizationCode'
|
||||||
|
import { ssLoginEnterTerminal } from '@/api/api'
|
||||||
|
import {notification} from "ant-design-vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'UserMenu',
|
name: 'UserMenu',
|
||||||
@@ -237,6 +241,24 @@ export default {
|
|||||||
let userEmail = this.userInfo().email
|
let userEmail = this.userInfo().email
|
||||||
let uId = this.userInfo().id
|
let uId = this.userInfo().id
|
||||||
this.$refs.userAuthorizationCode.show(username, userEmail, uId)
|
this.$refs.userAuthorizationCode.show(username, userEmail, uId)
|
||||||
|
},
|
||||||
|
// 单点登录企业端
|
||||||
|
async singleLoginEnterTerminal () {
|
||||||
|
let res = await ssLoginEnterTerminal()
|
||||||
|
if (res.success) {
|
||||||
|
// 单点登录成功,跳转到企业端首页,并用token登录
|
||||||
|
console.log(res)
|
||||||
|
const token = res.result.token
|
||||||
|
window.open(`${window._CONFIG.enterpriseTerminal}dashboard/analysis?token=${token}`, '_self')
|
||||||
|
} else {
|
||||||
|
notification['error']({
|
||||||
|
message: '登录失败',
|
||||||
|
description: res.message,
|
||||||
|
duration: 4,
|
||||||
|
})
|
||||||
|
// window.open(`${window._CONFIG.enterpriseTerminal}user/login`, '_self')
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,6 +289,17 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.single-login-btn {
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
.single-login-btn:hover {
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
.single-login-btn:focus {
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user