Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
吴迪
gs1-office-web-sit
Commits
652f611a
Commit
652f611a
authored
Dec 28, 2021
by
唐功亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】 手机用户登录token判断
parent
37de9b36
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
26 additions
and
15 deletions
+26
-15
MemberController.java
...io/office/modules/manage/controller/MemberController.java
+1
-1
TycpdmFirmController.java
...ffice/modules/manage/controller/TycpdmFirmController.java
+7
-3
MemberDao.java
src/main/java/io/office/modules/manage/dao/MemberDao.java
+1
-1
MemberEntity.java
...in/java/io/office/modules/manage/entity/MemberEntity.java
+1
-1
TycpdmFirmService.java
...a/io/office/modules/manage/service/TycpdmFirmService.java
+1
-1
LogLoginServiceImpl.java
...fice/modules/manage/service/impl/LogLoginServiceImpl.java
+4
-2
MemberServiceImpl.java
...office/modules/manage/service/impl/MemberServiceImpl.java
+1
-1
TimescodeFindpsServiceImpl.java
...dules/manage/service/impl/TimescodeFindpsServiceImpl.java
+2
-2
TycpdmFirmServiceImpl.java
...ce/modules/manage/service/impl/TycpdmFirmServiceImpl.java
+2
-2
AbstractController.java
.../io/office/modules/sys/controller/AbstractController.java
+1
-1
OAuth2Realm.java
src/main/java/io/office/modules/sys/oauth2/OAuth2Realm.java
+5
-0
No files found.
src/main/java/io/office/modules/manage/controller/MemberController.java
View file @
652f611a
...
...
@@ -90,7 +90,7 @@ public class MemberController extends AbstractController {
@RequestMapping
(
"/authApi/info"
)
// @RequiresPermissions("manage:member:info")
public
R
info
(){
Integer
memberUserId
=
getMemberUserId
();
Long
memberUserId
=
getMemberUserId
();
MemberEntity
member
=
memberService
.
getById
(
memberUserId
);
return
R
.
ok
().
put
(
"data"
,
member
);
...
...
src/main/java/io/office/modules/manage/controller/TycpdmFirmController.java
View file @
652f611a
...
...
@@ -238,7 +238,7 @@ public class TycpdmFirmController extends AbstractController {
// @RequiresPermissions("manage:tycpdmfirm:delete")
public
R
audit
(
@RequestBody
Map
map
){
MemberEntity
memberUser
=
getMemberUser
();
Integer
memberUserId
=
getMemberUserId
();
Long
memberUserId
=
getMemberUserId
();
try
{
tycpdmFirmService
.
audit
(
map
,
memberUserId
,
memberUser
.
getUsername
());
}
catch
(
InvocationTargetException
e
)
{
...
...
@@ -289,7 +289,7 @@ public class TycpdmFirmController extends AbstractController {
Object
id
=
params
.
get
(
"id"
);
MemberEntity
memberEntity
=
null
;
if
(
id
!=
null
){
memberEntity
=
memberDao
.
selectById
(
id
.
toString
(
));
memberEntity
=
memberDao
.
selectById
(
Long
.
valueOf
(
id
+
""
));
}
String
url
=
tycpdmFirmService
.
redirectGDSURL
(
memberEntity
,
params
);
try
{
...
...
@@ -327,7 +327,11 @@ public class TycpdmFirmController extends AbstractController {
public
R
redirectBusinessHall
(
@RequestBody
Map
<
String
,
Object
>
params
){
//由于member表中没有手机用户的信息 通过memberDao获取
Object
id
=
params
.
get
(
"id"
);
MemberEntity
memberEntity
=
memberDao
.
selectById
(
id
.
toString
());
/*MemberEntity memberEntity = memberDao.selectById(Long.valueOf(id.toString()));
if (memberEntity==null){
memberEntity=new MemberEntity();
}*/
MemberEntity
memberEntity
=
getMemberUser
();
String
url
=
tycpdmFirmService
.
redirectBusinessHall
(
params
,
memberEntity
);
try
{
//response.sendRedirect(url);
...
...
src/main/java/io/office/modules/manage/dao/MemberDao.java
View file @
652f611a
...
...
@@ -31,7 +31,7 @@ public interface MemberDao extends BaseMapper<MemberEntity> {
MemberEntity
selectByName
(
@Param
(
"userName"
)
String
userName
);
@Update
(
"UPDATE member SET pass = #{passWord} WHERE id = #{id}"
)
void
updateByIdPassWord
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"passWord"
)
String
passWord
);
void
updateByIdPassWord
(
@Param
(
"id"
)
Long
id
,
@Param
(
"passWord"
)
String
passWord
);
@Select
(
"select b.code_agen as code_agen from member a left join MemAgent b on a.username=b.user_id where a.username=#{userName}"
)
Integer
selectCode_agen
(
@Param
(
"userName"
)
String
userName
);
...
...
src/main/java/io/office/modules/manage/entity/MemberEntity.java
View file @
652f611a
...
...
@@ -23,7 +23,7 @@ public class MemberEntity implements Serializable {
* $column.comments
*/
@TableId
private
Integer
id
;
private
Long
id
;
/**
* $column.comments
*/
...
...
src/main/java/io/office/modules/manage/service/TycpdmFirmService.java
View file @
652f611a
...
...
@@ -39,7 +39,7 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
Page
<
TycpdmFirmEntity
>
findlist
(
Map
<
String
,
Object
>
params
,
Page
page
);
void
audit
(
Map
map
,
Integer
memberUserId
,
String
username
)
throws
InvocationTargetException
,
IllegalAccessException
;
void
audit
(
Map
map
,
Long
memberUserId
,
String
username
)
throws
InvocationTargetException
,
IllegalAccessException
;
int
findLogoutFlag
(
String
userName
);
...
...
src/main/java/io/office/modules/manage/service/impl/LogLoginServiceImpl.java
View file @
652f611a
...
...
@@ -74,7 +74,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
Integer
isQY
=
2
;
//是否开通企业认证 1.开通 2.未开通
Integer
isXT
=
2
;
//是否是业务大厅系统成员 1.是 2.否
Integer
id
=-
99
;
//用户ID
Long
id
=-
99L
;
//用户ID
String
search
=
"ws2"
;
// 用户来源 manager:业务大厅手机号用户 ws2:member表用户
String
carno
=
null
;
// 条码卡号
String
phone
=
null
;
//手机号码
...
...
@@ -82,6 +82,8 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
if
(
matchPhoneNumber
(
userName
)){
//用第三方登录接口
userType
=
1
;
System
.
out
.
println
(
"用户名称:"
+
userName
);
id
=
Long
.
valueOf
(
userName
);
//对 用户名密码进行DES加密
String
phoen_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
userName
.
getBytes
(),
DESUtils
.
Key
.
getBytes
()));
String
passwrod_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
passWord
.
getBytes
(),
DESUtils
.
Key
.
getBytes
()));
...
...
@@ -112,7 +114,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
if
(
memberEntity
==
null
){
throw
new
RRException
(
"用户不存在!"
);
}
id
=
memberEntity
.
getId
(
);
id
=
Long
.
valueOf
(
memberEntity
.
getId
()
);
//用户类型 www:为官网用户 条码卡:为条码卡用户
String
source
=
memberEntity
.
getSource
();
String
applystate
=
memberEntity
.
getApplystate
();
// 未申请:普通用户 通过审核:完成厂商实名认证
...
...
src/main/java/io/office/modules/manage/service/impl/MemberServiceImpl.java
View file @
652f611a
...
...
@@ -169,7 +169,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
throw
new
RRException
(
"旧密码输入错误"
);
}
//修改密码
memberDao
.
updateByIdPassWord
(
Integer
.
valueOf
(
id
),
MD5Util
.
md5Encrypt32Lower
(
newPass
));
memberDao
.
updateByIdPassWord
(
Long
.
valueOf
(
id
),
MD5Util
.
md5Encrypt32Lower
(
newPass
));
}
@Override
...
...
src/main/java/io/office/modules/manage/service/impl/TimescodeFindpsServiceImpl.java
View file @
652f611a
...
...
@@ -68,7 +68,7 @@ public class TimescodeFindpsServiceImpl extends ServiceImpl<TimescodeFindpsDao,
}
MemberEntity
memberEntity
=
memberDao
.
selectByName
(
userName
);
if
(
memberEntity
!=
null
){
Integer
id
=
memberEntity
.
getId
();
Long
id
=
memberEntity
.
getId
();
String
phone_DB
=
memberEntity
.
getPhone
();
if
(
phone
.
equals
(
phone_DB
)){
//获取6位随机字符串
...
...
@@ -161,7 +161,7 @@ public class TimescodeFindpsServiceImpl extends ServiceImpl<TimescodeFindpsDao,
}
MemberEntity
memberEntity
=
memberDao
.
selectByName
(
userName
);
if
(
memberEntity
!=
null
){
Integer
id
=
memberEntity
.
getId
();
Long
id
=
memberEntity
.
getId
();
String
emiail_DB
=
memberEntity
.
getEmail
();
if
(
emiail
.
equals
(
emiail_DB
)){
//获取6位随机字符串
...
...
src/main/java/io/office/modules/manage/service/impl/TycpdmFirmServiceImpl.java
View file @
652f611a
...
...
@@ -232,7 +232,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
@Override
@Transactional
public
void
audit
(
Map
map
,
Integer
memberUserId
,
String
username
)
throws
InvocationTargetException
,
IllegalAccessException
{
public
void
audit
(
Map
map
,
Long
memberUserId
,
String
username
)
throws
InvocationTargetException
,
IllegalAccessException
{
Integer
status
=
map
.
get
(
"status"
)==
null
?
0
:
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"status"
)));
//1.新增(新增时id为fId) 2.变更(id为fId)
String
id
=
map
.
get
(
"id"
)==
null
?
""
:
String
.
valueOf
(
map
.
get
(
"id"
));
//id
String
auditStatus
=
map
.
get
(
"auditStatus"
)==
null
?
""
:
String
.
valueOf
(
map
.
get
(
"auditStatus"
));
//审核状态 1.通过 2.不通过
...
...
@@ -561,7 +561,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
//用户类型 1.业务大厅(手机号用户) 2.业务大厅(条码卡成员) 3.官网用户
Integer
userType
=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"userType"
)));
if
(
userType
==
1
){
phone
=
memberUser
.
get
Username
()
;
//手机号
phone
=
memberUser
.
get
Id
()+
""
;
//手机号
}
else
if
(
userType
==
2
){
//调用另一个接口
phone
=
memberUser
.
getUsername
();
//条码卡号
...
...
src/main/java/io/office/modules/sys/controller/AbstractController.java
View file @
652f611a
...
...
@@ -34,7 +34,7 @@ public abstract class AbstractController {
return
(
MemberEntity
)
SecurityUtils
.
getSubject
().
getPrincipal
();
}
protected
Integer
getMemberUserId
()
{
protected
Long
getMemberUserId
()
{
return
getMemberUser
().
getId
();
}
}
src/main/java/io/office/modules/sys/oauth2/OAuth2Realm.java
View file @
652f611a
...
...
@@ -80,6 +80,11 @@ public class OAuth2Realm extends AuthorizingRealm {
if
(
accessToken
.
startsWith
(
"qianduan_"
))
{
//todo
MemberEntity
memberEntity
=
memberDao
.
selectById
(
tokenEntity
.
getUserId
());
if
(
memberEntity
==
null
){
memberEntity
=
new
MemberEntity
();
Long
userId
=
tokenEntity
.
getUserId
();
memberEntity
.
setId
(
userId
);
}
info
=
new
SimpleAuthenticationInfo
(
memberEntity
,
accessToken
,
getName
());
}
else
{
user
=
shiroService
.
queryUser
(
tokenEntity
.
getUserId
());
...
...
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