Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-miniappserver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a64ac0d5
authored
Jul 01, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
a188cee5
b045058c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
src/main/java/cn/com/glsx/app/modules/ThirdLoginController.java
src/main/java/cn/com/glsx/app/modules/entity/User.java
src/main/java/cn/com/glsx/app/modules/model/AppUser.java
src/main/java/cn/com/glsx/app/modules/service/LoginService.java
src/main/resources/mapper/UserLocalAccountMapper.xml
src/main/resources/mapper/UserMapper.xml
src/main/java/cn/com/glsx/app/modules/ThirdLoginController.java
View file @
a64ac0d
...
@@ -96,8 +96,6 @@ public class ThirdLoginController {
...
@@ -96,8 +96,6 @@ public class ThirdLoginController {
if
(
optUserId
.
isPresent
())
{
if
(
optUserId
.
isPresent
())
{
//已绑定本地账号
//已绑定本地账号
AppUser
user
=
userService
.
getAppUserByUserId
(
authRel
.
getUserId
());
AppUser
user
=
userService
.
getAppUserByUserId
(
authRel
.
getUserId
());
user
.
setUserType
(
MiniUserType
.
NORMAL
.
getType
());
String
token
=
userService
.
createToken
(
user
);
String
token
=
userService
.
createToken
(
user
);
rtnMap
.
put
(
"user"
,
user
);
rtnMap
.
put
(
"user"
,
user
);
rtnMap
.
put
(
"token"
,
token
);
rtnMap
.
put
(
"token"
,
token
);
...
...
src/main/java/cn/com/glsx/app/modules/entity/User.java
View file @
a64ac0d
...
@@ -30,8 +30,8 @@ public class User extends BaseEntity {
...
@@ -30,8 +30,8 @@ public class User extends BaseEntity {
/**
/**
* 关联人(账户)id
* 关联人(账户)id
*/
*/
@Column
(
name
=
"
link
er_id"
)
@Column
(
name
=
"
rel_us
er_id"
)
private
Long
link
erId
;
private
Long
relUs
erId
;
/**
/**
* 状态:0白名单,临时封禁(blacklist>0,值为封禁天数),永久封禁(del_flag=-1)
* 状态:0白名单,临时封禁(blacklist>0,值为封禁天数),永久封禁(del_flag=-1)
...
...
src/main/java/cn/com/glsx/app/modules/model/AppUser.java
View file @
a64ac0d
package
cn
.
com
.
glsx
.
app
.
modules
.
model
;
package
cn
.
com
.
glsx
.
app
.
modules
.
model
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
...
@@ -16,6 +17,8 @@ public class AppUser {
...
@@ -16,6 +17,8 @@ public class AppUser {
* 用户类型:normal常规用户,shared被分享用户,见枚举MiniUserType
* 用户类型:normal常规用户,shared被分享用户,见枚举MiniUserType
*/
*/
private
String
userType
;
private
String
userType
;
@JsonIgnore
private
Integer
blacklist
;
private
Integer
blacklist
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/app/modules/service/LoginService.java
View file @
a64ac0d
...
@@ -69,9 +69,7 @@ public class LoginService {
...
@@ -69,9 +69,7 @@ public class LoginService {
User
user
=
register
(
simpleUser
);
User
user
=
register
(
simpleUser
);
//返给前端的用户信息
//返给前端的用户信息
AppUser
appUser
=
UserConverter
.
INSTANCE
.
su2au
(
simpleUser
);
return
UserConverter
.
INSTANCE
.
su2au
(
simpleUser
);
appUser
.
setUserType
(
MiniUserType
.
NORMAL
.
getType
());
return
appUser
;
}
else
if
(
loginBO
.
getLoginType
()
==
2
)
{
}
else
if
(
loginBO
.
getLoginType
()
==
2
)
{
//验证码校验
//验证码校验
//smsService.verifyCode(loginBO.getAccount(), loginBO.getCode());
//smsService.verifyCode(loginBO.getAccount(), loginBO.getCode());
...
@@ -120,7 +118,7 @@ public class LoginService {
...
@@ -120,7 +118,7 @@ public class LoginService {
UserAuthRel
userAuthRel
=
userAuthRelMapper
.
selectByAuthTypeAndAuthId
(
AuthType
.
LOCAL
.
getType
(),
localAuth
.
getId
());
UserAuthRel
userAuthRel
=
userAuthRelMapper
.
selectByAuthTypeAndAuthId
(
AuthType
.
LOCAL
.
getType
(),
localAuth
.
getId
());
if
(
userAuthRel
==
null
)
{
if
(
userAuthRel
==
null
)
{
user
=
new
User
();
user
=
new
User
();
user
.
set
Link
erId
(
simpleUser
.
getId
());
user
.
set
RelUs
erId
(
simpleUser
.
getId
());
user
.
setBlacklist
(
simpleUser
.
getBlacklist
());
user
.
setBlacklist
(
simpleUser
.
getBlacklist
());
userMapper
.
saveOrUpdate
(
user
);
userMapper
.
saveOrUpdate
(
user
);
...
...
src/main/resources/mapper/UserLocalAccountMapper.xml
View file @
a64ac0d
...
@@ -33,15 +33,16 @@
...
@@ -33,15 +33,16 @@
</select>
</select>
<select
id=
"selectAppUserByUserId"
resultType=
"cn.com.glsx.app.modules.model.AppUser"
>
<select
id=
"selectAppUserByUserId"
resultType=
"cn.com.glsx.app.modules.model.AppUser"
>
select tcu.
linker_id
as userId,
select tcu.
rel_user_id
as userId,
tcu.id as cuserId,
tcu.id as cuserId,
tcula.
union_id as unionId
,
tcula.
account
,
tcu
.account
,
tcu
la2.username
,
tcula.usernam
e,
'normal' as userTyp
e,
tcu.blacklist
tcu.blacklist
from t_cust_user_local_a
ccount
tcula
from t_cust_user_local_a
uth
tcula
inner join t_cust_user_auth_rel tcuar on tcula.id = tcuar.auth_id
inner join t_cust_user_auth_rel tcuar on tcula.id = tcuar.auth_id
left join t_cust_user tcu on tcu.id = tcuar.user_id
left join t_cust_user_local_account tcula2 on tcuar.auth_id = tcula2.auth_id
left join t_cust_user tcu on tcuar.user_id = tcu.id
where tcula.del_flag = 0
where tcula.del_flag = 0
and tcuar.auth_type = 'local'
and tcuar.auth_type = 'local'
and tcuar.user_id = #{userId} limit 1
and tcuar.user_id = #{userId} limit 1
...
...
src/main/resources/mapper/UserMapper.xml
View file @
a64ac0d
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<result
column=
"token"
jdbcType=
"VARCHAR"
property=
"token"
/>
<result
column=
"token"
jdbcType=
"VARCHAR"
property=
"token"
/>
<result
column=
"expire_in"
jdbcType=
"INTEGER"
property=
"expireIn"
/>
<result
column=
"expire_in"
jdbcType=
"INTEGER"
property=
"expireIn"
/>
<result
column=
"try_times"
jdbcType=
"INTEGER"
property=
"tryTimes"
/>
<result
column=
"try_times"
jdbcType=
"INTEGER"
property=
"tryTimes"
/>
<result
column=
"
linker_id"
jdbcType=
"INTEGER"
property=
"link
erId"
/>
<result
column=
"
rel_user_id"
jdbcType=
"INTEGER"
property=
"relUs
erId"
/>
<result
column=
"blacklist"
jdbcType=
"TINYINT"
property=
"blacklist"
/>
<result
column=
"blacklist"
jdbcType=
"TINYINT"
property=
"blacklist"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
id, token, expire_in, try_times,
link
er_id, blacklist, del_flag, created_date, created_by, updated_date,
id, token, expire_in, try_times,
rel_us
er_id, blacklist, del_flag, created_date, created_by, updated_date,
updated_by
updated_by
</sql>
</sql>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
</select>
</select>
<insert
id=
"saveOrUpdate"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"cn.com.glsx.app.modules.entity.User"
>
<insert
id=
"saveOrUpdate"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"cn.com.glsx.app.modules.entity.User"
>
INSERT INTO t_cust_user (id,
link
er_id, blacklist, del_flag, created_date)
INSERT INTO t_cust_user (id,
rel_us
er_id, blacklist, del_flag, created_date)
VALUES (#{id}, #{linkerId}, #{blacklist}, 0, sysdate()) ON DUPLICATE KEY
VALUES (#{id}, #{linkerId}, #{blacklist}, 0, sysdate()) ON DUPLICATE KEY
UPDATE updated_date = sysdate()
UPDATE updated_date = sysdate()
</insert>
</insert>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment