Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team6-Digital Insight for Health
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Chen Liang
Team6-Digital Insight for Health
Commits
ebfe72ed
Commit
ebfe72ed
authored
8 months ago
by
Yulong Wang
Browse files
Options
Downloads
Plain Diff
Merge branch 'wyl' into 'main'
fix bug See merge request
!32
parents
f5b43e20
952299b1
Branches
Branches containing commit
No related tags found
1 merge request
!32
fix bug
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/cardiff/client_project/service/UserLogin.java
+9
-0
9 additions, 0 deletions
...in/java/com/cardiff/client_project/service/UserLogin.java
src/main/resources/static/html/login.html
+3
-0
3 additions, 0 deletions
src/main/resources/static/html/login.html
with
12 additions
and
0 deletions
src/main/java/com/cardiff/client_project/service/UserLogin.java
+
9
−
0
View file @
ebfe72ed
...
...
@@ -33,6 +33,9 @@ public class UserLogin implements UserDetailsService {
}
if
(
object
instanceof
CommonAdmin
){
CommonAdmin
inforByName
=
(
CommonAdmin
)
object
;
if
(
inforByName
.
getStatus
()==
0
){
return
User
.
withUsername
(
inforByName
.
getName
()).
password
(
inforByName
.
getPassword
()).
authorities
(
new
SimpleGrantedAuthority
(
"NULL"
)).
build
();
}
String
type
=
superAdminMapper
.
getTypeById
(
inforByName
.
getRoleId
());
SimpleGrantedAuthority
authority
=
new
SimpleGrantedAuthority
(
type
);
userDetails
=
User
.
withUsername
(
inforByName
.
getName
()).
password
(
inforByName
.
getPassword
()).
authorities
(
authority
).
build
();
...
...
@@ -40,6 +43,9 @@ public class UserLogin implements UserDetailsService {
if
(
object
instanceof
Hospital
){
Hospital
inforByName
=
(
Hospital
)
object
;
if
(
inforByName
.
getStatus
()==
0
){
return
User
.
withUsername
(
inforByName
.
getName
()).
password
(
inforByName
.
getPassword
()).
authorities
(
new
SimpleGrantedAuthority
(
"NULL"
)).
build
();
}
String
type
=
superAdminMapper
.
getTypeById
(
inforByName
.
getRoleId
());
SimpleGrantedAuthority
authority
=
new
SimpleGrantedAuthority
(
type
);
userDetails
=
User
.
withUsername
(
inforByName
.
getName
()).
password
(
inforByName
.
getPassword
()).
authorities
(
authority
).
build
();
...
...
@@ -47,6 +53,9 @@ public class UserLogin implements UserDetailsService {
if
(
object
instanceof
Patient
){
Patient
inforByName
=
(
Patient
)
object
;
if
(
inforByName
.
getStatus
()==
0
){
return
User
.
withUsername
(
inforByName
.
getName
()).
password
(
inforByName
.
getPassword
()).
authorities
(
new
SimpleGrantedAuthority
(
"NULL"
)).
build
();
}
String
type
=
superAdminMapper
.
getTypeById
(
inforByName
.
getRoleId
());
SimpleGrantedAuthority
authority
=
new
SimpleGrantedAuthority
(
type
);
userDetails
=
User
.
withUsername
(
inforByName
.
getName
()).
password
(
inforByName
.
getPassword
()).
authorities
(
authority
).
build
();
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/static/html/login.html
+
3
−
0
View file @
ebfe72ed
...
...
@@ -162,6 +162,9 @@
if
(
type
==
"
[
"
+
"
HOSPITAL
"
+
"
]
"
)
{
window
.
location
.
href
=
""
;
}
if
(
type
==
"
[
"
+
"
NULL
"
+
"
]
"
){
window
.
location
.
href
=
"
fault.html
"
;
}
alert
(
"
login success
"
);
}
}
...
...
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