Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydLife
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
ydLife
Commits
50375234
Commit
50375234
authored
Jun 15, 2022
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取版本号的时候增加是否需要清空缓存信息
parent
931a34aa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
src/app/app.component.ts
+1
-0
src/app/auth/auth.service.ts
+2
-2
src/app/auth/login/login.component.ts
+1
-1
src/index.html
+3
-2
No files found.
src/app/app.component.ts
View file @
50375234
...
...
@@ -88,6 +88,7 @@ export class AppComponent implements OnInit, OnDestroy {
const
Version
=
localStorage
.
getItem
(
'Version'
);
//如果缓存有版本号对比本地和接口版本
if
(
Version
!=
this
.
currentVersion
)
{
localStorage
.
clear
();
this
.
isNeedAlert
=
true
;
this
.
dialogInfo
=
{
title
:
null
,
...
...
src/app/auth/auth.service.ts
View file @
50375234
...
...
@@ -43,9 +43,9 @@ export class AuthService {
/**
* 获取TOKEN
*/
obtainToken
(
loginId
)
{
obtainToken
(
loginId
,
customerId
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
)).
customerId
)
{
const
url
=
this
.
API
+
'/authorize/obtainToken'
;
return
this
.
http
.
post
(
url
,
JSON
.
stringify
({
ticket
:
"life"
,
loginId
:
loginId
,
customerId
:
localStorage
.
getItem
(
'lifeCustomerInfo'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
)).
customerId
:
null
}));
return
this
.
http
.
post
(
url
,
JSON
.
stringify
({
ticket
:
"life"
,
loginId
:
loginId
,
customerId
:
customerId
}));
}
//获取微信配置ydLife公众号
...
...
src/app/auth/login/login.component.ts
View file @
50375234
...
...
@@ -90,7 +90,7 @@ export class LoginComponent implements OnInit, OnDestroy {
sessionStorage
.
setItem
(
'subordinateSystemName'
,
response
[
'data'
][
'practitionerBasicInfo'
][
'subordinateName'
])
}
const
lifeCustomerInfo
=
{
...
response
.
data
,
mobileNo
:
this
.
userInfo
.
mobileNo
,
commonResult
:
null
};
this
.
authService
.
obtainToken
(
this
.
userInfo
.
mobileNo
).
subscribe
((
res
)
=>
{
this
.
authService
.
obtainToken
(
this
.
userInfo
.
mobileNo
,
response
[
'data'
][
'customerId'
]
).
subscribe
((
res
)
=>
{
if
(
res
[
'success'
])
{
localStorage
.
setItem
(
'lifeToken'
,
res
[
'data'
][
'token'
]);
}
...
...
src/index.html
View file @
50375234
...
...
@@ -91,7 +91,8 @@
contentType
:
"application/json"
,
data
:
JSON
.
stringify
({
ticket
:
'life'
,
loginId
:
loginId
loginId
:
loginId
,
customerId
:
localStorage
.
getItem
(
'lifeCustomerInfo'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
)).
customerId
:
null
}),
async
:
false
,
success
:
function
(
res
)
{
...
...
@@ -101,7 +102,7 @@
return
token
;
}
var
token
=
getToken
(
);
var
token
=
setTimeout
(()
=>
{
getToken
()}
);
function
getQueryString
(
name
)
{
const
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
);
...
...
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