Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
V
volunteer_service
Project
Project
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
licc
volunteer_service
Commits
930e9e71
Commit
930e9e71
authored
Feb 02, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改短信接口
parent
d66b03fb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
SendSmsSerViceImpl.java
...ava/cn/wisenergy/service/app/impl/SendSmsSerViceImpl.java
+10
-4
UserLoginServiceImpl.java
...a/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
+1
-1
Common.java
...ice/src/main/java/cn/wisenergy/service/common/Common.java
+2
-2
PayController.java
.../cn/wisenergy/web/admin/controller/app/PayController.java
+1
-1
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/SendSmsSerViceImpl.java
View file @
930e9e71
...
@@ -61,6 +61,15 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
...
@@ -61,6 +61,15 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
//生成六位随机数作为短信验证码
//生成六位随机数作为短信验证码
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
//保存验证到缓存,以便做验证
String
scene
=
SceneType
.
getNameByCode
(
sendSmsVo
.
getScene
());
boolean
bool
=
redisService
.
set
(
CachePrefix
.
SMS_CODE
.
getPrefix
()
+
scene
+
"_"
+
sendSmsVo
.
getSource
()
+
"_"
+
sendSmsVo
.
getPhone
(),
code
,
Common
.
SMS_TIMEOUT
);
if
(!
bool
)
{
return
R
.
error
(
"缓存验证码失败!"
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
4
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
4
);
map
.
put
(
"code"
,
code
);
map
.
put
(
"code"
,
code
);
request
.
putQueryParameter
(
"RegionId"
,
"cn-hangzhou"
);
request
.
putQueryParameter
(
"RegionId"
,
"cn-hangzhou"
);
...
@@ -71,14 +80,11 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
...
@@ -71,14 +80,11 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
try
{
try
{
//发送验证码
//发送验证码
CommonResponse
response
=
client
.
getCommonResponse
(
request
);
CommonResponse
response
=
client
.
getCommonResponse
(
request
);
log
.
info
(
"输出短信返回参数"
);
}
catch
(
ClientException
e
)
{
}
catch
(
ClientException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
//保存验证到缓存,以便做验证
String
scene
=
SceneType
.
getNameByCode
(
sendSmsVo
.
getScene
());
boolean
bool
=
redisService
.
set
(
CachePrefix
.
SMS_CODE
.
getPrefix
()
+
scene
+
"_"
+
sendSmsVo
.
getSource
()
+
"_"
+
sendSmsVo
.
getPhone
(),
code
,
Common
.
SMS_TIMEOUT
);
return
R
.
ok
(
bool
);
return
R
.
ok
(
bool
);
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
View file @
930e9e71
...
@@ -46,7 +46,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
...
@@ -46,7 +46,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
@Autowired
@Autowired
private
UserLimitMapper
userLimitMapper
;
private
UserLimitMapper
userLimitMapper
;
private
static
final
int
ERROR_CODE
=
500
;
private
static
final
int
ERROR_CODE
=
1
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/common/Common.java
View file @
930e9e71
...
@@ -27,7 +27,7 @@ public class Common {
...
@@ -27,7 +27,7 @@ public class Common {
/**
/**
* 阿里云短信超时时间
* 阿里云短信超时时间
*/
*/
public
static
final
long
SMS_TIMEOUT
=
3
00
;
public
static
final
long
SMS_TIMEOUT
=
12
00
;
/**
/**
* 支付宝支付app_id
* 支付宝支付app_id
...
@@ -62,7 +62,7 @@ public class Common {
...
@@ -62,7 +62,7 @@ public class Common {
/**
/**
* 沙箱 --支付宝支付app_id
* 沙箱 --支付宝支付app_id
*/
*/
public
static
final
String
APP_ID_CS
=
"2021000117607483"
;
public
static
final
String
APP_ID_CS
=
"2021000117607483"
;
public
static
final
String
ALIPAY_PUBLIC_KEY_CS
=
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh5uAe8quhr05KrOnJ5Jrrp"
+
public
static
final
String
ALIPAY_PUBLIC_KEY_CS
=
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh5uAe8quhr05KrOnJ5Jrrp"
+
"TphjEoFR4VnHFy9QDRoHK6ouFIz7ksCw6LS7A/S3Yhe3+bZbcvmJSKN1pVO6ssa8iuai81NAnylMZm5tOTaMl945OuqmC8qvIk9wg4AkYd"
+
"TphjEoFR4VnHFy9QDRoHK6ouFIz7ksCw6LS7A/S3Yhe3+bZbcvmJSKN1pVO6ssa8iuai81NAnylMZm5tOTaMl945OuqmC8qvIk9wg4AkYd"
+
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/PayController.java
View file @
930e9e71
...
@@ -9,7 +9,6 @@ import com.alipay.api.AlipayClient;
...
@@ -9,7 +9,6 @@ import com.alipay.api.AlipayClient;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.request.AlipayTradePagePayRequest
;
import
com.alipay.api.request.AlipayTradePagePayRequest
;
import
com.alipay.api.request.AlipayTradeQueryRequest
;
import
com.alipay.api.request.AlipayTradeQueryRequest
;
import
com.alipay.api.response.AlipayTradePagePayResponse
;
import
com.alipay.api.response.AlipayTradeQueryResponse
;
import
com.alipay.api.response.AlipayTradeQueryResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -24,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -24,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.UUID
;
/**
/**
* @author 86187
* @author 86187
...
...
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