Commit 1fd5fe7c by 姜雷

添加登出code和获取豆类型地址

parent 464bc83b
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"popmotion": "^8.1.22", "popmotion": "^8.1.22",
"qiniu-js": "^2.2.0", "qiniu-js": "^2.2.0",
"rym-element-ui": "^0.1.52", "rym-element-ui": "^0.1.53",
"vue-qr": "^1.2.8", "vue-qr": "^1.2.8",
"vuedraggable": "^2.16.0", "vuedraggable": "^2.16.0",
"wangeditor": "^3.1.1" "wangeditor": "^3.1.1"
......
import fetch from '../fetch'; import fetch from '../fetch';
const path = process.env.VUE_APP_BASE_SERVER_URL; const path = process.env.VUE_APP_BASE_SERVER_URL;
// const path = 'http://192.168.1.33:8889';
export const fetchAreaList = req => export const fetchAreaList = req =>
fetch({ fetch({
...@@ -35,7 +34,7 @@ export const fetchOperatorList = req => ...@@ -35,7 +34,7 @@ export const fetchOperatorList = req =>
// 获取豆类型 // 获取豆类型
export const fetchBeansList = req => export const fetchBeansList = req =>
fetch({ fetch({
url: '/baseData/beans', url: path + '/baseData/beans',
method: 'get', method: 'get',
...req, ...req,
}); });
......
import axios from 'axios'; import axios from 'axios';
import { Message, MessageBox } from 'element-ui'; import { Message, MessageBox } from 'element-ui';
import store from '../store'; import store from '../store';
import { SUCCESS_CODE } from '@/config'; import { SUCCESS_CODE, LOGOUT_CODE } from '@/config';
import { errorHandle } from './validate'; import { errorHandle } from './validate';
import { getYourIP } from '@/utils/getIp.js'; import { getYourIP } from '@/utils/getIp.js';
...@@ -67,7 +67,7 @@ service.interceptors.response.use(response => { ...@@ -67,7 +67,7 @@ service.interceptors.response.use(response => {
}); });
// -2:其他客户端登录了;Token 过期了; // -2:其他客户端登录了;Token 过期了;
if (res.code === '-2') { if (res.code === LOGOUT_CODE) {
if (logout) return; if (logout) return;
logout = true; logout = true;
MessageBox.confirm( MessageBox.confirm(
......
export const TOKEN_KEY = 'dcrym'; export const TOKEN_KEY = 'dcrym';
export const SUCCESS_CODE = 1000; export const SUCCESS_CODE = 1000;
export const LOGOUT_CODE = -2;
export const selectTypeMapping = [ export const selectTypeMapping = [
{ label: '赠送类型', value: '2' }, { label: '赠送类型', value: '2' },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment