Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
online-edu
online-edu-backend
Commits
a0f03874
Commit
a0f03874
authored
Oct 29, 2021
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8ec91319
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
SmsService.java
src/main/java/com/qkdata/biz/sms/service/SmsService.java
+2
-1
No files found.
src/main/java/com/qkdata/biz/sms/service/SmsService.java
View file @
a0f03874
...
...
@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.client.RestTemplate
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URI
;
import
java.net.URLEncoder
;
import
java.util.Base64
;
import
java.util.Collections
;
...
...
@@ -57,7 +58,7 @@ public class SmsService {
content
=
URLEncoder
.
encode
(
content
,
"utf-8"
);
String
url
=
String
.
format
(
api
,
condition
.
getMobile
(),
content
);
log
.
debug
(
"sms req url:"
+
url
);
ResponseEntity
<
String
>
resp
=
restTemplate
.
getForEntity
(
url
,
String
.
class
);
ResponseEntity
<
String
>
resp
=
restTemplate
.
getForEntity
(
URI
.
create
(
url
)
,
String
.
class
);
if
(
resp
.
getStatusCode
()
!=
HttpStatus
.
OK
||
!
resp
.
getBody
().
equals
(
"OK"
))
{
log
.
error
(
"短信发送失败:{}"
,
resp
.
getBody
());
throw
new
BusinessException
(
"短信发送失败"
);
...
...
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