Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mall-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
yimu
mall-server
Commits
afe93938
Commit
afe93938
authored
Jan 04, 2022
by
wp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改短信模板为一幕影链
parent
a00ce1ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
SmsController.java
...mall/server/admin/auxiliary/controller/SmsController.java
+3
-3
AliSmsUtils.java
...main/java/com/fzm/mall/server/admin/util/AliSmsUtils.java
+3
-5
No files found.
mall-server-admin/src/main/java/com/fzm/mall/server/admin/auxiliary/controller/SmsController.java
View file @
afe93938
...
...
@@ -97,7 +97,7 @@ public class SmsController {
switch
(
Objects
.
requireNonNull
(
CodeTypeEnum
.
getByType
(
type
)))
{
case
REGISTER:
// templateId = "SMS_226745226";
templateId
=
AliSmsUtils
.
tempId
;
templateId
=
AliSmsUtils
.
MERCHANT_REGISTER
;
redisKey
=
MALLGlobalConfig
.
PHONE_CODE_MERCHANT_REGISTER_REDIS_KEY_SUFFIX
;
break
;
case
SEARCH:
...
...
@@ -106,12 +106,12 @@ public class SmsController {
break
;
case
REPAIR_PWD:
// templateId = "SMS_226745226";
templateId
=
AliSmsUtils
.
tempId
;
templateId
=
AliSmsUtils
.
REPAIR_PWD
;
redisKey
=
MALLGlobalConfig
.
PHONE_CODE_REPAIR_PWD_REDIS_KEY_SUFFIX
;
break
;
case
AUTHENTICATION:
// templateId = "SMS_226745226";
templateId
=
AliSmsUtils
.
tempId
;
templateId
=
AliSmsUtils
.
RESET_PWD
;
redisKey
=
MALLGlobalConfig
.
PHONE_CODE_IDENTITY_REDIS_KEY_SUFFIX
;
break
;
}
...
...
mall-server-admin/src/main/java/com/fzm/mall/server/admin/util/AliSmsUtils.java
View file @
afe93938
...
...
@@ -36,8 +36,6 @@ public class AliSmsUtils {
// 重置密码
public
static
String
RESET_PWD
=
"SMS_225125100"
;
public
static
String
tempId
=
"SMS_226745226"
;
public
static
boolean
sendCode
(
String
mobile
,
String
code
,
String
tplId
,
boolean
isMsg
)
{
//设置超时时间-可自行调整
System
.
setProperty
(
"sun.net.client.defaultConnectTimeout"
,
"10000"
);
...
...
@@ -46,8 +44,8 @@ public class AliSmsUtils {
final
String
product
=
"Dysmsapi"
;
//短信API产品名称(短信产品名固定,无需修改)
final
String
domain
=
"dysmsapi.aliyuncs.com"
;
//短信API产品域名(接口地址固定,无需修改)
//替换成你的AK
final
String
accessKeyId
=
"LTAI5t
D9SPnwKjaAzywQEvde
"
;
//你的accessKeyId,参考本文档步骤2+
final
String
accessKeySecret
=
"
Mm1R0sVS10IrRBsNIEvJpLQRj4tOjj
"
;
//你的accessKeySecret,参考本文档步骤2
final
String
accessKeyId
=
"LTAI5t
KnkYvSprbF26n7FZN3
"
;
//你的accessKeyId,参考本文档步骤2+
final
String
accessKeySecret
=
"
kxJfWPa03WSTBsRvj7n2bYeBsdWBgY
"
;
//你的accessKeySecret,参考本文档步骤2
//初始化ascClient,暂时不支持多region(请勿修改)
IClientProfile
profile
=
DefaultProfile
.
getProfile
(
"cn-hangzhou"
,
accessKeyId
,
accessKeySecret
);
...
...
@@ -66,7 +64,7 @@ public class AliSmsUtils {
//必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式;发送国际/港澳台消息时,接收号码格式为国际区号+号码,如“85200000000”
request
.
setPhoneNumbers
(
mobile
);
//必填:短信签名-可在短信控制台中找到
request
.
setSignName
(
"
浙娱
"
);
request
.
setSignName
(
"
一幕影链
"
);
//必填:短信模板-可在短信控制台中找到,发送国际/港澳台消息时,请使用国际/港澳台短信模版
request
.
setTemplateCode
(
tplId
);
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
...
...
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