diff --git a/public/development_address_config.js b/public/development_address_config.js index 84dbe31..e706057 100644 --- a/public/development_address_config.js +++ b/public/development_address_config.js @@ -29,4 +29,7 @@ window._CONFIG["sendAddress"] = "天津市东丽区先锋东路68号" window._CONFIG["sendPostCode"] = "300300" // 查看物流信息-- 在企业端 -window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo"; \ No newline at end of file +window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo"; + +// 来款内部部署的ip +window._CONFIG["intranetUrl"] = "http://localhost:21825/"; \ No newline at end of file diff --git a/public/local_production_address_config.js b/public/local_production_address_config.js index 57eddf6..5ba28db 100644 --- a/public/local_production_address_config.js +++ b/public/local_production_address_config.js @@ -31,4 +31,7 @@ window._CONFIG["sendPostCode"] = "300300" // 查看物流信息 // window._CONFIG["lookExpressDomainURL"] = "http://bxxt.hzwlsoft.com/lookExpressInfo"; -window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo"; \ No newline at end of file +window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo"; + +// 来款内部部署的ip +window._CONFIG["intranetUrl"] = "http://10.10.10.46:8055/"; \ No newline at end of file diff --git a/public/production_address_config.js b/public/production_address_config.js index 8301bf6..3b6e726 100644 --- a/public/production_address_config.js +++ b/public/production_address_config.js @@ -26,4 +26,7 @@ window._CONFIG["sendAddress"] = "天津市东丽区先锋东路68号" window._CONFIG["sendPostCode"] = "300300" // 查看物流信息 -window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookExpressInfo" \ No newline at end of file +window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookExpressInfo" + +// 来款内部部署的ip +window._CONFIG["intranetUrl"] = "http://10.12.8.1/"; \ No newline at end of file diff --git a/src/api/api.js b/src/api/api.js index fb3868d..499317d 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -4,6 +4,8 @@ import {UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types' // idm 系统单点登录 获取用户信息 const loginIdmPlatform = (params) => postAction(`/sys/singleSignOn?code=${params.code}`) +// idm 系统单点登录 通过token获取userInfo +const getUserInfo = (params) => getAction(`/sys/user/getUserInfoByToken`, params) //角色管理 const addRole = (params)=>postAction('/sys/role/add',params) const editRole = (params)=>postAction('/sys/role/edit',params) @@ -195,6 +197,7 @@ export { getKeyIv, getContactsByCompanyNoLimit, loginIdmPlatform, + getUserInfo, companyAdminResetPassword, companyAdminEnable, queryCompanyInfoById diff --git a/src/permission.js b/src/permission.js index a8f1633..84f7501 100644 --- a/src/permission.js +++ b/src/permission.js @@ -7,7 +7,7 @@ import 'nprogress/nprogress.css' // progress bar style import { ACCESS_TOKEN, INDEX_MAIN_PAGE_PATH,USER_INFO } from '@/store/mutation-types' import { generateIndexRouter } from '@/utils/util' import { menuPermission } from './utils/hasPermission' -import {loginIdmPlatform} from '@api/api' +import {loginIdmPlatform, getUserInfo} from '@api/api' import {notification} from 'ant-design-vue' import { filterTreeData, isExternalTerminal } from './utils/util' @@ -21,17 +21,31 @@ router.beforeEach(async (to, from, next) => { if (to.query.token) { Vue.ls.set(ACCESS_TOKEN, to.query.token, 7 * 24 * 60 * 60 * 1000) store.commit('SET_TOKEN', to.query.token) + // 通过token获取登录的用户信息 + let userInfoFromUrlResult = await getUserInfo() + if(userInfoFromUrlResult.success) { + Vue.ls.set(USER_INFO, userInfoFromUrlResult.result , 7 * 24 * 60 * 60 * 1000) + store.commit('SET_INFO', userInfoFromUrlResult.result) + } // 判断是否是会员系统iframe嵌入的,如果是 不先做左侧菜单和 头部标签 if(to.query.system === 'member') { store.commit('SET_SYSTEM', to.query.system) } } // idm系统单点登录 - if(to.path === '/user/login' && to.query.code){ + if(to.path === '/user/login' && to.query.code){ let result = await loginIdmPlatform({code:to.query.code}) if(result.success){ - Vue.ls.set(USER_INFO, result.result.userInfo, 7 * 24 * 60 * 60 * 1000) - Vue.ls.set(ACCESS_TOKEN, result.result.token, 7 * 24 * 60 * 60 * 1000) + // TODO 判断当前用户是否是领导角色,如果是的话跳转到内网的网址的首页 并用token 登录 + let userInfo = result.result.userInfo + const token = result.result.token + // 领导角色需要跳转到内网, + if(userInfo.roleCode.includes('bmfzr') || userInfo.roleCode.includes('sld') || userInfo.roleCode.includes('admin')) { + window.open(`${window._CONFIG.intranetUrl}dashboard/analysis?token=${token}`, '_self') + } else { + Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000) + Vue.ls.set(ACCESS_TOKEN, token, 7 * 24 * 60 * 60 * 1000) + } }else { notification['error']({ message: '登录失败', diff --git a/src/views/packManagement/PackProjectMaintenance.vue b/src/views/packManagement/PackProjectMaintenance.vue index fe32e57..1aad75d 100644 --- a/src/views/packManagement/PackProjectMaintenance.vue +++ b/src/views/packManagement/PackProjectMaintenance.vue @@ -92,7 +92,8 @@ :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange" - class="j-table-force-nowrap"> + :class="dataSource.length === 0 ? 'show-scroll' : ''" + class="j-table-force-nowrap main-table"> + +