Commit 1fd5fe7c by 姜雷

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

parent 464bc83b
......@@ -33,7 +33,7 @@
"nprogress": "^0.2.0",
"popmotion": "^8.1.22",
"qiniu-js": "^2.2.0",
"rym-element-ui": "^0.1.52",
"rym-element-ui": "^0.1.53",
"vue-qr": "^1.2.8",
"vuedraggable": "^2.16.0",
"wangeditor": "^3.1.1"
......
import fetch from '../fetch';
const path = process.env.VUE_APP_BASE_SERVER_URL;
// const path = 'http://192.168.1.33:8889';
export const fetchAreaList = req =>
fetch({
......@@ -35,7 +34,7 @@ export const fetchOperatorList = req =>
// 获取豆类型
export const fetchBeansList = req =>
fetch({
url: '/baseData/beans',
url: path + '/baseData/beans',
method: 'get',
...req,
});
......
import axios from 'axios';
import { Message, MessageBox } from 'element-ui';
import store from '../store';
import { SUCCESS_CODE } from '@/config';
import { SUCCESS_CODE, LOGOUT_CODE } from '@/config';
import { errorHandle } from './validate';
import { getYourIP } from '@/utils/getIp.js';
......@@ -67,7 +67,7 @@ service.interceptors.response.use(response => {
});
// -2:其他客户端登录了;Token 过期了;
if (res.code === '-2') {
if (res.code === LOGOUT_CODE) {
if (logout) return;
logout = true;
MessageBox.confirm(
......
export const TOKEN_KEY = 'dcrym';
export const SUCCESS_CODE = 1000;
export const LOGOUT_CODE = -2;
export const selectTypeMapping = [
{ 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