Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jgjk
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
任建宇
jgjk
Commits
db2e190a
提交
db2e190a
authored
10月 27, 2020
作者:
liupengfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改更换手机号远程调用
上级
fe753e51
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
28 行增加
和
41 行删除
+28
-41
PersonalCenterConteroller.java
...x/member/fg/personalcenter/PersonalCenterConteroller.java
+28
-41
没有找到文件。
app/member/src/main/java/com/zrqx/member/fg/personalcenter/PersonalCenterConteroller.java
浏览文件 @
db2e190a
package
com
.
zrqx
.
member
.
fg
.
personalcenter
;
package
com
.
zrqx
.
member
.
fg
.
personalcenter
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.security.NoSuchAlgorithmException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zrqx.core.client.form.member.AddVipForm
;
import
com.zrqx.core.client.form.member.AddVipForm
;
import
com.zrqx.core.client.form.third.s
dksms.Sdk
SmsForm
;
import
com.zrqx.core.client.form.third.s
ms.
SmsForm
;
import
com.zrqx.core.client.order.fg.FgOrderClient
;
import
com.zrqx.core.client.order.fg.FgOrderClient
;
import
com.zrqx.core.client.resource.bg.ResourceClient
;
import
com.zrqx.core.client.resource.bg.ResourceClient
;
import
com.zrqx.core.client.third.S
dkS
msClient
;
import
com.zrqx.core.client.third.SmsClient
;
import
com.zrqx.core.client.vo.order.FgOrderVO
;
import
com.zrqx.core.client.vo.order.FgOrderVO
;
import
com.zrqx.core.client.vo.order.OrderPayVo
;
import
com.zrqx.core.client.vo.order.OrderPayVo
;
import
com.zrqx.core.client.vo.resource.DiyTypeVo
;
import
com.zrqx.core.client.vo.resource.DiyTypeVo
;
import
com.zrqx.core.commons.form.LoginMemberInfo
;
import
com.zrqx.core.commons.model.member.Member
;
import
com.zrqx.core.commons.model.member.Member
;
import
com.zrqx.core.commons.redis.Redis
;
import
com.zrqx.core.commons.redis.Redis
;
import
com.zrqx.core.components.member.RedisMember
;
import
com.zrqx.core.components.member.RedisMember
;
...
@@ -61,11 +35,27 @@ import com.zrqx.member.fg.omember.service.FgOrganMemberService;
...
@@ -61,11 +35,27 @@ import com.zrqx.member.fg.omember.service.FgOrganMemberService;
import
com.zrqx.member.fg.organ.service.FgOrganService
;
import
com.zrqx.member.fg.organ.service.FgOrganService
;
import
com.zrqx.member.fg.pmember.service.FgPersonalMemberService
;
import
com.zrqx.member.fg.pmember.service.FgPersonalMemberService
;
import
com.zrqx.member.fg.vip.service.FgVipService
;
import
com.zrqx.member.fg.vip.service.FgVipService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.*
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.security.NoSuchAlgorithmException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* 个人中心Controller
* 个人中心Controller
*/
*/
...
@@ -82,7 +72,7 @@ public class PersonalCenterConteroller {
...
@@ -82,7 +72,7 @@ public class PersonalCenterConteroller {
@Autowired
@Autowired
private
FgExpertMemberService
emService
;
private
FgExpertMemberService
emService
;
@Autowired
@Autowired
private
S
dkSmsClient
sdkS
msClient
;
private
S
msClient
s
msClient
;
@Autowired
@Autowired
private
Redis
redis
;
private
Redis
redis
;
@Autowired
@Autowired
...
@@ -218,11 +208,6 @@ public class PersonalCenterConteroller {
...
@@ -218,11 +208,6 @@ public class PersonalCenterConteroller {
@ApiOperation
(
value
=
"发送手机短信"
,
notes
=
"0:成功;16:60s内不能再次发送;17:当天注册发送验证码超过10次;18:短信验证码发送失败;"
)
@ApiOperation
(
value
=
"发送手机短信"
,
notes
=
"0:成功;16:60s内不能再次发送;17:当天注册发送验证码超过10次;18:短信验证码发送失败;"
)
@GetMapping
(
value
=
"/code-phone"
)
@GetMapping
(
value
=
"/code-phone"
)
public
CallBack
<
String
>
code
(
String
phone
)
throws
Exception
{
public
CallBack
<
String
>
code
(
String
phone
)
throws
Exception
{
SdkSmsForm
ssf
=
new
SdkSmsForm
();
ssf
.
setMobile
(
phone
);
String
code
=
PasswordUtil
.
createPassword
(
6
,
1
);
ssf
.
setContent
(
"您的验证码是:"
+
code
+
",在5分钟内有效。如非本人操作请忽略本短信。"
);
CallBack
<
String
>
sms
=
sdkSmsClient
.
send
(
ssf
);
RedisMember
redisMember
=
redis
.
getRedisMember
();
RedisMember
redisMember
=
redis
.
getRedisMember
();
if
(
phone
.
equals
(
redisMember
.
getMember
().
getPhone
()))
{
if
(
phone
.
equals
(
redisMember
.
getMember
().
getPhone
()))
{
throw
new
BaseException
(
15
,
"不能修改成当前手机号"
);
throw
new
BaseException
(
15
,
"不能修改成当前手机号"
);
...
@@ -243,11 +228,13 @@ public class PersonalCenterConteroller {
...
@@ -243,11 +228,13 @@ public class PersonalCenterConteroller {
if
(
StringUtils
.
isNotBlank
(
sendPhoneCount
)
&&
sendPhoneCount
.
equals
(
"10"
))
{
if
(
StringUtils
.
isNotBlank
(
sendPhoneCount
)
&&
sendPhoneCount
.
equals
(
"10"
))
{
throw
new
BaseException
(
17
,
"当天注册发送验证码超过10次"
);
throw
new
BaseException
(
17
,
"当天注册发送验证码超过10次"
);
}
}
/*
SmsForm
ssf
=
new
SmsForm
();
* SdkSmsForm ssf = new SdkSmsForm(); ssf.setMobile(phone); String code =
ssf
.
setPhone
(
phone
);
* PasswordUtil.createPassword(6, 1); ssf.setContent("您的验证码是:" + code +
String
code
=
PasswordUtil
.
createPassword
(
6
,
1
);
* ",在5分钟内有效。如非本人操作请忽略本短信。"); CallBack<String> sms = sdkSmsClient.send(ssf);
ssf
.
setCode
(
code
);
*/
boolean
isExist
=
mService
.
isExistByPhone
(
null
,
phone
);
ssf
.
setType
(
1
);
/// 更换手机号
CallBack
<
String
>
sms
=
smsClient
.
sendSms
(
ssf
);
if
(
sms
!=
null
&&
sms
.
isStatus
())
{
if
(
sms
!=
null
&&
sms
.
isStatus
())
{
redis
.
set
(
phone
,
code
,
60
*
5
,
TimeUnit
.
SECONDS
);
redis
.
set
(
phone
,
code
,
60
*
5
,
TimeUnit
.
SECONDS
);
sendPhoneCount
=
StringUtils
.
isBlank
(
sendPhoneCount
)
?
"1"
:
Integer
.
parseInt
(
sendPhoneCount
)
+
1
+
""
;
sendPhoneCount
=
StringUtils
.
isBlank
(
sendPhoneCount
)
?
"1"
:
Integer
.
parseInt
(
sendPhoneCount
)
+
1
+
""
;
...
@@ -392,7 +379,7 @@ public class PersonalCenterConteroller {
...
@@ -392,7 +379,7 @@ public class PersonalCenterConteroller {
}*/
}*/
/**
/**
* 每晚
0
点定时修改vip会员状态
* 每晚
1
点定时修改vip会员状态
*
*
* @return
* @return
*/
*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论