From 647d6c99cb96cd7296aeaceaee9050beaaeed642 Mon Sep 17 00:00:00 2001 From: Vergil <974548713@qq.com> Date: Tue, 14 Apr 2020 09:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 1a0a2e90..0e7d73f1 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,6 +1,6 @@ import axios from 'axios' -import Cookies from 'js-cookie' -import store from '@/store' +// import Cookies from 'js-cookie' +// import store from '@/store' export const wsuri = `ws://123.56.95.229:61101//WebMoudule//websocket` export const name = `OP8888` @@ -33,16 +33,16 @@ const service = axios.create({ // && 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('此账号已异地登录,请查重新登录') - }) - } - }) - } + // 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) @@ -50,22 +50,22 @@ service.interceptors.request.use(config => { 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 - } -} +// 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 +// } +// }