From 021a7009cbe11baf4459df657823244029607d94 Mon Sep 17 00:00:00 2001 From: Pan <panfree23@gmail.com> Date: Tue, 2 May 2017 13:05:00 +0800 Subject: [PATCH] refine --- README.md | 4 ++-- src/utils/fetch.js | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) 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' }) }); -- GitLab