diff --git a/README.md b/README.md index afc2975b..f8fba06d 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ # 安装依赖 npm install - +    # 建议不要用cnpm  安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题 npm install --registry=https://registry.npm.taobao.org @@ -61,7 +61,7 @@ ├── build // 构建相关   ├── config // 配置相关 ├── src // 源代码 -│   ├── api // 所以请求 +│   ├── api // 所有请求 │   ├── assets // 主题 字体等静态资源 │   ├── components // 全局公用组件 │   ├── directive // 全局指令 diff --git a/src/utils/fetch.js b/src/utils/fetch.js index 71cfc2d2..1ef50a0a 100644 --- a/src/utils/fetch.js +++ b/src/utils/fetch.js @@ -7,7 +7,7 @@ export default function _fetch(options) { return new Promise((resolve, reject) => { const instance = axios.create({ baseURL: process.env.BASE_API, - // timeout: 2000, + // timeout: 2000, headers: { 'X-Ivanka-Token': store.getters.token } }); instance(options) @@ -20,15 +20,14 @@ export default function _fetch(options) { type: 'error', duration: 5 * 1000 }); - // 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token + // 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token if (res.code === 50008 || res.code === 50014 || res.code === 50012) { Message({ message: res.message, type: 'error', duration: 5 * 1000 }); - // router.push({path: '/'}) - // TODO + // 登出 store.dispatch('FedLogOut').then(() => { router.push({ path: '/login' }) });