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
提交
8af5288d
提交
8af5288d
编写于
12月 07, 2021
作者:
zhehao.chen
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release' into 'master'
Release See merge request
!85
上级
a53d1252
a7c1bf89
流水线
#42767
已取消 于阶段
变更
4
流水线
2
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
45 行增加
和
10 行删除
+45
-10
LoginController.java
...ud/account/account/server/controller/LoginController.java
+14
-8
AccountInfoEntity.java
...loud/account/account/server/entity/AccountInfoEntity.java
+10
-0
RegisterServiceImpl.java
...ount/account/server/service/impl/RegisterServiceImpl.java
+15
-2
AccountInfoEntityMapper.xml
...er/src/main/resources/mybatis/AccountInfoEntityMapper.xml
+6
-0
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginController.java
浏览文件 @
8af5288d
...
...
@@ -26,6 +26,7 @@ import com.pica.cloud.foundation.redis.CacheClient;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.service.starter.interceptor.EnabledLoginValidate
;
import
com.pica.cloud.foundation.utils.annotation.LoginPermission
;
import
com.pica.cloud.foundation.utils.utils.StringUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.catalina.servlet4preview.http.HttpServletRequest
;
...
...
@@ -249,15 +250,20 @@ public class LoginController extends AccountBaseController {
if
(
StringUtils
.
isNotEmpty
(
token
))
{
Long
doctorId
=
super
.
getDoctorIdByToken
();
Doctor
doctorInfo
=
doctorService
.
getDoctorInfo
(
doctorId
.
intValue
());
Integer
acctId
=
doctorInfo
.
getAcctId
();
redisClient
.
deleteToken
(
token
);
Map
<
String
,
Object
>
headersMap
=
super
.
getHeaders
();
String
newToken
=
tokenService
.
getToken
(
headersMap
);
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
super
.
getProductType
(),
super
.
getSourceType
(),
AccountTypeEnum
.
LOGIN_OUT
.
getCode
(),
super
.
getIpAddr
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
(),
newToken
,
0
,
super
.
getUserTokenTourist
());
picaLogUtils
.
info
(
entity
);
return
PicaResponse
.
toResponse
(
newToken
);
if
(
StringUtil
.
isNotNull
(
doctorInfo
))
{
Integer
acctId
=
doctorInfo
.
getAcctId
();
redisClient
.
deleteToken
(
token
);
String
newToken
=
tokenService
.
getToken
(
headersMap
);
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
super
.
getProductType
(),
super
.
getSourceType
(),
AccountTypeEnum
.
LOGIN_OUT
.
getCode
(),
super
.
getIpAddr
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
(),
newToken
,
0
,
super
.
getUserTokenTourist
());
picaLogUtils
.
info
(
entity
);
return
PicaResponse
.
toResponse
(
newToken
);
}
else
{
String
newToken
=
tokenService
.
getToken
(
headersMap
);
return
PicaResponse
.
toResponse
(
newToken
);
}
}
else
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_LOGIN_AGAIN
);
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/entity/AccountInfoEntity.java
浏览文件 @
8af5288d
...
...
@@ -25,6 +25,8 @@ public class AccountInfoEntity {
private
Date
regTime
;
private
String
regVersion
;
private
Integer
deleteFlag
;
private
Integer
createdId
;
...
...
@@ -35,6 +37,14 @@ public class AccountInfoEntity {
private
Date
modifiedTime
;
public
String
getRegVersion
()
{
return
regVersion
;
}
public
void
setRegVersion
(
String
regVersion
)
{
this
.
regVersion
=
regVersion
;
}
public
Integer
getId
()
{
return
id
;
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/RegisterServiceImpl.java
浏览文件 @
8af5288d
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.common.req.OCINRequest
;
import
com.pica.cloud.account.account.server.constants.Constants
;
import
com.pica.cloud.account.account.server.entity.*
;
...
...
@@ -9,7 +10,10 @@ import com.pica.cloud.account.account.server.enums.AccountTypeEnum;
import
com.pica.cloud.account.account.server.exception.AccountException
;
import
com.pica.cloud.account.account.server.log.AccountLogEntityUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.mapper.*
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.mapper.AgreementLogEntityMapper
;
import
com.pica.cloud.account.account.server.mapper.PUserRoleMapper
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.RegisterService
;
import
com.pica.cloud.account.account.server.util.*
;
...
...
@@ -17,12 +21,12 @@ import com.pica.cloud.foundation.completeness.client.utils.IntactUtils;
import
com.pica.cloud.foundation.encryption.common.constants.EncryptConstants
;
import
com.pica.cloud.foundation.encryption.util.EncryptUtils
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.utils.utils.RequestUtils
;
import
com.pica.cloud.foundation.utils.utils.StringUtil
;
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.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -119,6 +123,15 @@ public class RegisterServiceImpl implements RegisterService {
accountInfo
.
setSex
(
0
);
accountInfo
.
setRegisterProduct
(
productType
);
accountInfo
.
setRegisterSource
(
sourceType
);
/*注册app版本*/
try
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
RequestUtils
.
getRequest
().
getHeader
(
"deviceInfo"
));
accountInfo
.
setRegVersion
(
jsonObject
.
getString
(
"app_version"
));
}
catch
(
Exception
ex
)
{
logger
.
error
(
"从header中获取app版本异常"
,
ex
);
}
accountInfoDetailMapper
.
insertSelective
(
accountInfo
);
Integer
acctId
=
accountInfo
.
getId
();
accountInfoDetailMapper
.
updateCreateInfo
(
acctId
);
...
...
server/src/main/resources/mybatis/AccountInfoEntityMapper.xml
浏览文件 @
8af5288d
...
...
@@ -144,6 +144,9 @@
<if
test=
"regTime != null"
>
reg_time,
</if>
<if
test=
"regVersion != null"
>
reg_version,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
...
...
@@ -194,6 +197,9 @@
<if
test=
"regTime != null"
>
#{regTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"regVersion != null"
>
#{regVersion,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=INTEGER},
</if>
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录