Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
0da4e5e5
Commit
0da4e5e5
authored
7 years ago
by
Pan
Browse files
Options
Downloads
Patches
Plain Diff
add tips
parent
88f2f7ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.js
+15
-19
15 additions, 19 deletions
src/main.js
src/utils/fetch.js
+19
-20
19 additions, 20 deletions
src/utils/fetch.js
with
34 additions
and
39 deletions
src/main.js
+
15
−
19
View file @
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
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/utils/fetch.js
+
19
−
20
View file @
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment