This commit is contained in:
Vergil
2020-04-13 15:13:24 +08:00
parent 37d1a82b07
commit af2f5c5e4e
4 changed files with 53 additions and 9 deletions

View File

@@ -16,8 +16,9 @@ export function getInfo(token) {
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '3', type: '1',
name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号=${token} order by 模块顺序` name: `菜单系统模块_获取角色模块_查询数据`,
param: `角色编号=${token}`
} }
}) })
} }

View File

@@ -44,6 +44,7 @@ const user = {
Cookies.set('id', data[0].人员编号, { expires: 1 }) Cookies.set('id', data[0].人员编号, { expires: 1 })
Cookies.set('name', data[0].姓名, { expires: 1 }) Cookies.set('name', data[0].姓名, { expires: 1 })
Cookies.set('userId', data[0].考勤编号, { expires: 1 }) Cookies.set('userId', data[0].考勤编号, { expires: 1 })
Cookies.set('session_id', data[0].session_id)
commit('SET_TOKEN', data[0].角色编号) commit('SET_TOKEN', data[0].角色编号)
commit('SET_NAME', data[0].姓名) commit('SET_NAME', data[0].姓名)
commit('SET_ID', data[0].人员编号) commit('SET_ID', data[0].人员编号)

View File

@@ -1,4 +1,6 @@
import axios from 'axios' import axios from 'axios'
import Cookies from 'js-cookie'
import store from '@/store'
export const wsuri = `ws://123.56.95.229:61101//WebMoudule//websocket` export const wsuri = `ws://123.56.95.229:61101//WebMoudule//websocket`
export const name = `OP8888` export const name = `OP8888`
@@ -26,7 +28,44 @@ export const MESUploadFile = `http://123.56.95.229:8010/submit/MESUploadFile.ash
export const MESDownloadFile = `http://123.56.95.229:8010/submit/MESDownloadFile.ashx` export const MESDownloadFile = `http://123.56.95.229:8010/submit/MESDownloadFile.ashx`
const service = axios.create({ const service = axios.create({
baseURL: `http://123.56.95.229:8010/submit/MESCommonBase.ashx`, baseURL: `http://123.56.95.229:8010/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.1.192:8045/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间 timeout: 1500000 // 请求超时时间
}) })
// && config.data.name !== '菜单系统模块_通知信息_查询数据' && config.data.name !== '菜单系统模块_首页信息_查询数据1' && config.data.name !== '菜单系统模块_首页信息_查询数据2'
service.interceptors.request.use(config => {
if (config.data.name !== '菜单系统模块_用户名密码_查询数据_new2' && config.data.name !== '菜单系统模块_获取角色模块_查询数据') {
getSession_id().then(res => {
if (res === 0) {
store.dispatch('FedLogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
alert('此账号已异地登录,请查重新登录')
})
}
})
}
return config
}, error => {
Promise.reject(error)
})
export default service export default service
async function getSession_id() {
const id = Cookies.get('id')
const session_id = Cookies.get('session_id')
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '菜单系统模块_用户sessionID_查询数据',
param: '人员编号=' + id
}
}
const res = await axios(param)
if (session_id !== res.data[0].session_id) {
return 0
} else {
return 1
}
}

View File

@@ -69,8 +69,9 @@ export default {
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '3', type: '1',
name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号= ${this.token} and [path] = '/'` name: `菜单系统模块_首页信息_查询数据1`,
param: '角色编号=' + this.token
} }
}).then(data => { }).then(data => {
this.fathers = [] this.fathers = []
@@ -92,8 +93,9 @@ export default {
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '3', type: '1',
name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号= ${this.token} and [path] <> '/'` name: `菜单系统模块_首页信息_查询数据2`,
param: '角色编号=' + this.token
} }
}).then(data => { }).then(data => {
this.sons = [] this.sons = []
@@ -113,8 +115,9 @@ export default {
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '3', type: '1',
name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号=${this.token} and 是否通知 = 1` name: `菜单系统模块_通知信息_查询数据`,
param: '角色编号=' + this.token
} }
}).then(data => { }).then(data => {
this.sudokus = [] this.sudokus = []