提交 971efcf2 编写于 作者: huangwensu's avatar huangwensu

添加系统切换

上级 45482095
...@@ -23,7 +23,7 @@ module.exports = { ...@@ -23,7 +23,7 @@ module.exports = {
NODE_ENV: '"development"', NODE_ENV: '"development"',
BUILD_ENV: '"' + process.env.BUILD_ENV + '"' BUILD_ENV: '"' + process.env.BUILD_ENV + '"'
}, },
port: 8010, port: 8888,
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: '/', assetsPublicPath: '/',
// proxyTable: { // proxyTable: {
......
<template> <template>
<div> <div>
<v-header :userName="userName" :portrait="portrait" :idType="idType"></v-header> <v-header :userName="userName" :authList="authList"></v-header>
<v-slidebar :authList="authList" :tokenValue="token"></v-slidebar> <v-slidebar :tokenValue="token"></v-slidebar>
<el-container> <el-container>
<div class="content" id="body-content"> <div class="content" id="body-content">
<transition name="router-fade" mode="out-in"> <transition name="router-fade" mode="out-in">
...@@ -24,7 +24,7 @@ import VSlidebar from './views/layout/slidebar.vue' ...@@ -24,7 +24,7 @@ import VSlidebar from './views/layout/slidebar.vue'
import VFooter from './views/layout/footer.vue' import VFooter from './views/layout/footer.vue'
import { base64decode, isNotEmptyUtils, getUrlParamsMap } from "./utils/utils.js" import { base64decode, isNotEmptyUtils, getUrlParamsMap } from "./utils/utils.js"
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
import { getLoginUrl } from './utils/index.js' import { getLoginUrl, getInnerLoginUrl } from './utils/index.js'
let vm = null let vm = null
export default { export default {
components:{ components:{
...@@ -37,8 +37,7 @@ export default { ...@@ -37,8 +37,7 @@ export default {
idType: 0, idType: 0,
token: '', token: '',
userName: '', userName: '',
portrait: '', authList: []
authList: {}
} }
}, },
computed:{ computed:{
...@@ -69,18 +68,18 @@ export default { ...@@ -69,18 +68,18 @@ export default {
//vm.$router.push({ path: 'home' }) //vm.$router.push({ path: 'home' })
} else { } else {
if(!localStorage.getItem('storageToken')) { if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl() // 没有token返回登录页面 window.location.href = getInnerLoginUrl() // 没有token返回登录页面
return return
} }
} }
}else { }else {
if(!localStorage.getItem('storageToken')) { if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl() // 没有token返回登录页面 window.location.href = getInnerLoginUrl() // 没有token返回登录页面
return return
} }
} }
vm.changeToken(vm.token) vm.changeToken(vm.token)
//vm.getUserAuth(vm.token) vm.getUserAuth()
}, },
// 修改token // 修改token
...mapActions([ ...mapActions([
...@@ -91,15 +90,12 @@ export default { ...@@ -91,15 +90,12 @@ export default {
getUserAuth(token) { getUserAuth(token) {
let req = null let req = null
req = { req = {
token: token system_type: '22'
} }
vm.GET('portal/common/v1/role',req).then((res) => { vm.POST('/contents/login/header',req).then((res) => {
if(res.code == '000000') { if(res.code == '000000') {
vm.changeIdType(res.data.idType) vm.userName = res.data.userName
vm.idType = res.data.idType vm.authList = res.data.systemInfoList
vm.userName = res.data.name
vm.portrait = res.data.imageUrl
vm.authList = res.data.auth
} }
}) })
} }
......
...@@ -14,7 +14,8 @@ export const envConfig = { ...@@ -14,7 +14,8 @@ export const envConfig = {
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html', loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'http://localhost:8090/PICA_SSO_FE/html/pica_index.html', //innerLoginUrl: 'http://localhost:8090/PICA_SSO_FE/html/pica_index.html',
innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html' yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html'
}, },
dev: { dev: {
......
...@@ -11,7 +11,7 @@ const service = axios.create({ ...@@ -11,7 +11,7 @@ const service = axios.create({
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
config.headers['sysCode'] = 12 config.headers['sysCode'] = 26
config.headers['token'] = localStorage.getItem('storageToken') config.headers['token'] = localStorage.getItem('storageToken')
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' }) config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
// if (config.data && config.data.setEntry) { // if (config.data && config.data.setEntry) {
......
...@@ -7,12 +7,24 @@ ...@@ -7,12 +7,24 @@
<div class="user-info"> <div class="user-info">
<el-dropdown trigger="click" @command="handleCommand"> <el-dropdown trigger="click" @command="handleCommand">
<div class="el-dropdown-link"> <div class="el-dropdown-link">
<img class="user-logo" :src="portrait"> <img class="user-logo" src="../../assets/image/mm.jpg">
<span id="headName">{{userName}}</span><i class="el-icon-caret-bottom"></i> <span id="headName">{{userName}}</span><i class="el-icon-caret-bottom"></i>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="logout">注销</el-dropdown-item> <el-dropdown-item command="logout">退出</el-dropdown-item>
<el-dropdown-item command="forward">返回云鹊医首页</el-dropdown-item> </el-dropdown-menu>
</el-dropdown>
</div>
<!--导航-->
<div class="user-info">
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
{{'系统切换'}}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="item in authList" :key="item.id">
<span class="menu-item" @click="forward(item)">{{item.systemName}}</span>
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
...@@ -24,26 +36,24 @@ import { mapGetters } from 'vuex' ...@@ -24,26 +36,24 @@ import { mapGetters } from 'vuex'
let vm = null let vm = null
export default { export default {
props: { props: {
portrait: {
type: String
},
userName: { userName: {
type: String type: String
}, },
idType: { authList: {
type: Number type: Array
} }
}, },
data() { data() {
return { return {
name: '', name: ''
systemInfoList: []
} }
}, },
computed: { computed: {
...mapGetters([ },
'_token' watch: {
]) authList(newVal, oldVal){
}
}, },
created() { created() {
vm = this vm = this
...@@ -52,14 +62,10 @@ export default { ...@@ -52,14 +62,10 @@ export default {
handleCommand(command) { handleCommand(command) {
if (command === 'logout') { if (command === 'logout') {
localStorage.removeItem('storageToken') localStorage.removeItem('storageToken')
if(vm.idType == 1) { // 内部 window.location.href = getInnerLoginUrl()
window.location.href = getInnerLoginUrl()
} else {
window.location.href = getLoginUrl()
}
} }
if(command === 'forward') { if(command === 'forward') {
window.location.href = getYunQueYiUrl()
} }
} }
} }
...@@ -111,10 +117,10 @@ export default { ...@@ -111,10 +117,10 @@ export default {
} }
.user-logo { .user-logo {
position: absolute; position: absolute;
left: 16px; left: 10px;
top: 20px; top: 20px;
width: 24px; width: 30px;
height: 24px; height: 30px;
border-radius: 50%; border-radius: 50%;
} }
.el-icon--right, #headName,.line, #login-out{ .el-icon--right, #headName,.line, #login-out{
...@@ -130,7 +136,9 @@ export default { ...@@ -130,7 +136,9 @@ export default {
.el-dropdown-menu__item { .el-dropdown-menu__item {
text-align: center; text-align: center;
} }
.el-dropdown-menu {
top: 37px !important;
}
.menu-item { .menu-item {
font-size: 14px; font-size: 14px;
font-weight: 300; font-weight: 300;
......
...@@ -29,10 +29,6 @@ export default { ...@@ -29,10 +29,6 @@ export default {
props: { props: {
tokenValue: { tokenValue: {
type: String type: String
},
authList: {
type: Object,
default: () => {}
} }
}, },
data() { data() {
...@@ -63,19 +59,6 @@ export default { ...@@ -63,19 +59,6 @@ export default {
created() { created() {
vm = this vm = this
}, },
watch: {
authList(newVal, oldVal){
if(!newVal.P001) { // 项目管理
vm.items[1].subs[1].index = 'blank'
}
if(!newVal.P002) { // 组件管理
vm.items[1].subs[0].index = 'blank'
}
if(!newVal.P003) { // 角色管理
vm.items[2].subs[0].index = 'blank'
}
}
},
methods: { methods: {
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册