Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
agent-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
赵啸非
agent-platform
Commits
fc620ef5
Commit
fc620ef5
authored
Apr 29, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加更新默认用户角色
parent
f7fa3bbb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
6 deletions
+34
-6
agent-manager/pom.xml
agent-manager/pom.xml
+8
-0
agent-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
.../xhx/base/framework/interceptor/AuthTokenServiceImpl.java
+5
-5
agent-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
.../java/com/mortals/xhx/base/login/web/LoginController.java
+12
-1
base-manager/pom.xml
base-manager/pom.xml
+9
-0
No files found.
agent-manager/pom.xml
View file @
fc620ef5
...
...
@@ -59,6 +59,14 @@
</properties>
</profile>
<profile>
<id>
youxian
</id>
<properties>
<profiles.active>
youxian
</profiles.active>
<profiles.nacos.server-addr>
127.0.0.1:8848
</profiles.nacos.server-addr>
</properties>
</profile>
</profiles>
<dependencies>
...
...
agent-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
View file @
fc620ef5
...
...
@@ -123,11 +123,11 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
}
//更新resource 路径
String
menuUrlCode
=
cacheService
.
hget
(
RedisKey
.
KEY_USER_MENU_CACHE
,
userEntity
.
getId
().
toString
(),
String
.
class
);
//
if (ObjectUtils.isEmpty(menuUrlCode)) {
//
Set<String> urls = resourceService.findUrlSetByUserId(userEntity.getId());
//
menuUrlCode = MenuEncodeUtil.generateMenuUrlCode(urls);
//
cacheService.hset(RedisKey.KEY_USER_MENU_CACHE, userEntity.getId().toString(), menuUrlCode);
//
}
if
(
ObjectUtils
.
isEmpty
(
menuUrlCode
))
{
Set
<
String
>
urls
=
resourceService
.
findUrlSetByUserId
(
userEntity
.
getId
());
menuUrlCode
=
MenuEncodeUtil
.
generateMenuUrlCode
(
urls
);
cacheService
.
hset
(
RedisKey
.
KEY_USER_MENU_CACHE
,
userEntity
.
getId
().
toString
(),
menuUrlCode
);
}
userEntity
.
setMenuUrl
(
menuUrlCode
);
return
userEntity
;
}
...
...
agent-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
View file @
fc620ef5
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.IUser
;
...
...
@@ -14,6 +15,7 @@ import com.mortals.xhx.base.system.menu.model.MenuEntity;
import
com.mortals.xhx.base.system.menu.service.MenuService
;
import
com.mortals.xhx.base.system.resource.service.ResourceService
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.key.RedisKey
;
import
com.mortals.xhx.common.utils.MenuEncodeUtil
;
...
...
@@ -65,7 +67,16 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
UserEntity
userEntity
=
null
;
try
{
loginForm
.
validate
();
userEntity
=
userService
.
doLogin
(
loginName
,
password
,
ip
);
//userEntity = userService.doLogin(loginName, password, ip);
UserQuery
userQuery
=
new
UserQuery
();
userQuery
.
setLoginName
(
loginName
);
userEntity
=
userService
.
selectOne
(
userQuery
);
if
(
userEntity
==
null
)
{
throw
new
AppException
(
"用户名不存在"
);
}
userEntity
.
setLastLoginAddress
(
ip
);
recordSysLog
(
request
,
userEntity
,
"用户登录系统成功!"
);
...
...
base-manager/pom.xml
View file @
fc620ef5
...
...
@@ -63,6 +63,15 @@
</properties>
</profile>
<profile>
<id>
youxian
</id>
<properties>
<profiles.active>
youxian
</profiles.active>
<profiles.nacos.server-addr>
127.0.0.1:8848
</profiles.nacos.server-addr>
</properties>
</profile>
</profiles>
<dependencies>
...
...
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