Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zcq
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zcq
Commits
da30bf67
提交
da30bf67
authored
4月 11, 2019
作者:
chenxinchang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
0a4d1447
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
57 行增加
和
0 行删除
+57
-0
FgPermissionsController.java
...m/zrqx/member/fg/permissions/FgPermissionsController.java
+57
-0
没有找到文件。
com.zrqx.member/src/main/java/com/zrqx/member/fg/permissions/FgPermissionsController.java
浏览文件 @
da30bf67
...
...
@@ -149,6 +149,39 @@ public class FgPermissionsController {
llService
.
save
(
form
.
getAccount
(),
ip
,
1
,
form
.
getChannel
(),
"账号密码登录"
);
return
CallBack
.
success
(
info
);
}
@ApiOperation
(
value
=
"快速登录"
,
notes
=
"0:登录成功;2:验证码不能为空;3:验证码有误;msg返回错误次数;5:该账户已禁用;"
)
@PostMapping
(
value
=
MemberRequestPath
.
PHONE
+
MemberRequestPath
.
LOGIN
)
public
CallBack
<
LoginMemberInfo
>
phoneLogin
(
@RequestBody
LoginForm
form
,
HttpServletRequest
request
)
throws
BaseException
,
Exception
{
if
(
StringUtils
.
isBlank
(
form
.
getAccount
())
)
{
throw
new
BaseException
(
1
,
"手机号不能为空"
);
}
String
ip
=
CusAccessObjectUtil
.
getIpAddress
(
request
);
if
(
form
.
getCode
()
==
null
)
{
throw
new
BaseException
(
2
,
"验证码不能为空"
);
}
String
redisCode
=
redis
.
get
(
form
.
getAccount
());
if
(
form
.
getCode
()
==
null
||
redisCode
==
null
||
!
form
.
getCode
().
toLowerCase
().
equals
(
redisCode
.
toLowerCase
()))
{
llService
.
save
(
form
.
getAccount
(),
ip
,
0
,
form
.
getChannel
(),
"验证码有误"
);
throw
new
BaseException
(
3
,
"验证码有误"
);
}
redis
.
delete
(
form
.
getAccount
());
Member
m
=
mService
.
login
(
form
.
getAccount
());
if
(
m
==
null
)
{
m
=
mService
.
loginPhone
(
form
.
getAccount
());
}
if
(
m
.
getStatus
()
==
0
)
{
llService
.
save
(
form
.
getAccount
(),
ip
,
0
,
form
.
getChannel
(),
"账号已被禁用,请联系网站管理员!"
);
throw
new
BaseException
(
5
,
"账号已被禁用,请联系网站管理员!"
);
}
LoginMemberInfo
info
=
mService
.
isLevelLogin
(
m
);
String
token
=
MD5Util
.
getEncoderByMd5
(
m
.
getAccount
());
info
.
setToken
(
token
);
redis
.
set
(
token
,
info
);
llService
.
save
(
form
.
getAccount
(),
ip
,
1
,
form
.
getChannel
(),
"快速登录"
);
return
CallBack
.
success
(
info
);
}
@ApiOperation
(
value
=
"微信用户登录 登录渠道 0 PC,1 WAP,2 Android,3 iOS"
,
notes
=
"0:登录成功;5:该账户已禁用;6:第三方登录错误;7:未绑定平台账号"
)
@GetMapping
(
value
=
MemberRequestPath
.
WECHAT
+
MemberRequestPath
.
LOGIN
)
public
CallBack
<
LoginMemberInfo
>
wechartLogin
(
@RequestParam
(
"code"
)
String
code
,
Integer
channel
,
HttpServletRequest
request
)
throws
BaseException
,
Exception
{
...
...
@@ -410,6 +443,30 @@ public class FgPermissionsController {
}
return
CallBack
.
success
(
"发送成功"
+
code
,
sendPhoneCount
);
}
@ApiOperation
(
value
=
"发送手机短信 登录时使用"
,
notes
=
"0:成功;16:60s内不能再次发送;;18:短信验证码发送失败;"
)
@GetMapping
(
value
=
MemberRequestPath
.
LOGIN
+
MemberRequestPath
.
CODE
)
public
CallBack
<
String
>
loginCode
(
String
phone
)
throws
Exception
{
if
(!
mService
.
isExistByPhone
(
null
,
phone
))
{
throw
new
BaseException
(
99
,
"手机号未注册"
);
}
String
sendTime
=
phone
+
"login"
;
if
(
redis
.
get
(
sendTime
)
!=
null
)
{
throw
new
BaseException
(
16
,
"60s内不能再次发送"
);
}
SdkSmsForm
ssf
=
new
SdkSmsForm
();
ssf
.
setMobile
(
phone
);
String
code
=
PasswordUtil
.
createPassword
(
6
,
1
);
ssf
.
setContent
(
"您的验证码是:"
+
code
+
",在5分钟内有效。如非本人操作请忽略本短信。"
);
CallBack
<
String
>
sms
=
sdkSmsClient
.
send
(
ssf
);
if
(
sms
!=
null
&&
sms
.
isStatus
()){
redis
.
set
(
phone
,
code
,
60
*
5
,
TimeUnit
.
SECONDS
);
redis
.
set
(
sendTime
,
"60"
,
60
);
}
else
{
throw
new
BaseException
(
18
,
"短信验证码发送失败"
);
}
return
CallBack
.
success
(
"发送成功"
+
code
);
}
@ApiOperation
(
value
=
"重置密码-1 发送手机短信"
,
notes
=
"0:成功;16:60s内不能再次发送;18:短信验证码发送失败;"
)
@GetMapping
(
value
=
MemberRequestPath
.
PASSWORD
+
1
)
public
CallBack
<
String
>
resetPassword1
(
String
phone
)
throws
Exception
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论