Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
c394f8c5
Commit
c394f8c5
authored
May 29, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
存证详情bugfix
parent
c2ff9f86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
7 deletions
+25
-7
ProofItem.vue
src/components/ProofItem.vue
+3
-3
http.ts
src/utils/http.ts
+19
-1
ProofDetail.vue
src/views/ProofDetail.vue
+3
-3
No files found.
src/components/ProofItem.vue
View file @
c394f8c5
...
...
@@ -37,11 +37,11 @@ export default class ProofItem extends Vue {
}
get
statusStr
()
{
let
{
status
}
=
this
.
proof
;
return
{
text
:
ChainStatusStr
[
this
.
proof
.
status
],
class
:
classEnum
[
this
.
proof
.
status
],
text
:
ChainStatusStr
[
status
],
class
:
classEnum
[
status
],
};
// ChainStatusStr[this.proof.status];
}
}
</
script
>
...
...
src/utils/http.ts
View file @
c394f8c5
...
...
@@ -6,7 +6,18 @@ import axios from 'axios';
import
router
from
'../router'
;
import
store
from
'../store/index'
;
import
{
Toast
}
from
'vant'
;
import
user
from
'@/api/user'
;
let
pendingAjax
:
any
=
[];
const
fastClickMsg
=
'数据请求中,请稍后'
;
const
CancelToken
=
axios
.
CancelToken
;
const
removePendingAjax
=
(
config
:
any
,
c
?:
any
)
=>
{
const
url
=
config
.
url
;
const
index
=
pendingAjax
.
findIndex
((
i
:
any
)
=>
i
===
url
);
if
(
index
>
-
1
)
{
c
?
c
(
fastClickMsg
)
:
pendingAjax
.
splice
(
index
,
1
);
}
else
{
c
&&
pendingAjax
.
push
(
url
);
}
};
/**
* 提示函数
* 禁止点击蒙层、显示一秒后关闭
...
...
@@ -75,6 +86,10 @@ instance.interceptors.request.use(
// 后台根据携带的token判断用户的登录情况,并返回给我们对应的状态码
// 而后我们可以在响应拦截器中,根据状态码进行一些统一的操作。
// token && (config.headers.Authorization = token);
config
.
cancelToken
=
new
CancelToken
((
c
)
=>
{
removePendingAjax
(
config
,
c
);
});
let
userInfo
=
localStorage
.
getItem
(
'userInfo'
);
userInfo
=
userInfo
?
JSON
.
parse
(
userInfo
)
:
{};
config
.
headers
.
Authorization
=
(
userInfo
as
any
).
token
||
''
;
...
...
@@ -86,6 +101,7 @@ instance.interceptors.request.use(
instance
.
interceptors
.
response
.
use
(
// 请求成功
(
res
:
any
)
=>
{
removePendingAjax
(
res
.
config
);
if
(
res
.
status
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
return
Promise
.
resolve
(
res
.
data
.
data
);
...
...
@@ -116,6 +132,8 @@ instance.interceptors.response.use(
}
else
{
if
(
error
.
message
.
includes
(
'timeout'
))
{
tip
(
'请求超时'
);
}
else
{
tip
(
error
.
message
);
}
return
Promise
.
reject
(
error
);
}
...
...
src/views/ProofDetail.vue
View file @
c394f8c5
...
...
@@ -92,11 +92,11 @@ export default class ProofDetail extends Vue {
key
:
'存证名称'
,
label
:
'存证名称'
,
};
this
.
detail
=
[
this
.
detail
,
nameType
];
let
detail
=
[
this
.
detail
,
nameType
];
if
(
this
.
id
)
{
await
this
.
$api
.
proof
.
update
(
this
.
id
,
this
.
name
,
this
.
detail
);
await
this
.
$api
.
proof
.
update
(
this
.
id
,
this
.
name
,
detail
);
}
else
{
await
this
.
$api
.
proof
.
add
(
this
.
name
,
this
.
detail
);
await
this
.
$api
.
proof
.
add
(
this
.
name
,
detail
);
}
this
.
checkEdited
=
false
;
this
.
$router
.
push
({
name
:
'ProofList'
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment