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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Sean King
admin-fe
Commits
021a7009
Commit
021a7009
authored
7 years ago
by
Pan
Browse files
Options
Downloads
Patches
Plain Diff
refine
parent
3063d9c8
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
README.md
+2
-2
2 additions, 2 deletions
README.md
src/utils/fetch.js
+3
-4
3 additions, 4 deletions
src/utils/fetch.js
with
5 additions
and
6 deletions
README.md
+
2
−
2
View file @
021a7009
...
...
@@ -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 // 全局指令
...
...
This diff is collapsed.
Click to expand it.
src/utils/fetch.js
+
3
−
4
View file @
021a7009
...
...
@@ -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
'
})
});
...
...
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