Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
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
周健威
rs-cloud-platform
Commits
370e621f
Commit
370e621f
authored
Dec 02, 2020
by
unset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息修改
parent
51ff787d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
106 deletions
+2
-106
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+1
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+1
-105
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
370e621f
...
...
@@ -31,7 +31,7 @@ import java.util.Map;
* @author keliii
*/
@RestController
@RequestMapping
(
"
api/app
"
)
@RequestMapping
(
"
/app/unauth
"
)
public
class
AppUserRest
{
@Autowired
private
AppPermissionService
appPermissionService
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
370e621f
...
...
@@ -247,9 +247,6 @@ public class AppPermissionService {
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
password
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
// if (StringUtils.isNotBlank(username)){
// return JsonResultUtil.createFailedResult(ResultCode.FAILED_CODE, "服务升级中,暂不支持注册");
// }
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
...
...
@@ -260,9 +257,6 @@ public class AppPermissionService {
}
}
}
/*if (checkErrorNum(username)){
return JsonResultUtil.createFailedResult(ResultCode.FAILED_CODE, "验证码超过错误次数");
}*/
String
redisLockKey
=
RedisKey
.
CONSTANT_CODE_PREFIX
+
username
+
mobilecode
;
String
mobilecodeRedis
=
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
)
==
null
?
""
:
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
).
toString
();
log
.
info
(
"注册接口,获取redis中的验证码:"
+
mobilecodeRedis
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
...
...
@@ -311,59 +305,12 @@ public class AppPermissionService {
rsUserDetail
.
setIsdel
(
0
);
rsUserDetail
.
setCrtHost
(
getIp
());
//setCreateIPInfo(rsUserDetail);
log
.
info
(
"注册:解析地址后: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
//邀请人id关系绑定
Integer
parentId
=
0
;
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
code
=
codes
[
0
];
activityCode
=
codes
[
1
];
}
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
}
if
(
parentId
!=
null
&&
parentId
>
0
){
rsUserDetail
.
setSource
(
1
);
relationBiz
.
bindRelation
(
userid
,
parentId
,
1
);
if
(
StringUtils
.
isNotBlank
(
activityCode
)){
rsUserDetail
.
setInviterAccount
(
parentId
);
}
}
//生成邀请码 长度改为8 不然重复率太高
rsUserDetail
.
setCode
(
ReferralCodeUtil
.
encode
(
userid
));
log
.
info
(
"register------username====="
+
username
+
"----channel===="
+
channel
);
channel
=-
1
;
rsUserDetail
.
setChannel
(
channel
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
info
(
"注册:新增用户详情: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
/* //绑定上下线关系
if(parentId!=null&&parentId>0){
relationBiz.bindRelation(userid,parentId,1);
}*/
//临时会员绑定
insertUserMemberByUserIdAndPhone
(
userid
,
username
);
log
.
info
(
"注册:临时会员绑定: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
log
.
info
(
"注册:参加新人活动: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
//创建钱包
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
log
.
info
(
"注册:创建钱包: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
,
activityCode
,
1
);
log
.
info
(
"注册:登录结果要做做统一处理: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
if
(
data
!=
null
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
userid
);
jsonObject
.
put
(
"integralRuleCode"
,
"REGISTER"
);
log
.
info
(
"注册成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}"
,
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitConstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitConstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
sendQueue
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_NEW
);
log
.
info
(
"注册:发消息队列: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
else
{
return
JsonResultUtil
.
createDefaultFail
();
...
...
@@ -450,13 +397,6 @@ public class AppPermissionService {
data
.
put
(
"headerurl"
,
userVo
.
getHeadimgurl
());
}
data
.
put
(
"certificationStatus"
,
userVo
.
getCertificationStatus
());
// 缓存操作
String
token
=
""
;
String
imtoken_
=
""
;
//userRedisTemplate.opsForValue().set("token_" + userid,token, SystemConfig.REDISTOKENTIME, TimeUnit.SECONDS);
//userRedisTemplate.opsForValue().set("imtoken_" + userid,imtoken_,SystemConfig.REDISTOKENTIME, TimeUnit.SECONDS);
// 返回结果
// data.put("token", token);
data
.
put
(
"username"
,
StringUtils
.
isNotEmpty
(
username
)
?
username
:
userVo
.
getUsername
());
data
.
put
(
"userId"
,
userid
);
data
.
put
(
"imUserId"
,
userVo
.
getImUserid
());
...
...
@@ -465,36 +405,7 @@ public class AppPermissionService {
//更新登录时间 和 ip
String
clientIp
=
getIp
();
appUserLoginBiz
.
updateLoginInfo
(
userid
,
clientIp
);
log
.
info
(
"-----------autoLogin----type==="
+
type
);
if
(
type
!=
null
&&
type
==
1
){
try
{
Integer
parentId
=
0
;
//屏蔽app登录的绑定关系
/*if (StringUtils.isNotBlank(code)) {
parentId = appUserDetailBiz.getUserByCode(code);
}
//绑定上下线关系
if (parentId != null && parentId > 0) {
relationBiz.bindRelation(userid, parentId, 1);
}*/
//活动消息
Integer
state
=
userVo
.
getState
();
log
.
info
(
"-----------autoLogin----state==="
+
state
);
if
(
state
!=
null
&&
state
==
1
){
if
(
userVo
.
getInviterAccount
()==
null
||
userVo
.
getInviterAccount
()==
0
){
userVo
.
setInviterAccount
(
parentId
);
}
userVo
.
setState
(
2
);
appUserDetailBiz
.
updUuserInfoById
(
userVo
);
sendQueue
(
username
,
null
,
headimgurl
,
nickname
,
null
,
null
,
null
,
null
,
code
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_ACTIVATE
);
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
}
}
return
data
;
}
...
...
@@ -781,23 +692,8 @@ public class AppPermissionService {
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
String
activityCode
=
null
;
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
code
=
codes
[
0
];
activityCode
=
codes
[
1
];
}
}
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
code
,
activityCode
,
1
);
/*// 到im注册,获取返回结果
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
if(StringUtils.isNotBlank(imPassword)&&imUserId!=null&&imUserId>0){
String access_token=loginIm(username,imPassword,imUserId);
data.put("imToken",access_token);
data.put("imUserId",imUserId);
}*/
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
...
...
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