Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-auth
Commits
6f81706a
Commit
6f81706a
authored
May 08, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改管理员手机号和密码短信发送调整
parent
bfb032ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
UserController.java
...main/java/com/gic/auth/web/controller/UserController.java
+14
-11
No files found.
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UserController.java
View file @
6f81706a
...
@@ -3,6 +3,7 @@ package com.gic.auth.web.controller;
...
@@ -3,6 +3,7 @@ package com.gic.auth.web.controller;
import
com.gic.auth.web.vo.SuperUserVO
;
import
com.gic.auth.web.vo.SuperUserVO
;
import
com.gic.auth.web.vo.UserOfGicVO
;
import
com.gic.auth.web.vo.UserOfGicVO
;
import
com.gic.enterprise.base.EnterpriseInfo
;
import
com.gic.enterprise.base.EnterpriseInfo
;
import
com.gic.enterprise.constants.Constants
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.log4j.LogManager
;
import
org.apache.log4j.LogManager
;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.Logger
;
...
@@ -71,23 +72,26 @@ public class UserController {
...
@@ -71,23 +72,26 @@ public class UserController {
if
(
isNeedSendSms
)
{
if
(
isNeedSendSms
)
{
//发送短信,通知自动生成密码
//发送短信,通知自动生成密码
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
userDTO
.
setPhoneAreaCode
(
"86"
);
userDTO
.
setPhoneAreaCode
(
Constants
.
NATION_CODE
);
}
}
smsArr
=
new
String
[]
{
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
(),
smsArr
=
new
String
[]
{
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
(),
password
};
userDTO
.
getPhoneNumber
(),
password
};
}
}
}
}
ServiceResponse
userResult
;
ServiceResponse
userResult
;
//普通用户
//普通用户
userDTO
.
setSuperAdmin
(
0
);
userDTO
.
setSuperAdmin
(
0
);
//sms场景ID
String
smsSenceId
=
"GICSHHT003"
;
if
(
userDTO
.
getUserId
()
==
null
)
{
if
(
userDTO
.
getUserId
()
==
null
)
{
userResult
=
userApiService
.
saveUser
(
userDTO
);
userResult
=
userApiService
.
saveUser
(
userDTO
);
}
else
{
}
else
{
smsSenceId
=
"GICSHHT004"
;
userResult
=
userApiService
.
editUser
(
userDTO
);
userResult
=
userApiService
.
editUser
(
userDTO
);
}
}
if
(
userResult
.
isSuccess
())
{
if
(
userResult
.
isSuccess
())
{
if
(
isNeedSendSms
)
{
if
(
isNeedSendSms
)
{
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICpassword001"
,
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
smsSenceId
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
userDTO
.
getPhoneAreaCode
(),
userDTO
.
getPhoneNumber
(),
smsArr
);
userDTO
.
getPhoneAreaCode
(),
userDTO
.
getPhoneNumber
(),
smsArr
);
if
(!
smsSendResult
.
isSuccess
())
{
if
(!
smsSendResult
.
isSuccess
())
{
...
@@ -153,7 +157,7 @@ public class UserController {
...
@@ -153,7 +157,7 @@ public class UserController {
@RequestMapping
(
"send-auth-code-to-modify-phone"
)
@RequestMapping
(
"send-auth-code-to-modify-phone"
)
public
RestResponse
sendAuthCode
(
String
phone
,
String
nationCode
)
{
public
RestResponse
sendAuthCode
(
String
phone
,
String
nationCode
)
{
if
(
StringUtils
.
isBlank
(
nationCode
))
{
if
(
StringUtils
.
isBlank
(
nationCode
))
{
nationCode
=
"86"
;
nationCode
=
Constants
.
NATION_CODE
;
}
}
AuthCodeDTO
authCodeDTO
=
new
AuthCodeDTO
();
AuthCodeDTO
authCodeDTO
=
new
AuthCodeDTO
();
authCodeDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
authCodeDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
...
@@ -168,9 +172,8 @@ public class UserController {
...
@@ -168,9 +172,8 @@ public class UserController {
if
(
result
.
isSuccess
())
{
if
(
result
.
isSuccess
())
{
Integer
authCodeId
=
result
.
getResult
();
Integer
authCodeId
=
result
.
getResult
();
//发送手机验证码
//发送手机验证码
String
[]
smsArr
=
new
String
[]
{
authCode
,
String
[]
smsArr
=
new
String
[]
{
authCode
};
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
()
};
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICSHHT005"
,
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICphone"
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
nationCode
,
phone
,
smsArr
);
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
nationCode
,
phone
,
smsArr
);
if
(!
smsSendResult
.
isSuccess
())
{
if
(!
smsSendResult
.
isSuccess
())
{
return
EnterpriseRestResponse
.
failure
(
smsSendResult
);
return
EnterpriseRestResponse
.
failure
(
smsSendResult
);
...
@@ -213,9 +216,9 @@ public class UserController {
...
@@ -213,9 +216,9 @@ public class UserController {
if
(
result
.
isSuccess
())
{
if
(
result
.
isSuccess
())
{
Integer
authCodeId
=
result
.
getResult
();
Integer
authCodeId
=
result
.
getResult
();
//发送手机验证码
//发送手机验证码
String
[]
smsArr
=
new
String
[]
{
authCode
,
String
[]
smsArr
=
new
String
[]
{
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
()
};
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
()
,
authCode
};
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GIC
password
"
,
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GIC
SHHT004
"
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getPhoneAreaCode
(),
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getPhoneAreaCode
(),
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getPhoneNumber
(),
smsArr
);
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getPhoneNumber
(),
smsArr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment