Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zczlService
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曹崟
zczlService
Commits
01b69e69
Commit
01b69e69
authored
Nov 30, 2023
by
zhangzhijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通辽侦查指令单点登录问题修复
parent
010dc78e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
5 deletions
+51
-5
pom.xml
+16
-3
src/main/java/com/founder/login/controller/LoginController.java
+2
-1
src/main/java/com/founder/login/dao/LoginDao.java
+4
-0
src/main/java/com/founder/login/service/ILoginService.java
+2
-0
src/main/java/com/founder/login/service/impl/LoginService.java
+18
-0
src/main/resources/mapper/LoginMapper.xml
+9
-1
No files found.
pom.xml
View file @
01b69e69
...
...
@@ -29,7 +29,17 @@
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
<version>
1.4.0.BUILD-SNAPSHOT
</version>
<exclusions>
<exclusion>
<groupId>
io.lettuce
</groupId>
<artifactId>
lettuce-core
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 添加jedis客户端 -->
<dependency>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -85,9 +95,12 @@
<!-- 数据库驱动包-->
<dependency>
<groupId>
org
.oracle
</groupId>
<groupId>
com
.oracle
</groupId>
<artifactId>
ojdbc6
</artifactId>
<version>
10
</version>
<version>
11.2.0.3
</version>
<!-- <groupId>org.oracle</groupId>-->
<!-- <artifactId>ojdbc6</artifactId>-->
<!-- <version>10</version>-->
</dependency>
<!-- alibaba的druid数据库连接池 -->
<dependency>
...
...
src/main/java/com/founder/login/controller/LoginController.java
View file @
01b69e69
...
...
@@ -101,7 +101,8 @@ public class LoginController {
if
(
user
!=
null
){
request
.
getSession
().
setAttribute
(
"user"
,
user
);
//登录成功生成session
//设置权限
String
perurl
=
loginQx
(
user
,
response
,
qxUrl
+
"/xzxt_shiro/access/xzxtlogin"
);;
//String perurl = loginQx(user,response,qxUrl+"/xzxt_shiro/access/xzxtlogin");;
String
perurl
=
loginService
.
getUserPermission
(
user
.
getId
());
if
(
user
.
getUsername
().
equals
(
"admin"
))
{
request
.
getSession
().
setAttribute
(
"perurl"
,
"admin"
);
//权限url 放入session中
...
...
src/main/java/com/founder/login/dao/LoginDao.java
View file @
01b69e69
...
...
@@ -4,6 +4,8 @@ import com.founder.model.User;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* Created by Founder on 2018/9/3.
*/
...
...
@@ -11,4 +13,6 @@ import org.springframework.stereotype.Component;
@Mapper
public
interface
LoginDao
{
User
getUserByUser
(
User
user
);
List
<
String
>
getUserPermission
(
String
userId
);
}
src/main/java/com/founder/login/service/ILoginService.java
View file @
01b69e69
...
...
@@ -7,4 +7,6 @@ import com.founder.model.User;
*/
public
interface
ILoginService
{
User
getUserByUser
(
User
user
);
String
getUserPermission
(
String
id
);
}
src/main/java/com/founder/login/service/impl/LoginService.java
View file @
01b69e69
...
...
@@ -6,6 +6,8 @@ import com.founder.model.User;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* Created by Founder on 2018/9/3.
*/
...
...
@@ -21,4 +23,20 @@ public class LoginService implements ILoginService{
u
=
loginDao
.
getUserByUser
(
user
);
return
u
;
}
@Override
public
String
getUserPermission
(
String
userId
)
{
String
perurl
=
""
;
System
.
out
.
println
(
userId
);
List
<
String
>
permissions
=
loginDao
.
getUserPermission
(
userId
);
if
(
permissions
==
null
&&
permissions
.
size
()
>
0
)
{
StringBuilder
builder
=
new
StringBuilder
();
for
(
String
permission
:
permissions
)
{
builder
.
append
(
permission
).
append
(
","
);
}
perurl
=
builder
.
toString
();
}
//perurl = "A010101,A010102";
return
perurl
;
}
}
src/main/resources/mapper/LoginMapper.xml
View file @
01b69e69
...
...
@@ -13,11 +13,18 @@
UNITNAME unitname,
PASSWORD password,
POLICEMANID policemanid
from
sys_user
where SCBZ='0' and OPEN_FLAG='1'
from
SYS_USER
where SCBZ='0' and OPEN_FLAG='1'
<if
test=
"policemanid!=null and policemanid!=''"
>
and POLICEMANID=#{policemanid, jdbcType=VARCHAR}
</if>
<if
test=
"username!=null and username!=''"
>
and username=#{username, jdbcType=VARCHAR}
</if>
<if
test=
"unitcode!=null and unitcode!=''"
>
and UNITCODE=#{unitcode, jdbcType=VARCHAR}
</if>
</select>
<select
id=
"getUserPermission"
resultType=
"java.lang.String"
>
select b.PERMISSIONID
from SYS_USER_ROLE a
join SYS_ROLE_PERMISSION b on a.ROLE_ID = b.ROLEID
where a.USER_ID = #{userId}
</select>
</mapper>
\ No newline at end of file
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