Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-platform
Commits
8015fac5
Commit
8015fac5
authored
Apr 28, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备管理 外部登录
parent
1285c225
Pipeline
#1305
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
device-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
.../java/com/mortals/xhx/base/login/web/LoginController.java
+9
-4
No files found.
device-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
View file @
8015fac5
...
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.util.*
;
import
com.mortals.framework.util.*
;
import
com.mortals.xhx.base.system.menu.model.MenuEntity
;
import
com.mortals.xhx.base.system.menu.model.MenuEntity
;
...
@@ -20,6 +21,7 @@ import com.mortals.xhx.common.key.RedisKey;
...
@@ -20,6 +21,7 @@ import com.mortals.xhx.common.key.RedisKey;
import
com.mortals.xhx.base.system.site.service.SiteService
;
import
com.mortals.xhx.base.system.site.service.SiteService
;
import
com.mortals.xhx.daemon.task.CustomerInfo
;
import
com.mortals.xhx.daemon.task.CustomerInfo
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Claims
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -40,6 +42,7 @@ import com.mortals.framework.web.BaseCRUDJsonController;
...
@@ -40,6 +42,7 @@ import com.mortals.framework.web.BaseCRUDJsonController;
@RestController
@RestController
@RequestMapping
(
"login"
)
@RequestMapping
(
"login"
)
@Slf4j
public
class
LoginController
extends
BaseCRUDJsonController
<
UserService
,
UserForm
,
UserEntity
,
Long
>
{
public
class
LoginController
extends
BaseCRUDJsonController
<
UserService
,
UserForm
,
UserEntity
,
Long
>
{
@Autowired
@Autowired
...
@@ -136,10 +139,11 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
...
@@ -136,10 +139,11 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
JSONObject
ret
=
new
JSONObject
();
JSONObject
ret
=
new
JSONObject
();
IUser
user
=
this
.
getCurUser
();
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
)
{
if
(
user
==
null
)
{
user
=
super
.
getCurUser
();
return
""
;
if
(
user
==
null
)
{
// user = super.getCurUser();
return
""
;
// if (user == null) {
}
// return "";
// }
}
}
Set
<
String
>
urls
=
resourceService
.
findUrlSetByUserId
(
user
.
getId
());
Set
<
String
>
urls
=
resourceService
.
findUrlSetByUserId
(
user
.
getId
());
List
<
MenuEntity
>
outlookBarList
=
menuService
.
findTreeMenu
(
user
,
urls
);
List
<
MenuEntity
>
outlookBarList
=
menuService
.
findTreeMenu
(
user
,
urls
);
...
@@ -322,6 +326,7 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
...
@@ -322,6 +326,7 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
Map
objMap
=
claims
.
get
(
"userInfo"
,
Map
.
class
);
Map
objMap
=
claims
.
get
(
"userInfo"
,
Map
.
class
);
CustomerInfo
userInfo
=
new
CustomerInfo
();
CustomerInfo
userInfo
=
new
CustomerInfo
();
BeanUtil
.
fillBeanWithMap
(
objMap
,
userInfo
,
true
);
BeanUtil
.
fillBeanWithMap
(
objMap
,
userInfo
,
true
);
log
.
info
(
"userInfo:{}"
,
JSON
.
toJSONString
(
userInfo
));
if
(!
ObjectUtils
.
isEmpty
(
userInfo
)
if
(!
ObjectUtils
.
isEmpty
(
userInfo
)
&&
!
ObjectUtils
.
isEmpty
(
userInfo
.
getId
())
&&
!
ObjectUtils
.
isEmpty
(
userInfo
.
getId
())
&&
!
ObjectUtils
.
isEmpty
(
userInfo
.
getAccount
()))
{
&&
!
ObjectUtils
.
isEmpty
(
userInfo
.
getAccount
()))
{
...
...
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