Merge branch 'develop_idm' into 'develop'
Develop idm See merge request LAWS/laws-system-front-FOTON!174
This commit is contained in:
@@ -431,6 +431,22 @@ export function get_verify_by_instance (data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getMenu (data) {
|
||||||
|
return axios({
|
||||||
|
url: '/api/sarUser/user/menu',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function loginIdm (data) {
|
||||||
|
return axios({
|
||||||
|
url: '/api/loginIdm',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 流程委托接口
|
// 流程委托接口
|
||||||
export function changeAssigneeNew (data) {
|
export function changeAssigneeNew (data) {
|
||||||
return axios({
|
return axios({
|
||||||
|
|||||||
+46
-25
@@ -7,7 +7,11 @@ import axios from 'axios'
|
|||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import {Message} from 'element-ui'
|
import {Message} from 'element-ui'
|
||||||
import { baseUrl } from '@/sysConfig'
|
import { baseUrl,webLoginType,ssoLoginUrlDev } from '@/sysConfig'
|
||||||
|
import domMessage from '../messageOnce/messageOnce'
|
||||||
|
|
||||||
|
const messageOnce = new domMessage()
|
||||||
|
|
||||||
export const CancelToken = axios.CancelToken
|
export const CancelToken = axios.CancelToken
|
||||||
// import 'element-ui/lib/theme-chalk/index.css'
|
// import 'element-ui/lib/theme-chalk/index.css'
|
||||||
const _axios = axios.create({
|
const _axios = axios.create({
|
||||||
@@ -34,37 +38,54 @@ window._axiosPromiseArr = []
|
|||||||
* liuyan
|
* liuyan
|
||||||
*/
|
*/
|
||||||
_axios.interceptors.request.use(
|
_axios.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
// 记录接口请求
|
// 记录接口请求
|
||||||
// config.cancelToken = new axios.CancelToken(cancel => {
|
let token = store.state.token;
|
||||||
// // window._axiosPromiseArr.push({ cancel })
|
if (!config.headers.hasOwnProperty('token') && token != null && token) {
|
||||||
// })
|
config.headers.token = token;
|
||||||
return config
|
}
|
||||||
},
|
// config.cancelToken = new axios.CancelToken(cancel => {
|
||||||
error => {
|
// // window._axiosPromiseArr.push({ cancel })
|
||||||
return Promise.reject(error.response)
|
// })
|
||||||
})
|
return config
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
return Promise.reject(error.response)
|
||||||
|
})
|
||||||
/**
|
/**
|
||||||
* @description: axios响应拦截器
|
* @description: axios响应拦截器
|
||||||
* liuyan
|
* liuyan
|
||||||
*/
|
*/
|
||||||
_axios.interceptors.response.use(
|
_axios.interceptors.response.use(
|
||||||
res => {
|
res => {
|
||||||
return res
|
if(res.data && res.data.respCode && res.data.respCode === 'LE505'){
|
||||||
},
|
window.sessionStorage.clear()
|
||||||
error => {
|
messageOnce.warning({
|
||||||
// 登录超时
|
message: '登录超时,请重新登录',
|
||||||
if (error.response.data.path === '/a/login' && store.state.isTimeOut === false) {
|
type: 'warning'
|
||||||
for (let key in store.state) {
|
})
|
||||||
if (key !== 'isTimeOut' && key !== 'laws_urm' && key !== 'laws_prm') {
|
if(webLoginType != null && webLoginType === 'idm' ) {
|
||||||
store.state[key] = ''
|
// idm 统一认证登录页面
|
||||||
|
return window.location.href = ssoLoginUrlDev
|
||||||
|
}else if(webLoginType != null && webLoginType === 'dev'){
|
||||||
|
return router.push('/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message.warning('登录超时,请重新登录')
|
return res
|
||||||
router.push('/login')
|
},
|
||||||
store.state.isTimeOut = true
|
error => {
|
||||||
}
|
// 登录超时
|
||||||
})
|
if (error.response.data.path === '/a/login' && store.state.isTimeOut === false) {
|
||||||
|
for (let key in store.state) {
|
||||||
|
if (key !== 'isTimeOut' && key !== 'laws_urm' && key !== 'laws_prm') {
|
||||||
|
store.state[key] = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Message.warning('登录超时,请重新登录')
|
||||||
|
router.push('/login')
|
||||||
|
store.state.isTimeOut = true
|
||||||
|
}
|
||||||
|
})
|
||||||
function api () {
|
function api () {
|
||||||
return store.getters.getTypeFlag === 'CloudRepository' ? '/busApi/' : '/api/'
|
return store.getters.getTypeFlag === 'CloudRepository' ? '/busApi/' : '/api/'
|
||||||
}
|
}
|
||||||
|
|||||||
+46
-25
@@ -2,9 +2,13 @@ import axios from 'axios'
|
|||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import {Message} from 'element-ui'
|
import {Message} from 'element-ui'
|
||||||
import { baseUrl } from '@/sysConfig'
|
import { baseUrl,webLoginType,ssoLoginUrlDev } from '@/sysConfig'
|
||||||
|
import domMessage from '../messageOnce/messageOnce'
|
||||||
|
|
||||||
// import 'element-ui/lib/theme-chalk/index.css'
|
// import 'element-ui/lib/theme-chalk/index.css'
|
||||||
|
|
||||||
|
const messageOnce = new domMessage()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: FormData
|
* @description: FormData
|
||||||
* @author: xx
|
* @author: xx
|
||||||
@@ -29,35 +33,52 @@ service.defaults.headers['Content-type'] = 'application/json'
|
|||||||
* liuyan
|
* liuyan
|
||||||
*/
|
*/
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
if (config.params) {
|
if (config.params) {
|
||||||
// 解决IE请求不刷新
|
// 解决IE请求不刷新
|
||||||
config.params._t = new Date().getTime()
|
config.params._t = new Date().getTime()
|
||||||
}
|
}
|
||||||
return config
|
let token = store.state.token;
|
||||||
},
|
if (!config.headers.hasOwnProperty('token') && token != null && token) {
|
||||||
error => {
|
config.headers.token = token;
|
||||||
return Promise.reject(error.response)
|
}
|
||||||
})
|
return config
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
return Promise.reject(error.response)
|
||||||
|
})
|
||||||
/**
|
/**
|
||||||
* @description: axios响应拦截器
|
* @description: axios响应拦截器
|
||||||
* liuyan
|
* liuyan
|
||||||
*/
|
*/
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
res => {
|
res => {
|
||||||
return res.data
|
if(res.data && res.data.respCode != undefined && res.data.respCode === 'LE505'){
|
||||||
},
|
window.sessionStorage.clear()
|
||||||
error => {
|
messageOnce.warning({
|
||||||
// 登录超时
|
message: '登录超时,请重新登录',
|
||||||
if (error.response.data.path === '/a/login' && store.state.isTimeOut === false) {
|
type: 'warning'
|
||||||
for (let key in store.state) {
|
})
|
||||||
if (key !== 'isTimeOut' && key !== 'laws_urm' && key !== 'laws_prm') {
|
if(webLoginType != null && webLoginType === 'idm' ) {
|
||||||
store.state[key] = ''
|
// idm 统一认证登录页面
|
||||||
|
return window.location.href = ssoLoginUrlDev
|
||||||
|
}else if(webLoginType != null && webLoginType === 'dev'){
|
||||||
|
return router.push('/login')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return res.data
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
// 登录超时
|
||||||
|
if (error.response.data.path === '/a/login' && store.state.isTimeOut === false) {
|
||||||
|
for (let key in store.state) {
|
||||||
|
if (key !== 'isTimeOut' && key !== 'laws_urm' && key !== 'laws_prm') {
|
||||||
|
store.state[key] = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Message.warning('登录超时,请重新登录')
|
||||||
|
router.push('/login')
|
||||||
|
store.state.isTimeOut = true
|
||||||
}
|
}
|
||||||
Message.warning('登录超时,请重新登录')
|
})
|
||||||
router.push('/login')
|
|
||||||
store.state.isTimeOut = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
export default service
|
export default service
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import {Message} from 'element-ui'
|
||||||
|
// 私有属性,只在当前文件可用
|
||||||
|
const showMessage = Symbol('showMessage')
|
||||||
|
export default class domMessage {
|
||||||
|
success (options, single = true) {
|
||||||
|
this[showMessage]('success', options, single)
|
||||||
|
}
|
||||||
|
warning(options, single = true) {
|
||||||
|
this[showMessage]('warning', options, single)
|
||||||
|
}
|
||||||
|
info(options, single = true) {
|
||||||
|
this[showMessage]('info', options, single)
|
||||||
|
}
|
||||||
|
error(options, single = true) {
|
||||||
|
this[showMessage]('error', options, single)
|
||||||
|
}
|
||||||
|
[showMessage] (type, options, single) {
|
||||||
|
if (single) {
|
||||||
|
// 关键代码,判断当前页是否有el-message标签,如果没有则执行弹窗操作
|
||||||
|
if (document.getElementsByClassName('el-message').length === 0) {
|
||||||
|
Message[type](options)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Message[type](options)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+185
-82
@@ -46,86 +46,189 @@ import router from './router'
|
|||||||
// 路由解析器
|
// 路由解析器
|
||||||
import Re from 'path-to-regexp'
|
import Re from 'path-to-regexp'
|
||||||
|
|
||||||
import { get_verify_by_instance } from 'api/process'
|
import { get_verify_by_instance,loginIdm,getMenu } from 'api/process'
|
||||||
|
|
||||||
|
import { ssoLoginUrlDev,ssoLoginUrl,webLoginType,devWebUrl } from '@/sysConfig'
|
||||||
|
|
||||||
|
import { mapMutations, mapActions } from 'vuex'
|
||||||
|
|
||||||
// 路由拦截
|
// 路由拦截
|
||||||
router.beforeEach(function (to, from, next) {
|
router.beforeEach(function (to, from, next) {
|
||||||
let path = to.path;
|
console.log("auth : to =>", to);
|
||||||
console.log("auth : to =>", to);
|
console.log(webLoginType)
|
||||||
console.log("auth : path =>" + path);
|
let toName = to.name
|
||||||
let taskId = to.query.taskIds;
|
let token = store.state.token
|
||||||
let prcId = to.query.prcId;
|
let path = to.path;
|
||||||
let prcNum = to.query.prcNum;
|
let requireAuth = to.meta.requireAuth;
|
||||||
let prcName = to.query.prcName;
|
console.log("auth : path =>" + path);
|
||||||
let prcType = to.query.prcType;
|
console.log("token : token =>" + token);
|
||||||
let param = "?taskIds="+taskId+"&prcId="+prcId
|
console.log("requireAuth : requireAuth =>" + requireAuth);
|
||||||
+"&prcNum="+prcNum+"&prcName="+prcName+"&prcType="+prcType;
|
let taskId = to.query.taskIds;
|
||||||
if(taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null){
|
let prcId = to.query.prcId;
|
||||||
get_verify_by_instance({
|
let prcNum = to.query.prcNum;
|
||||||
taskId: taskId, // 任务id
|
let prcName = to.query.prcName;
|
||||||
pId: prcId // 流程实例
|
let prcType = to.query.prcType;
|
||||||
}).then(res => {
|
let param = "taskIds=" + taskId + "&prcId=" + prcId
|
||||||
let hisCount = res.hisCount === undefined ? 0 : res.hisCount;
|
+ "&prcNum=" + prcNum + "&prcName=" + prcName + "&prcType=" + prcType;
|
||||||
let commitStatus = res.commitStatus === undefined ? 0 : res.commitStatus;
|
console.log(store)
|
||||||
let isNotFinished = res.isNotFinished === undefined ? 0 :res.isNotFinished;
|
let url = window.location.search
|
||||||
|
let code = "";
|
||||||
if(hisCount && hisCount > 0){ // 业务系统 当前节点已完成
|
if(url){
|
||||||
// 根据type判断跳转具体流程页面
|
url = url.substr(1);
|
||||||
if (prcType === '1') {
|
url = url.split('&');
|
||||||
// 标准入库流程数据
|
let info = [];
|
||||||
next({path:"bzrkStep5"+param})
|
let obj = {};
|
||||||
}else if(prcType === '4'){
|
for (let i = 0,len = url.length; i < len; i++) {
|
||||||
//标准清单发布流程数据
|
info = url[i].split('=')
|
||||||
next({path:"bzqdfbStep1-4"+param})
|
obj[info[0]] = decodeURI(info[1]);
|
||||||
}else if (prcType === '5'){
|
url[i] = obj;
|
||||||
//标准项目合规评估 标准维度
|
|
||||||
if(path === "/xmpgStep2" || path === "/xmpgStep1" || path === "/xmpgStep1-2"){
|
|
||||||
next({path:"xmpgStep1-2"+param})
|
|
||||||
}else {
|
|
||||||
next({path:"xmpgStep1-7"+param})
|
|
||||||
}
|
|
||||||
}else if(prcType === '6'){
|
|
||||||
//标准项目合规评估 项目维度
|
|
||||||
if(path === "/xmpg2Step1" || path === "/xmpg2Step2" || path === "/xmpg2Step1-2"){
|
|
||||||
next({path:"xmpg2Step1-2"+param})
|
|
||||||
}else {
|
|
||||||
next({path:"xmpg2Step1-12"+param})
|
|
||||||
}
|
|
||||||
} else if (prcType === '8') {
|
|
||||||
// 未符合项整改
|
|
||||||
next({path:"wfhxzgStep5-1"+param})
|
|
||||||
} else if(prcType === '9'){
|
|
||||||
next({path:"bzjdStep1-6"+param})
|
|
||||||
//标准调研流程
|
|
||||||
}else if(prcType === '2'){
|
|
||||||
next({path:"bzdyStep1-9"+param})
|
|
||||||
}else if(prcType === '3'){
|
|
||||||
//标准征求意见
|
|
||||||
next({path:"bzzqyjStep1-9"+param})
|
|
||||||
}else if(prcType === '10'){
|
|
||||||
//项目清单确认
|
|
||||||
next({path:"xmqdqrStep1-3"+param})
|
|
||||||
}
|
}
|
||||||
}else { // 业务系统 当前节点未完成
|
code = url[0].code
|
||||||
// commitStatus 大于0 表示当前节点存在未完成干活流程
|
}
|
||||||
if(isNotFinished && isNotFinished > 0 && commitStatus && commitStatus > 0){
|
|
||||||
if(prcType === '3'){
|
function extractedLocalStorage(url,param) {
|
||||||
//标准征求意见 接受节点 未完成 oa已办 跳转详情页面
|
localStorage.removeItem("routerUrl")
|
||||||
if(path === '/bzzqyjStep3'){
|
localStorage.setItem('routerUrl', url)
|
||||||
next({path:"processAcceptDetail?prcNum="+prcNum+"&tabsName=AlreadyProcess"})
|
localStorage.removeItem("routerParam")
|
||||||
}
|
localStorage.setItem('routerParam', param)
|
||||||
}
|
}
|
||||||
}else{
|
// 返回值为登录状态
|
||||||
next()
|
if ((token === null || token === '' ) && toName !== 'Login') {
|
||||||
}
|
if(webLoginType != null && webLoginType === 'idm' ){
|
||||||
}
|
if(code){
|
||||||
console.log("res : res =>", res);
|
next()
|
||||||
})
|
}else {
|
||||||
}
|
if (taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null) {
|
||||||
next()
|
extractedVerify(token)
|
||||||
|
}else {
|
||||||
|
extractedLocalStorage('home2','');
|
||||||
|
// ssoLoginUrlDev 默认sso 地址
|
||||||
|
window.location.href = ssoLoginUrlDev
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(webLoginType != null && webLoginType === 'dev'){
|
||||||
|
next('/Login')
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
extractedVerify(token)
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractedVerify() {
|
||||||
|
if (taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null) {
|
||||||
|
get_verify_by_instance({
|
||||||
|
taskId: taskId, // 任务id
|
||||||
|
pId: prcId // 流程实例
|
||||||
|
}).then(res => {
|
||||||
|
let hisCount = res.hisCount === undefined ? 0 : res.hisCount;
|
||||||
|
let commitStatus = res.commitStatus === undefined ? 0 : res.commitStatus;
|
||||||
|
let isNotFinished = res.isNotFinished === undefined ? 0 : res.isNotFinished;
|
||||||
|
|
||||||
|
if (hisCount && hisCount > 0) { // 业务系统 当前节点已完成
|
||||||
|
// 根据type判断跳转具体流程页面
|
||||||
|
if (prcType === '1') {
|
||||||
|
// 标准入库流程数据
|
||||||
|
extracted("bzrkStep5");
|
||||||
|
} else if (prcType === '4') {
|
||||||
|
//标准清单发布流程数据
|
||||||
|
extracted("bzqdfbStep1-4");
|
||||||
|
} else if (prcType === '5') {
|
||||||
|
//标准项目合规评估 标准维度
|
||||||
|
if (path === "/xmpgStep2" || path === "/xmpgStep1" || path === "/xmpgStep1-2") {
|
||||||
|
extracted("xmpgStep1-2");
|
||||||
|
} else {
|
||||||
|
extracted("xmpgStep1-7");
|
||||||
|
}
|
||||||
|
} else if (prcType === '6') {
|
||||||
|
//标准项目合规评估 项目维度
|
||||||
|
if (path === "/xmpg2Step1" || path === "/xmpg2Step2" || path === "/xmpg2Step1-2") {
|
||||||
|
extracted("xmpg2Step1-2");
|
||||||
|
} else {
|
||||||
|
extracted("xmpg2Step1-12");
|
||||||
|
}
|
||||||
|
} else if (prcType === '8') {
|
||||||
|
// 未符合项整改
|
||||||
|
extracted("wfhxzgStep5-1");
|
||||||
|
} else if (prcType === '9') {
|
||||||
|
extracted("bzjdStep1-6");
|
||||||
|
//标准调研流程
|
||||||
|
} else if (prcType === '2') {
|
||||||
|
extracted("bzdyStep1-9");
|
||||||
|
} else if (prcType === '3') {
|
||||||
|
//标准征求意见
|
||||||
|
extracted("bzzqyjStep1-9");
|
||||||
|
} else if (prcType === '10') {
|
||||||
|
//项目清单确认
|
||||||
|
extracted("xmqdqrStep1-3");
|
||||||
|
}
|
||||||
|
} else { // 业务系统 当前节点未完成
|
||||||
|
// commitStatus 大于0 表示当前节点存在未完成干活流程
|
||||||
|
if (isNotFinished && isNotFinished > 0 && commitStatus && commitStatus > 0) {
|
||||||
|
if (prcType === '3') {
|
||||||
|
//标准征求意见 接受节点 未完成 oa已办 跳转详情页面
|
||||||
|
if (path === '/bzzqyjStep3') {
|
||||||
|
extracted2("processAcceptDetail","prcNum=" + prcNum + "&tabsName=AlreadyProcess");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// oa 待测 sso
|
||||||
|
extracted3()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function extracted(routerPath) {
|
||||||
|
if (token === null || token === '') {
|
||||||
|
extractedLocalStorage(routerPath,param);
|
||||||
|
// ssoLoginUrlDev 默认sso 地址
|
||||||
|
window.location.href = ssoLoginUrlDev
|
||||||
|
} else {
|
||||||
|
next({path: routerPath + '?' +param})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function extracted3() {
|
||||||
|
if (token === null || token === '') {
|
||||||
|
extractedLocalStorage(toName,param);
|
||||||
|
// ssoLoginUrlDev 默认sso 地址
|
||||||
|
window.location.href = ssoLoginUrlDev
|
||||||
|
} else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function extracted2(routerPath,param2) {
|
||||||
|
if (token === null || token === '') {
|
||||||
|
extractedLocalStorage(routerPath,param2);
|
||||||
|
// ssoLoginUrlDev 默认sso 地址
|
||||||
|
window.location.href = ssoLoginUrlDev
|
||||||
|
} else {
|
||||||
|
next({path: routerPath + '?' + param2})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("res : res =>", res);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(path === '/loginVerify'){
|
||||||
|
if(webLoginType != null && webLoginType === 'dev'){
|
||||||
|
next('/Login')
|
||||||
|
}else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 设置用户信息
|
||||||
|
function setUserInfo (userInfo) {
|
||||||
|
const timeStamp = new Date().getTime().toString()
|
||||||
|
const _USERINFO = JSON.parse(userInfo)
|
||||||
|
_USERINFO.userId = _USERINFO.userId || _USERINFO.usId
|
||||||
|
_USERINFO.userName = _USERINFO.userName || _USERINFO.uName
|
||||||
|
try {
|
||||||
|
localStorage.setItem('userInfo', JSON.stringify(_USERINFO))
|
||||||
|
localStorage.setItem('userInfoModifyTime', timeStamp)
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
// jquery
|
// jquery
|
||||||
@@ -147,16 +250,16 @@ Vue.prototype.simpleUploadPath = simpleUploadPath
|
|||||||
Vue.prototype.$moment = moment
|
Vue.prototype.$moment = moment
|
||||||
// 国际化
|
// 国际化
|
||||||
const i18n = new VueI18n({
|
const i18n = new VueI18n({
|
||||||
locale: store.getters.getLanguage || 'cn', // 定义默认语言为中文
|
locale: store.getters.getLanguage || 'cn', // 定义默认语言为中文
|
||||||
messages: {
|
messages: {
|
||||||
cn: require('@/assets/languages/cn'),
|
cn: require('@/assets/languages/cn'),
|
||||||
en: require('@/assets/languages/en')
|
en: require('@/assets/languages/en')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
/* eslint-disable no-new */
|
/* eslint-disable no-new */
|
||||||
window.vm = new Vue({
|
window.vm = new Vue({
|
||||||
router,
|
router,
|
||||||
store,
|
store,
|
||||||
i18n,
|
i18n,
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
|
|||||||
+1
-144
@@ -81,150 +81,7 @@
|
|||||||
prefix: '/foton'
|
prefix: '/foton'
|
||||||
}, res => {
|
}, res => {
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const JSESSIONID = document.cookie
|
this.loginNew(res)
|
||||||
this.setJESSCookie(JSESSIONID)
|
|
||||||
if (res.data.orgId === null || res.data.orgId === '') {
|
|
||||||
this.$message.warning('未分配组织机构,请联系管理员分配后重新登录')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// debugger
|
|
||||||
let Base64 = require('js-base64').Base64
|
|
||||||
let userInfoStr = Base64.decode(res.data)
|
|
||||||
let userInfo2 = decodeURIComponent(userInfoStr)
|
|
||||||
let userInfoObj = JSON.parse(userInfo2)
|
|
||||||
userInfoObj.userId = userInfoObj.usid
|
|
||||||
this.setToken(userInfoObj.usid) // vuex存储token
|
|
||||||
this.getByUserInfoCode(userInfoObj.usid).then((userInfo) => {
|
|
||||||
if (userInfo !== '' && userInfo !== null) {
|
|
||||||
userInfo.workNum = userInfoObj.workNum
|
|
||||||
if (userInfo.userPic !== null) {
|
|
||||||
this.getUserPic(userInfo.userPic).then((userPic) => {
|
|
||||||
// 把图片信息挂到用户信息中
|
|
||||||
userInfo.avator = 'uploadPath' + userPic.filePath + userPic.fileName
|
|
||||||
this.setUserInfo((JSON.stringify(userInfo)))
|
|
||||||
this.resetTime()
|
|
||||||
if (this.isRemember) {
|
|
||||||
this.rememberPwd({
|
|
||||||
username: this.username,
|
|
||||||
password: this.password
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.rememberPwd({
|
|
||||||
username: '',
|
|
||||||
password: ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取用户菜单
|
|
||||||
this.getMenu().then((menuList) => {
|
|
||||||
let hasHomeMenu = menuList.some((menuItem) => {
|
|
||||||
// return menuItem.id === 'G72J4WNFM8'
|
|
||||||
return menuItem.id === 'asdfadf'
|
|
||||||
})
|
|
||||||
|
|
||||||
if (hasHomeMenu) {
|
|
||||||
this.setMenu(JSON.stringify(menuList)).then(res => {
|
|
||||||
this.loading = false
|
|
||||||
this.$router.push('/home2')
|
|
||||||
}, e => {
|
|
||||||
this.loading = false
|
|
||||||
this.$message.warning('未获取到菜单')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$http.get('/logout', {}, {}, res => {
|
|
||||||
this.loading = false
|
|
||||||
this.$message.warning('无权访问')
|
|
||||||
this.$store.dispatch('logout')
|
|
||||||
}, e => {})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}, e => {
|
|
||||||
this.loading = false
|
|
||||||
this.$notify.error('用户信息拉取失败')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.setUserInfo((JSON.stringify(userInfo)))
|
|
||||||
this.resetTime()
|
|
||||||
if (this.isRemember) {
|
|
||||||
this.rememberPwd({
|
|
||||||
username: this.username,
|
|
||||||
password: this.password
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.rememberPwd({
|
|
||||||
username: '',
|
|
||||||
password: ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取用户菜单
|
|
||||||
this.getMenu().then((menuList) => {
|
|
||||||
let hasHomeMenu = false
|
|
||||||
menuList.map((menuItem) => {
|
|
||||||
if (menuItem.id === 'asdfadf') {
|
|
||||||
hasHomeMenu = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (hasHomeMenu) {
|
|
||||||
this.setMenu(JSON.stringify(menuList)).then(res => {
|
|
||||||
this.$router.push('/home2')
|
|
||||||
}, e => {
|
|
||||||
this.$message.warning('未获取到菜单')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$http.get('/logout', {}, {}, res => {
|
|
||||||
this.$message.warning('无权访问')
|
|
||||||
}, e => {})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let userInfo = {}
|
|
||||||
for (let key in userInfoObj) {
|
|
||||||
if (key !== 'uname') {
|
|
||||||
userInfo[key] = userInfoObj[key]
|
|
||||||
} else {
|
|
||||||
userInfo.uName = userInfoObj[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.setUserInfo(JSON.stringify((userInfo)))
|
|
||||||
this.resetTime()
|
|
||||||
if (this.isRemember) {
|
|
||||||
this.rememberPwd({
|
|
||||||
username: this.username,
|
|
||||||
password: this.password
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.rememberPwd({
|
|
||||||
username: '',
|
|
||||||
password: ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取用户菜单
|
|
||||||
this.getMenu().then((menuList) => {
|
|
||||||
let hasHomeMenu = false
|
|
||||||
menuList.map((menuItem) => {
|
|
||||||
if (menuItem.id === 'asdfadf') {
|
|
||||||
hasHomeMenu = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (hasHomeMenu) {
|
|
||||||
this.setMenu(JSON.stringify(menuList)).then(res => {
|
|
||||||
this.$router.push('/home2')
|
|
||||||
}, e => {
|
|
||||||
this.$message.warning('未获取到菜单')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$http.get('/logout', {}, {}, res => {
|
|
||||||
console.log('logout')
|
|
||||||
this.$message.warning('无权访问')
|
|
||||||
}, e => {
|
|
||||||
console.log(e)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, e => {
|
|
||||||
this.$message.warning('获取用户信息失败')
|
|
||||||
})
|
|
||||||
} else if (res.respCode === 'r0012') {
|
} else if (res.respCode === 'r0012') {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
<!-- 长城项目 登录页 -->
|
||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapMutations, mapActions } from 'vuex'
|
||||||
|
import axios from 'axios'
|
||||||
|
import util from 'util'
|
||||||
|
import { get_verify_by_instance,loginIdm,getMenu } from 'api/process'
|
||||||
|
import { ssoLoginUrlDev,ssoLoginUrl,webLoginType,devWebUrl } from '@/sysConfig'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LoginVerify',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
username: this.$store.state.laws_urm || '', // 用户名
|
||||||
|
password: this.$store.state.laws_prm || '', // 密码
|
||||||
|
loading: false,
|
||||||
|
isRemember: false, // 记住密码
|
||||||
|
showIETips: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* @description: 获取菜单logout
|
||||||
|
* @author: chenxiaoxi
|
||||||
|
* @date: 2018/11/11 13:42:14
|
||||||
|
*/
|
||||||
|
getMenu () {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.$http.get('sarUser/user/menu', {}, {
|
||||||
|
_this: this,
|
||||||
|
}, res => {
|
||||||
|
if (res.ok) {
|
||||||
|
resolve(res.data)
|
||||||
|
}
|
||||||
|
}, e => {
|
||||||
|
reject(e)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loginNew (res) {
|
||||||
|
if (res.data.orgId === null || res.data.orgId === '') {
|
||||||
|
this.$message.warning('未分配组织机构,请联系管理员分配后重新登录')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let Base64 = require('js-base64').Base64
|
||||||
|
let userInfoStr = Base64.decode(res.data)
|
||||||
|
let userInfo2 = decodeURIComponent(userInfoStr)
|
||||||
|
let userInfoObj = JSON.parse(userInfo2)
|
||||||
|
userInfoObj.userId = userInfoObj.usid
|
||||||
|
window.sessionStorage.setItem('userInfoObj', userInfoObj); // del
|
||||||
|
this.setToken(userInfoObj.token) // vuex存储token
|
||||||
|
let userInfo = {}
|
||||||
|
for (let key in userInfoObj) {
|
||||||
|
if (key !== 'uname') {
|
||||||
|
userInfo[key] = userInfoObj[key]
|
||||||
|
} else {
|
||||||
|
userInfo.uName = userInfoObj[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.setUserInfo(JSON.stringify((userInfo)))
|
||||||
|
// this.resetTime()
|
||||||
|
// 获取用户菜单
|
||||||
|
window.sessionStorage.setItem('userInfo', userInfo); // del
|
||||||
|
this.getMenu().then((menuList) => {
|
||||||
|
let hasHomeMenu = false
|
||||||
|
menuList.map((menuItem) => {
|
||||||
|
if (menuItem.id === 'asdfadf') {
|
||||||
|
hasHomeMenu = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
window.sessionStorage.setItem('hasHomeMenu', hasHomeMenu); // del
|
||||||
|
window.sessionStorage.setItem('menuList', menuList); // del
|
||||||
|
if (hasHomeMenu) {
|
||||||
|
this.setMenu(JSON.stringify(menuList)).then(res => {
|
||||||
|
// this.$router.push('/home1')
|
||||||
|
let routerUrl = localStorage.getItem("routerUrl");
|
||||||
|
let routerParam = localStorage.getItem("routerParam");
|
||||||
|
// 路由跳转
|
||||||
|
if(routerParam && routerParam != ''){
|
||||||
|
const param = routerParam.split("&");
|
||||||
|
this.$router.push({
|
||||||
|
name: routerUrl,
|
||||||
|
query: {
|
||||||
|
taskIds: param[0].split("=")[1],
|
||||||
|
prcId: param[1].split("=")[1],
|
||||||
|
prcNum: param[2].split("=")[1],
|
||||||
|
prcName: param[3].split("=")[1],
|
||||||
|
prcType: param[4].split("=")[1]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
this.$router.push('/'+routerUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}, e => {
|
||||||
|
this.$message.warning('未获取到菜单')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
alert('无系统权限')
|
||||||
|
// window.location.href = 'http://testsso1.foton.com.cn/oauth2.0/authorize?client_id=app_slrs&redirect_uri=http://127.0.0.1:9090&response_type=code';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
...mapMutations(['setToken', 'setUserInfo', 'resetTime', 'rememberPwd', 'setJESSCookie']),
|
||||||
|
...mapActions(['setMenu'])
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
let url = window.location.search
|
||||||
|
let code = "";
|
||||||
|
if(url){
|
||||||
|
url = url.substr(1);
|
||||||
|
url = url.split('&');
|
||||||
|
let info = [];
|
||||||
|
let obj = {};
|
||||||
|
for (let i = 0,len = url.length; i < len; i++) {
|
||||||
|
info = url[i].split('=')
|
||||||
|
obj[info[0]] = decodeURI(info[1]);
|
||||||
|
url[i] = obj;
|
||||||
|
}
|
||||||
|
code = url[0].code
|
||||||
|
}
|
||||||
|
let _formData = new FormData()
|
||||||
|
_formData.append('code', code === undefined ? "" : code)
|
||||||
|
loginIdm(_formData).then(res => {
|
||||||
|
if (res.ok) {
|
||||||
|
this.loginNew(res)
|
||||||
|
} else {
|
||||||
|
window.location.href = ssoLoginUrlDev
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (this.$store.state.laws_urm !== '') {
|
||||||
|
this.isRemember = true
|
||||||
|
}
|
||||||
|
const UA = navigator.userAgent.toLocaleLowerCase()
|
||||||
|
if (UA.match(/msie/) != null || UA.match(/trident/) != null) {
|
||||||
|
this.showIETips = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
+16
-30
@@ -6,14 +6,20 @@ Vue.use(Router)
|
|||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '*',
|
path: '*',
|
||||||
redirect: '/login'
|
redirect: '/loginVerify'
|
||||||
},
|
},
|
||||||
// 登录页
|
// 登录页
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
component: () =>
|
component: () =>
|
||||||
import('@/pages/login')
|
import('@/pages/login')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/loginVerify',
|
||||||
|
name: 'LoginVerify',
|
||||||
|
component: () =>
|
||||||
|
import('@/pages/loginVerify')
|
||||||
},
|
},
|
||||||
// 跳转刷新页面
|
// 跳转刷新页面
|
||||||
{
|
{
|
||||||
@@ -2106,33 +2112,13 @@ router.onError((error) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
// router.beforeEach((to, from, next) => {
|
||||||
let toName = to.name
|
// let toName = to.name
|
||||||
let token = store.state.token
|
// let token = store.state.token
|
||||||
// 返回值为登录状态
|
// // 返回值为登录状态
|
||||||
if ((token === null || token === '') && (toName !== 'Login' && to.meta.requireAuth)) {
|
// if ((token === null || token === '') && (toName !== 'Login' && to.meta.requireAuth)) {
|
||||||
return next('/Login')
|
// return next('/Login')
|
||||||
}
|
// }
|
||||||
// 流程页面权限判断
|
// })
|
||||||
// const processCenter = to.name === 'ProcessCenter' || (to.meta.parentPath && to.meta.parentPath === '/processCenter')
|
|
||||||
// if (processCenter) {
|
|
||||||
// if (to.meta.process) {
|
|
||||||
// if (store.getters.getHandleInfo.prcType === to.meta.process.prcType &&
|
|
||||||
// (store.getters.getHandleInfo. === to.meta.process.taskInfo ||
|
|
||||||
// (to.meta.process.taskInfo.__proto__.constructor === Array && to.meta.process.taskInfo.includes(store.getters.getHandleInfo.taskInfo)))) {
|
|
||||||
// next()
|
|
||||||
// } else {
|
|
||||||
// Message.error('请正确操作流程')
|
|
||||||
// setTimeout(() => {
|
|
||||||
// router.push({
|
|
||||||
// name: 'ProcessCenter'
|
|
||||||
// })
|
|
||||||
// }, 100)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// next()
|
|
||||||
// }
|
|
||||||
next()
|
|
||||||
})
|
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
+17
-6
@@ -4,10 +4,17 @@
|
|||||||
* @date: 2018-09-04 17:47:46
|
* @date: 2018-09-04 17:47:46
|
||||||
*/
|
*/
|
||||||
// 服务器地址
|
// 服务器地址
|
||||||
|
// const devIp = '39.98.140.126'
|
||||||
|
// const devInterfacePORT = '10005'
|
||||||
|
// const devIp = '192.168.10.248'
|
||||||
const devIp = '62.234.136.153'
|
const devIp = '62.234.136.153'
|
||||||
const devInterfacePORT = '8033'
|
const devInterfacePORT = '8033'
|
||||||
// const devIp = '192.168.10.247'
|
// 配置 idm 认证
|
||||||
// const devInterfacePORT = '9999'
|
const ssoLogin = 'http://testsso1.foton.com.cn/oauth2.0/authorize?client_id=app_slrs&response_type=code&redirect_uri='
|
||||||
|
// 配置 前端服务
|
||||||
|
const devWebUrl = 'http://127.0.0.1:10088/#/'
|
||||||
|
// webLoginType : idm (线上统一登录) 、 webLoginType: dev (测试环境登录)
|
||||||
|
const webLoginType = 'dev'
|
||||||
// 云端端口号
|
// 云端端口号
|
||||||
const DEV_CLOUD_RES_INTERFACE_PORT = '7777'
|
const DEV_CLOUD_RES_INTERFACE_PORT = '7777'
|
||||||
const simpleFilePath = 'att/attFile/upload'
|
const simpleFilePath = 'att/attFile/upload'
|
||||||
@@ -22,11 +29,11 @@ const theme = 'theme-one' // 主题(theme-one浅蓝色,theme-two深蓝色)
|
|||||||
const processPort = '17210'
|
const processPort = '17210'
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
|
|
||||||
<<<<<<<<< 主题修改 >>>>>>>>>
|
<<<<<<<<< 主题修改 >>>>>>>>>
|
||||||
|
|
||||||
1. 主题分为theme-one,theme-two两种
|
1. 主题分为theme-one,theme-two两种
|
||||||
2. 修改assets/styles/style.less文件,注释theme-one/theme-two
|
2. 修改assets/styles/style.less文件,注释theme-one/theme-two
|
||||||
3. 将上方theme改为theme-one/theme-two
|
3. 将上方theme改为theme-one/theme-two
|
||||||
|
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
// 生产环境配置
|
// 生产环境配置
|
||||||
@@ -41,6 +48,10 @@ const CLOUD_RES_INTERFACE_PORT = process.env.NODE_ENV === 'production' ? DEV_CLO
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
baseUrl: 'http://' + serverIP + ':' + interfacePORT,
|
baseUrl: 'http://' + serverIP + ':' + interfacePORT,
|
||||||
|
webLoginType: webLoginType,
|
||||||
|
ssoLoginUrlDev: ssoLogin + devWebUrl,
|
||||||
|
ssoLoginUrl: ssoLogin,
|
||||||
|
devWebUrl: devWebUrl,
|
||||||
serverUrl: 'http://' + serverIP, // 服务器IP地址
|
serverUrl: 'http://' + serverIP, // 服务器IP地址
|
||||||
interfaceUrl: 'http://' + serverIP + ':' + interfacePORT + '/api/', // 服务器端接口访问地址,
|
interfaceUrl: 'http://' + serverIP + ':' + interfacePORT + '/api/', // 服务器端接口访问地址,
|
||||||
cloudResInterFaceUrl: 'http://' + serverIP + ':' + interfacePORT + '/busApi/', // 云端资源库服务器端接口访问地址,
|
cloudResInterFaceUrl: 'http://' + serverIP + ':' + interfacePORT + '/busApi/', // 云端资源库服务器端接口访问地址,
|
||||||
|
|||||||
Reference in New Issue
Block a user