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
0f289e4a
Commit
0f289e4a
authored
Apr 28, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备管理
parent
7c0a8e70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
18 deletions
+4
-18
device-manager/src/main/java/com/mortals/xhx/ManagerApplication.java
...ger/src/main/java/com/mortals/xhx/ManagerApplication.java
+2
-2
device-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
.../java/com/mortals/xhx/base/login/web/LoginController.java
+1
-11
device-manager/src/main/java/com/mortals/xhx/base/system/menu/service/impl/MenuServiceImpl.java
...ls/xhx/base/system/menu/service/impl/MenuServiceImpl.java
+0
-4
pom.xml
pom.xml
+1
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/ManagerApplication.java
View file @
0f289e4a
...
...
@@ -16,10 +16,10 @@ import org.springframework.context.annotation.ImportResource;
@ImportResource
(
locations
=
{
"classpath:config/spring-config.xml"
})
public
class
ManagerApplication
extends
BaseWebApplication
{
@Bean
/*
@Bean
public ICacheService cacheService() {
return new LocalCacheServiceImpl();
}
}
*/
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ManagerApplication
.
class
,
args
);
...
...
device-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
View file @
0f289e4a
...
...
@@ -138,10 +138,7 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
public
String
index
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
JSONObject
ret
=
new
JSONObject
();
IUser
user
=
this
.
getCurUser
();
log
.
info
(
"user is null:{}"
,
user
==
null
);
if
(
user
==
null
)
{
return
""
;
// user = super.getCurUser();
// if (user == null) {
...
...
@@ -149,16 +146,12 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
// }
}
Set
<
String
>
urls
=
resourceService
.
findUrlSetByUserId
(
user
.
getId
());
log
.
info
(
"urls:{}"
,
JSON
.
toJSONString
(
urls
));
List
<
MenuEntity
>
outlookBarList
=
menuService
.
findTreeMenu
(
user
,
urls
);
log
.
info
(
"outlookBarList:{}"
,
JSON
.
toJSONString
(
outlookBarList
));
String
currUserName
=
user
.
getRealName
();
if
(
currUserName
==
null
||
currUserName
.
trim
().
length
()
==
0
)
{
currUserName
=
"管理员"
;
}
log
.
info
(
"saveCurrUser11111111"
);
this
.
saveCurrUser
(
request
,
response
,
user
,
604800
);
log
.
info
(
"saveCurrUser"
);
this
.
saveCurrUser
(
request
,
response
,
user
);
JSONObject
data
=
new
JSONObject
();
data
.
put
(
"currUserName"
,
currUserName
);
data
.
put
(
"barList"
,
outlookBarList
);
...
...
@@ -170,7 +163,6 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_MSG
,
"用户登录系统成功!"
);
ret
.
put
(
"resources"
,
urls
);
log
.
info
(
"resp:{}"
,
ret
.
toJSONString
());
return
ret
.
toJSONString
();
}
...
...
@@ -310,8 +302,6 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
@Override
protected
void
saveCurrUser
(
HttpServletRequest
request
,
HttpServletResponse
response
,
IUser
user
,
int
maxAge
)
{
String
securityKey
=
GlobalSysInfo
.
getPropertyValue
(
SysConstains
.
PROP_COOKIE_SECURITY_KEY
);
log
.
info
(
"securityKey:"
+
securityKey
);
String
cookieDomain
=
GlobalSysInfo
.
getPropertyValue
(
SysConstains
.
PROP_COOKIE_DOMAIN
);
String
currDoman
=
request
.
getServerName
();
CookieInfo
cookie
=
setLoginCookie
(
response
,
user
,
securityKey
,
currDoman
,
maxAge
);
...
...
device-manager/src/main/java/com/mortals/xhx/base/system/menu/service/impl/MenuServiceImpl.java
View file @
0f289e4a
...
...
@@ -58,7 +58,6 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
Set
<
Long
>
authIds
=
new
HashSet
<>();
Map
<
Long
,
MenuEntity
>
menuMap
=
new
HashMap
<>();
List
<
MenuEntity
>
userModuleList
=
this
.
findAllEnable
();
log
.
info
(
"userModuleList:{}"
,
JSON
.
toJSONString
(
userModuleList
));
for
(
MenuEntity
sysModule
:
userModuleList
)
{
if
(
sysModule
==
null
)
{
continue
;
...
...
@@ -68,16 +67,13 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
authIds
.
add
(
sysModule
.
getId
());
}
}
log
.
info
(
"authIds:{}"
,
JSON
.
toJSONString
(
authIds
));
if
(!
user
.
isAdmin
())
{
Long
[]
ids
=
authIds
.
toArray
(
new
Long
[
authIds
.
size
()]);
for
(
Long
id
:
ids
)
{
MenuEntity
menu
=
menuMap
.
get
(
id
);
log
.
info
(
"id:{} to menu:{}"
,
id
,
JSON
.
toJSONString
(
menu
));
while
(
menu
!=
null
)
{
authIds
.
add
(
menu
.
getId
());
menu
=
menuMap
.
get
(
menu
.
getParentId
());
log
.
info
(
" menu:{}"
,
JSON
.
toJSONString
(
menu
));
}
}
}
...
...
pom.xml
View file @
0f289e4a
...
...
@@ -79,7 +79,7 @@
<profiles.redis.uri>
192.168.0.26
</profiles.redis.uri>
<profiles.redis.port>
6379
</profiles.redis.port>
<profiles.redis.username></profiles.redis.username>
<profiles.redis.password></profiles.redis.password>
<profiles.redis.password>
gheirred
</profiles.redis.password>
<profiles.redis.database>
2
</profiles.redis.database>
<profiles.filepath>
/mortals/data
</profiles.filepath>
<profiles.log.level>
INFO
</profiles.log.level>
...
...
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