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
提交
e2494cfc
提交
e2494cfc
编写于
12月 14, 2020
作者:
Peijun.zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check code
上级
6cb1cca9
流水线
#33411
已失败 于阶段
in 0 second
变更
3
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
42 行删除
+46
-42
LoginV1Controller.java
.../account/account/server/controller/LoginV1Controller.java
+1
-1
AccountExceptionEnum.java
...ud/account/account/server/enums/AccountExceptionEnum.java
+1
-0
LoginV1ServiceImpl.java
...count/account/server/service/impl/LoginV1ServiceImpl.java
+44
-41
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginV1Controller.java
浏览文件 @
e2494cfc
...
...
@@ -71,7 +71,7 @@ public class LoginV1Controller extends AccountBaseController {
return
PicaResponse
.
toResponse
(
oneClickLoginResultVo
);
}
@ApiOperation
(
value
=
"
统一校验(传空则不会校验)
"
)
@ApiOperation
(
value
=
"
手机号统一校验
"
)
@PostMapping
(
"/unifiedVerification"
)
public
PicaResponse
unifiedVerification
(
@RequestBody
AesAuthCodeReq
req
)
throws
Exception
{
EncryptEntity
entity
=
new
EncryptEntity
();
...
...
server/src/main/java/com/pica/cloud/account/account/server/enums/AccountExceptionEnum.java
浏览文件 @
e2494cfc
...
...
@@ -68,6 +68,7 @@ public enum AccountExceptionEnum {
PICA_PASSWORD_RESET
(
"216559"
,
"您尚未设置密码,请退出登录后使用密码方式登录进行密码设置"
),
MOBILE_NOT_REGISTER
(
"216560"
,
"手机号{mobile}尚未注册"
),
PARAMS_BIZ_TYPE_EMPTY
(
"216561"
,
"参数bizType不能为空"
),
xxx_xxx
(
""
,
""
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginV1ServiceImpl.java
浏览文件 @
e2494cfc
...
...
@@ -64,6 +64,9 @@ public class LoginV1ServiceImpl implements LoginV1Service {
@Autowired
private
AccountLogUtils
picaLogUtils
;
@Autowired
private
AccountInfoDetailMapper
accountInfoMapper
;
/**
* 新版一键登录
...
...
@@ -103,55 +106,20 @@ public class LoginV1ServiceImpl implements LoginV1Service {
return
result
;
}
private
LoginResult
processLogin
(
BaseRequest
baseRequest
,
Integer
acctId
,
Integer
loginType
,
QueryMobileEntity
queryMobileEntity
)
{
//接入新旭事务一致性
String
batchNo
=
IntactUtils
.
getUUID
();
intactUtil
.
sendIntact
(
batchNo
,
"processLogin"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"baseRequest:"
+
JSON
.
toJSONString
(
baseRequest
)
+
",+acctId:"
+
acctId
+
",loginType:"
+
loginType
+
",queryMobileEntity:"
+
JSON
.
toJSONString
(
queryMobileEntity
));
Date
currentTime
=
new
Date
();
Long
userId
=
accountUtils
.
getUserIdByAcctId
(
baseRequest
.
getProductType
(),
acctId
);
Account
account
=
new
Account
();
account
.
setId
(
userId
);
account
.
setAcctId
(
acctId
);
account
.
setCreatTime
(
currentTime
);
account
.
setMobilePhone
(
baseRequest
.
getMobile
());
account
.
setRegisterSource
(
baseRequest
.
getSourceType
());
String
newToken
=
tokenUtils
.
generateToken
(
account
);
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
newToken
);
result
.
setUserId
(
userId
);
result
.
setMobile
(
baseRequest
.
getMobile
());
result
.
setDoctorId
(
EncryptUtils
.
encryptContent
(
userId
+
""
,
EncryptConstants
.
ENCRYPT_TYPE_ID
));
//是否完善过个人信息(云鹊医app才需要)
if
(
baseRequest
.
getProductType
()
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
Doctor
doctorEntity
=
doctorInfoMapper
.
selectByPrimaryKey
(
userId
.
intValue
());
result
.
setEntireFlag
(
doctorEntity
.
getEntireFlag
());
}
//记录登录日志
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
baseRequest
.
getProductType
(),
baseRequest
.
getSourceType
(),
loginType
,
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
(),
newToken
,
1
,
baseRequest
.
getUserTokenTourist
());
if
(
queryMobileEntity
!=
null
)
{
entity
.
setQueryMobileEntity
(
queryMobileEntity
);
}
picaLogUtils
.
info
(
entity
);
intactUtil
.
sendIntact
(
batchNo
,
"processLogin"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"baseRequest:"
+
JSON
.
toJSONString
(
baseRequest
)
+
",+acctId:"
+
acctId
+
",loginType:"
+
loginType
+
",queryMobileEntity:"
+
JSON
.
toJSONString
(
queryMobileEntity
));
return
result
;
}
@Autowired
private
AccountInfoDetailMapper
accountInfoMapper
;
/**
* 手机号 统一check
* @param request
*/
@Override
public
void
mobileValidate
(
BaseRequest
request
)
{
Integer
bizType
=
request
.
getBizType
();
String
mobile
=
request
.
getMobile
();
Integer
sourceType
=
request
.
getSourceType
();
// todo 报错提示 bizetype
if
(
null
==
bizType
)
{
logger
.
info
(
"bizType is null"
);
throw
new
PicaWarnException
(
PicaResultCode
.
PARAM_IS_BLANK
.
c
ode
(),
PicaResultCode
.
PARAM_IS_BLANK
.
m
essage
());
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PARAMS_BIZ_TYPE_EMPTY
.
getC
ode
(),
AccountExceptionEnum
.
PARAMS_BIZ_TYPE_EMPTY
.
getM
essage
());
}
// 手机号规则校验
...
...
@@ -185,6 +153,41 @@ public class LoginV1ServiceImpl implements LoginV1Service {
}
}
/**------------------- private -------------------*/
private
LoginResult
processLogin
(
BaseRequest
baseRequest
,
Integer
acctId
,
Integer
loginType
,
QueryMobileEntity
queryMobileEntity
)
{
//接入新旭事务一致性
String
batchNo
=
IntactUtils
.
getUUID
();
intactUtil
.
sendIntact
(
batchNo
,
"processLogin"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"baseRequest:"
+
JSON
.
toJSONString
(
baseRequest
)
+
",+acctId:"
+
acctId
+
",loginType:"
+
loginType
+
",queryMobileEntity:"
+
JSON
.
toJSONString
(
queryMobileEntity
));
Date
currentTime
=
new
Date
();
Long
userId
=
accountUtils
.
getUserIdByAcctId
(
baseRequest
.
getProductType
(),
acctId
);
Account
account
=
new
Account
();
account
.
setId
(
userId
);
account
.
setAcctId
(
acctId
);
account
.
setCreatTime
(
currentTime
);
account
.
setMobilePhone
(
baseRequest
.
getMobile
());
account
.
setRegisterSource
(
baseRequest
.
getSourceType
());
String
newToken
=
tokenUtils
.
generateToken
(
account
);
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
newToken
);
result
.
setUserId
(
userId
);
result
.
setMobile
(
baseRequest
.
getMobile
());
result
.
setDoctorId
(
EncryptUtils
.
encryptContent
(
userId
+
""
,
EncryptConstants
.
ENCRYPT_TYPE_ID
));
//是否完善过个人信息(云鹊医app才需要)
if
(
baseRequest
.
getProductType
()
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
Doctor
doctorEntity
=
doctorInfoMapper
.
selectByPrimaryKey
(
userId
.
intValue
());
result
.
setEntireFlag
(
doctorEntity
.
getEntireFlag
());
}
//记录登录日志
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
baseRequest
.
getProductType
(),
baseRequest
.
getSourceType
(),
loginType
,
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
(),
newToken
,
1
,
baseRequest
.
getUserTokenTourist
());
if
(
queryMobileEntity
!=
null
)
{
entity
.
setQueryMobileEntity
(
queryMobileEntity
);
}
picaLogUtils
.
info
(
entity
);
intactUtil
.
sendIntact
(
batchNo
,
"processLogin"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"baseRequest:"
+
JSON
.
toJSONString
(
baseRequest
)
+
",+acctId:"
+
acctId
+
",loginType:"
+
loginType
+
",queryMobileEntity:"
+
JSON
.
toJSONString
(
queryMobileEntity
));
return
result
;
}
}
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录