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
提交
23fc344d
提交
23fc344d
编写于
8月 18, 2020
作者:
peijun.zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add 静默注册亚测接口v3
上级
877050eb
流水线
#29092
已失败 于阶段
in 0 second
变更
1
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
20 行增加
和
23 行删除
+20
-23
AccountController.java
.../account/account/server/controller/AccountController.java
+20
-23
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountController.java
浏览文件 @
23fc344d
...
@@ -401,7 +401,7 @@ public class AccountController extends AccountBaseController {
...
@@ -401,7 +401,7 @@ public class AccountController extends AccountBaseController {
LoginResult
result1
=
new
LoginResult
();
LoginResult
result1
=
new
LoginResult
();
result1
.
setToken
(
newToken
);
result1
.
setToken
(
newToken
);
intactUtil
.
sendIntact
(
batchNo2
,
"register"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"req:"
+
JSON
.
toJSONString
(
req
));
//
intactUtil.sendIntact(batchNo2,"register",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"req:"+ JSON.toJSONString(req));
// return PicaResponse.toResponse(result);
// return PicaResponse.toResponse(result);
result
=
PicaResponse
.
toResponse
(
result1
);
result
=
PicaResponse
.
toResponse
(
result1
);
...
@@ -419,14 +419,11 @@ public class AccountController extends AccountBaseController {
...
@@ -419,14 +419,11 @@ public class AccountController extends AccountBaseController {
@ApiOperation
(
"yace /login-register/v3"
)
@ApiOperation
(
"yace /login-register/v3"
)
@PostMapping
(
"/login-register/v3"
)
@PostMapping
(
"/login-register/v3"
)
// @RepeatForbidden(uniqueKey = "content")
//当前版本存在性能问题 luo优化后上
public
PicaResponse
loginRegisterV3
(
@RequestBody
BaseRequest
request
)
throws
Exception
{
public
PicaResponse
loginRegisterV3
(
@RequestBody
BaseRequest
request
)
throws
Exception
{
// BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
this
.
checkMobilePhone
(
request
.
getMobile
());
this
.
checkMobilePhone
(
request
.
getMobile
());
//接入新旭事务一致性
//接入新旭事务一致性
String
batchNo
=
IntactUtils
.
getUUID
();
//
String batchNo = IntactUtils.getUUID();
intactUtil
.
sendIntact
(
batchNo
,
"webLive-loginRegister"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"entity:"
+
JSON
.
toJSONString
(
request
));
//
intactUtil.sendIntact(batchNo,"webLive-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1,"entity:"+ JSON.toJSONString(request));
AccountReq
req
=
new
AccountReq
();
AccountReq
req
=
new
AccountReq
();
req
.
setMobilePhone
(
request
.
getMobile
());
req
.
setMobilePhone
(
request
.
getMobile
());
// 登录或注册,只能使用验证码
// 登录或注册,只能使用验证码
...
@@ -442,20 +439,20 @@ public class AccountController extends AccountBaseController {
...
@@ -442,20 +439,20 @@ public class AccountController extends AccountBaseController {
PicaResponse
response
=
null
;
PicaResponse
response
=
null
;
try
{
try
{
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
this
.
checkMobilePhone
(
req
.
getMobilePhone
());
logger
.
info
(
"login:{}"
,
JSONObject
.
toJSONString
(
req
));
//
logger.info("login:{}", JSONObject.toJSONString(req));
//接入新旭事务一致性
//接入新旭事务一致性
String
batchNo1
=
IntactUtils
.
getUUID
();
//
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
));
//
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
());
//获取账号信息
Account
account1
=
accountService
.
getByMobilePhone
(
req
.
getMobilePhone
());
//获取账号信息
if
(
account1
==
null
)
{
if
(
account1
==
null
)
{
intactUtil
.
sendIntact
(
batchNo1
,
"login"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"未注册,请验证码登录"
);
//
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
()))
{
if
(
StringUtils
.
isBlank
(
req
.
getPassword
()))
{
//验证码登录
//验证码登录
req
.
setFlag
(
"0"
);
req
.
setFlag
(
"0"
);
intactUtil
.
sendIntact
(
batchNo1
,
"login"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"校验验证码前的返回,因为验证码可能校验不通过,就直接返回了"
);
//
intactUtil.sendIntact(batchNo1,"login",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"校验验证码前的返回,因为验证码可能校验不通过,就直接返回了");
//校验验证码
//校验验证码
// this.checkAuthCode(req);
// this.checkAuthCode(req);
...
@@ -464,7 +461,7 @@ public class AccountController extends AccountBaseController {
...
@@ -464,7 +461,7 @@ public class AccountController extends AccountBaseController {
redisClient
.
del
(
authCodeKey
);
//清除验证码
redisClient
.
del
(
authCodeKey
);
//清除验证码
}
else
{
//密码登录
}
else
{
//密码登录
if
(!
StringUtils
.
equals
(
req
.
getPassword
(),
account1
.
getPassword
()))
{
if
(!
StringUtils
.
equals
(
req
.
getPassword
(),
account1
.
getPassword
()))
{
intactUtil
.
sendIntact
(
batchNo1
,
"login"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"请输入正确的密码"
);
//
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
(),
"请输入正确的密码"
);
return
PicaResponse
.
toResponse
(
null
,
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"请输入正确的密码"
);
}
}
}
}
...
@@ -483,20 +480,20 @@ public class AccountController extends AccountBaseController {
...
@@ -483,20 +480,20 @@ public class AccountController extends AccountBaseController {
//登录成功,清除旧token,生成新token
//登录成功,清除旧token,生成新token
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
String
newToken
=
this
.
generateTokenWebLive
(
account1
,
deviceType
);
String
newToken
=
this
.
generateTokenWebLive
(
account1
,
deviceType
);
intactUtil
.
sendIntact
(
batchNo1
,
"login"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"req:"
+
JSON
.
toJSONString
(
req
));
//
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
);
response
=
PicaResponse
.
toResponse
(
newToken
);
}
catch
(
PicaException
e
)
{
}
catch
(
PicaException
e
)
{
if
(
e
.
getCode
().
equals
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
())
||
e
.
getCode
().
equals
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
())){
if
(
e
.
getCode
().
equals
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
())
||
e
.
getCode
().
equals
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
())){
intactUtil
.
sendIntact
(
batchNo
,
"webLive-loginRegister"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"验证码错误或过期-不加入提醒,返回值:"
+
JSON
.
toJSONString
(
response
));
//
intactUtil.sendIntact(batchNo,"webLive-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"验证码错误或过期-不加入提醒,返回值:"+ JSON.toJSONString(response));
}
}
throw
e
;
throw
e
;
}
}
if
(
response
.
getData
()
!=
null
)
{
if
(
response
.
getData
()
!=
null
)
{
LoginResult
result
=
new
LoginResult
();
LoginResult
result
=
new
LoginResult
();
result
.
setToken
(
response
.
getData
().
toString
());
result
.
setToken
(
response
.
getData
().
toString
());
intactUtil
.
sendIntact
(
batchNo
,
"webLive-loginRegister"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"登录成功,返回值:"
+
JSON
.
toJSONString
(
response
.
getData
()));
//
intactUtil.sendIntact(batchNo,"webLive-loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"登录成功,返回值:"+ JSON.toJSONString(response.getData()));
return
PicaResponse
.
toResponse
(
result
);
return
PicaResponse
.
toResponse
(
result
);
}
}
...
@@ -513,8 +510,8 @@ public class AccountController extends AccountBaseController {
...
@@ -513,8 +510,8 @@ public class AccountController extends AccountBaseController {
redisClient
.
del
(
authCodeKey
);
redisClient
.
del
(
authCodeKey
);
//接入新旭事务一致性
//接入新旭事务一致性
String
batchNo2
=
IntactUtils
.
getUUID
();
//
String batchNo2 = IntactUtils.getUUID();
intactUtil
.
sendIntact
(
batchNo2
,
"register"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"req:"
+
JSON
.
toJSONString
(
req
));
//
intactUtil.sendIntact(batchNo2,"register",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1,"req:"+ JSON.toJSONString(req));
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
String
deviceType
=
super
.
getDeviceInfo
(
"device_type"
);
//1:pc 2:android 3:ios
Account
account2
=
new
Account
();
Account
account2
=
new
Account
();
account2
.
setMobilePhone
(
EncryptUtils
.
encryptContent
(
req
.
getMobilePhone
(),
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
));
account2
.
setMobilePhone
(
EncryptUtils
.
encryptContent
(
req
.
getMobilePhone
(),
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
));
...
@@ -540,18 +537,18 @@ public class AccountController extends AccountBaseController {
...
@@ -540,18 +537,18 @@ public class AccountController extends AccountBaseController {
LoginResult
result1
=
new
LoginResult
();
LoginResult
result1
=
new
LoginResult
();
result1
.
setToken
(
newToken
);
result1
.
setToken
(
newToken
);
intactUtil
.
sendIntact
(
batchNo2
,
"register"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"req:"
+
JSON
.
toJSONString
(
req
));
//
intactUtil.sendIntact(batchNo2,"register",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"req:"+ JSON.toJSONString(req));
// return PicaResponse.toResponse(result);
// return PicaResponse.toResponse(result);
result
=
PicaResponse
.
toResponse
(
result1
);
result
=
PicaResponse
.
toResponse
(
result1
);
}
catch
(
PicaException
e
)
{
}
catch
(
PicaException
e
)
{
if
(
e
.
getCode
().
equals
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
())
||
e
.
getCode
().
equals
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
())){
if
(
e
.
getCode
().
equals
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
())
||
e
.
getCode
().
equals
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
())){
intactUtil
.
sendIntact
(
batchNo
,
"webLive--loginRegister"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"验证码错误或过期-不加入提醒,返回值:"
+
JSON
.
toJSONString
(
result
));
//
intactUtil.sendIntact(batchNo,"webLive--loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"验证码错误或过期-不加入提醒,返回值:"+ JSON.toJSONString(result));
}
}
throw
e
;
throw
e
;
}
}
intactUtil
.
sendIntact
(
batchNo
,
"webLive--loginRegister"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"注册成功,返回值:"
+
JSON
.
toJSONString
(
result
));
//
intactUtil.sendIntact(batchNo,"webLive--loginRegister",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"注册成功,返回值:"+ JSON.toJSONString(result));
return
result
;
return
result
;
}
}
}
}
...
@@ -684,8 +681,8 @@ public class AccountController extends AccountBaseController {
...
@@ -684,8 +681,8 @@ public class AccountController extends AccountBaseController {
private
String
generateTokenWebLive
(
Account
account
,
String
deviceType
)
{
private
String
generateTokenWebLive
(
Account
account
,
String
deviceType
)
{
//接入新旭事务一致性
//接入新旭事务一致性
String
batchNo
=
IntactUtils
.
getUUID
();
//
String batchNo = IntactUtils.getUUID();
intactUtil
.
sendIntact
(
batchNo
,
"generateToken"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"account:"
+
JSON
.
toJSONString
(
account
)+
",deviceType:"
+
deviceType
);
//
intactUtil.sendIntact(batchNo,"generateToken",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_1,"account:"+ JSON.toJSONString(account)+",deviceType:"+deviceType);
String
newToken
;
String
newToken
;
switch
(
deviceType
)
{
//设备信息
switch
(
deviceType
)
{
//设备信息
case
"1"
:
//pc
case
"1"
:
//pc
...
@@ -700,7 +697,7 @@ public class AccountController extends AccountBaseController {
...
@@ -700,7 +697,7 @@ public class AccountController extends AccountBaseController {
default
:
//H5
default
:
//H5
newToken
=
this
.
generateH5TokenWebLive
(
account
);
newToken
=
this
.
generateH5TokenWebLive
(
account
);
}
}
intactUtil
.
sendIntact
(
batchNo
,
"generateToken"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"newToken:"
+
newToken
);
//
intactUtil.sendIntact(batchNo,"generateToken",com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3,"newToken:"+newToken);
return
newToken
;
return
newToken
;
}
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录