Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
pingan-life-index-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0dc2efb3
authored
2020-03-18 13:33:10 +0800
by
joe
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
10分钟缓存
1 parent
6075dcf6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
src/api/fetch-api.js
src/pages/clarms/clarms.js
src/api/fetch-api.js
View file @
0dc2efb
...
...
@@ -111,6 +111,10 @@ axios.interceptors.response.use(
}
else
{
if
(
response
.
data
.
code
===
404
)
{
SET_USER_INFO
(
state
,
null
);
for
(
let
index
=
0
;
index
<
sessionStorage
.
length
;
index
++
)
{
let
key
=
sessionStorage
.
key
(
index
);
sessionStorage
.
removeItem
(
key
);
}
}
// Toast(response.data.bizMsg);
return
Promise
.
reject
(
response
.
data
);
...
...
src/pages/clarms/clarms.js
View file @
0dc2efb
...
...
@@ -39,7 +39,8 @@ export default {
// 可以理赔的客户信息
customerList
:
[],
modelType
:
"1"
,
modalVisiable
:
true
modalVisiable
:
true
,
cacheCid
:
10
*
60
*
1000
}
},
components
:
{
...
...
@@ -64,13 +65,22 @@ export default {
// return;
if
(
this
.
userInfo
&&
this
.
userInfo
.
name
)
{
this
.
loadCidIfLogin
();
sessionStorage
.
removeItem
(
"clarmsRequestCid"
)
sessionStorage
.
removeItem
(
"clarmsRequestCid"
);
sessionStorage
.
removeItem
(
"clarmsRequestCidExpireAt"
);
}
else
{
let
cid
=
sessionStorage
.
getItem
(
"clarmsRequestCid"
);
let
expireAt
=
sessionStorage
.
getItem
(
"clarmsRequestCidExpireAt"
);
if
(
cid
)
{
if
(
expireAt
&&
expireAt
>
new
Date
().
getTime
())
{
sessionStorage
.
setItem
(
"clarmsRequestCidExpireAt"
,
(
new
Date
().
getTime
()
+
this
.
cacheCid
));
this
.
cid
=
cid
;
this
.
checkCid
();
}
else
{
sessionStorage
.
removeItem
(
"clarmsRequestCid"
)
sessionStorage
.
removeItem
(
"clarmsRequestCidExpireAt"
);
this
.
step
=
1
;
}
}
else
{
this
.
step
=
1
;
}
}
...
...
@@ -126,6 +136,7 @@ export default {
},
handleInsuredInfo
(
data
)
{
this
.
cid
=
data
.
cid
;
sessionStorage
.
setItem
(
"clarmsRequestCidExpireAt"
,
(
new
Date
().
getTime
()
+
this
.
cacheCid
));
this
.
customerList
=
data
.
list
;
this
.
step
=
2
;
},
...
...
@@ -148,7 +159,7 @@ export default {
}
});
},
cacheData
(){
cacheData
()
{
let
m
=
this
.
$refs
[
"material"
];
// console.log("cacheData");
if
(
m
)
{
...
...
Please
register
or
sign in
to post a comment