Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gyf5267218
vue-element-admin
提交
0da4e5e5
V
vue-element-admin
项目概览
gyf5267218
/
vue-element-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-element-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0da4e5e5
编写于
5月 16, 2017
作者:
P
Pan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add tips
上级
88f2f7ea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
39 deletion
+34
-39
src/main.js
src/main.js
+15
-19
src/utils/fetch.js
src/utils/fetch.js
+19
-20
未找到文件。
src/main.js
浏览文件 @
0da4e5e5
...
...
@@ -6,31 +6,27 @@ import router from './router';
import
store
from
'
./store
'
;
import
ElementUI
from
'
element-ui
'
;
import
'
element-ui/lib/theme-default/index.css
'
;
import
'
assets/custom-theme/index.css
'
;
// https://github.com/PanJiaChen/custom-element-theme
import
NProgress
from
'
nprogress
'
;
import
'
nprogress/nprogress.css
'
;
import
'
normalize.css/normalize.css
'
;
import
'
styles/index.scss
'
;
import
'
components/Icon-svg/index
'
;
import
'
assets/iconfont/iconfont
'
;
import
*
as
filters
from
'
./filters
'
;
import
Multiselect
from
'
vue-multiselect
'
;
import
Sticky
from
'
components/Sticky
'
;
import
'
vue-multiselect/dist/vue-multiselect.min.css
'
;
import
vueWaves
from
'
./directive/waves
'
;
import
vueSticky
from
'
./directive/sticky
'
;
import
errLog
from
'
store/errLog
'
;
import
'
./mock/index.js
'
;
// 使用api请求时请将此行注释,不然将被mock拦截!!
// import './styles/mixin.scss';
import
permission
from
'
store/permission
'
;
import
'
assets/custom-theme/index.css
'
;
// 换肤版本element-ui css https://github.com/PanJiaChen/custom-element-theme
import
NProgress
from
'
nprogress
'
;
// Progress 进度条
import
'
nprogress/nprogress.css
'
;
// Progress 进度条 样式
import
'
normalize.css/normalize.css
'
;
// normalize.css 样式格式化
import
'
styles/index.scss
'
;
// 全局自定义的css样式
import
'
components/Icon-svg/index
'
;
// 封装的svg组件
import
'
assets/iconfont/iconfont
'
;
// iconfont 具体图标见https://github.com/PanJiaChen/vue-element-admin/wiki
import
*
as
filters
from
'
./filters
'
;
// 全局vue filter
import
Multiselect
from
'
vue-multiselect
'
;
// 使用的一个多选框组件,element-ui的select不能满足所有需求
import
'
vue-multiselect/dist/vue-multiselect.min.css
'
;
// 多选框组件css
import
Sticky
from
'
components/Sticky
'
;
// 粘性header组件
import
vueWaves
from
'
./directive/waves
'
;
// 水波纹指令
import
errLog
from
'
store/errLog
'
;
// error log组件
import
'
./mock/index.js
'
;
// 该项目所有请求使用mockjs模拟
import
permission
from
'
store/permission
'
;
// 权限控制
// register globally
Vue
.
component
(
'
multiselect
'
,
Multiselect
);
Vue
.
component
(
'
Sticky
'
,
Sticky
);
Vue
.
use
(
ElementUI
);
Vue
.
use
(
vueWaves
);
Vue
.
use
(
vueSticky
);
// register global utility filters.
Object
.
keys
(
filters
).
forEach
(
key
=>
{
...
...
src/utils/fetch.js
浏览文件 @
0da4e5e5
...
...
@@ -26,27 +26,26 @@ service.interceptors.request.use(config => {
// respone拦截器
service
.
interceptors
.
response
.
use
(
response
=>
response
/**
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 如通过htmlrequest 状态码标示 逻辑可写在下面error中
*/
/**
/**
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 如通过htmlrequest 状态码标示 逻辑可写在下面error中
*/
// const code = response.data.code;
// // 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token
// if (code === 50008 || code === 50014 || code === 50012) {
// Message({
// message: res.message,
// type: 'error',
// duration: 5 * 1000
// });
// // 登出
// store.dispatch('FedLogOut').then(() => {
// router.push({ path: '/login' })
// });
// } else {
// return response
// }
// const code = response.data.code;
// // 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token
// if (code === 50008 || code === 50014 || code === 50012) {
// Message({
// message: res.message,
// type: 'error',
// duration: 5 * 1000
// });
// // 登出
// store.dispatch('FedLogOut').then(() => {
// router.push({ path: '/login' })
// });
// } else {
// return response
// }
,
error
=>
{
console
.
log
(
'
err
'
+
error
);
// for debug
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录