Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-account
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.account
pica-cloud-account
提交
40a90698
提交
40a90698
编写于
8月 18, 2020
作者:
peijun.zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add 静默注册亚测接口v3
上级
23fc344d
流水线
#29111
已失败 于阶段
in 0 second
变更
1
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
25 行增加
和
17 行删除
+25
-17
AccountController.java
.../account/account/server/controller/AccountController.java
+25
-17
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountController.java
浏览文件 @
40a90698
...
...
@@ -34,6 +34,8 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
...
...
@@ -63,6 +65,10 @@ public class AccountController extends AccountBaseController {
@Autowired
private
IntactUtil
intactUtil
;
@Autowired
@Qualifier
(
"accountThreadPool"
)
private
ThreadPoolTaskExecutor
threadPoolTaskExecutor
;
@GetMapping
(
"/test"
)
public
String
test
()
{
return
"{\"status\":\"UP\"}"
;
...
...
@@ -438,16 +444,16 @@ public class AccountController extends AccountBaseController {
// 登录
PicaResponse
response
=
null
;
try
{
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
//
this.checkMobilePhone(req.getMobilePhone());
// logger.info("login:{}", JSONObject.toJSONString(req));
//接入新旭事务一致性
// String batchNo1 = IntactUtils.getUUID();
// intactUtil.sendIntact(batchNo1,"login",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1,"req:"+ JSON.toJSONString(req));
Account
account1
=
accountService
.
getByMobilePhone
(
req
.
getMobilePhone
());
//获取账号信息
if
(
account1
==
null
)
{
//
Account account1 = accountService.getByMobilePhone(req.getMobilePhone()); //获取账号信息
// if (account
== null) {
// intactUtil.sendIntact(batchNo1,"login",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"未注册,请验证码登录");
return
PicaResponse
.
toResponse
(
null
,
PicaResultCode
.
RESULE_DATA_NONE
.
code
(),
"未注册,请验证码登录"
);
}
//
return PicaResponse.toResponse(null, PicaResultCode.RESULE_DATA_NONE.code(), "未注册,请验证码登录");
//
}
if
(
StringUtils
.
isBlank
(
req
.
getPassword
()))
{
//验证码登录
...
...
@@ -460,26 +466,28 @@ public class AccountController extends AccountBaseController {
String
authCodeKey
=
this
.
getAuthCodeKey
(
req
.
getMobilePhone
(),
flag
);
redisClient
.
del
(
authCodeKey
);
//清除验证码
}
else
{
//密码登录
if
(!
StringUtils
.
equals
(
req
.
getPassword
(),
account
1
.
getPassword
()))
{
if
(!
StringUtils
.
equals
(
req
.
getPassword
(),
account
.
getPassword
()))
{
// intactUtil.sendIntact(batchNo1,"login",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"请输入正确的密码");
return
PicaResponse
.
toResponse
(
null
,
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"请输入正确的密码"
);
}
}
//更新最后登录时间
Account
update
=
new
Account
();
update
.
setId
(
account1
.
getId
());
update
.
setLastLoginTime
(
new
Date
());
if
(
StringUtils
.
isBlank
(
account1
.
getUnionid
())
&&
StringUtils
.
isNotBlank
(
req
.
getUnionid
()))
{
update
.
setUnionid
(
req
.
getUnionid
());
//绑定微信unionid
update
.
setModifyId
(
account1
.
getId
());
update
.
setModifyTime
(
new
Date
());
}
accountService
.
updateAccountById
(
update
);
threadPoolTaskExecutor
.
execute
(()
->
{
//更新最后登录时间
Account
update
=
new
Account
();
update
.
setId
(
account
.
getId
());
update
.
setLastLoginTime
(
new
Date
());
if
(
StringUtils
.
isBlank
(
account
.
getUnionid
())
&&
StringUtils
.
isNotBlank
(
req
.
getUnionid
()))
{
update
.
setUnionid
(
req
.
getUnionid
());
//绑定微信unionid
update
.
setModifyId
(
account
.
getId
());
update
.
setModifyTime
(
new
Date
());
}
accountService
.
updateAccountById
(
update
);
});
//登录成功,清除旧token,生成新token
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
String
newToken
=
this
.
generateTokenWebLive
(
account
1
,
deviceType
);
String
newToken
=
this
.
generateTokenWebLive
(
account
,
deviceType
);
// intactUtil.sendIntact(batchNo1,"login",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"req:"+ JSON.toJSONString(req));
response
=
PicaResponse
.
toResponse
(
newToken
);
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录