Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
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
首航-临时账号
api
Commits
b29be75d
Commit
b29be75d
authored
Aug 25, 2020
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信发送
parent
362dad5d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
SecurityPropertyPlaceholderConfigurer.java
src/com/ejweb/core/conf/SecurityPropertyPlaceholderConfigurer.java
+5
-4
Util.java
src/com/ejweb/core/util/Util.java
+0
-0
ShortMessageService.java
src/com/ejweb/modules/message/service/ShortMessageService.java
+18
-3
No files found.
src/com/ejweb/core/conf/SecurityPropertyPlaceholderConfigurer.java
View file @
b29be75d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
package
com
.
ejweb
.
core
.
conf
;
package
com
.
ejweb
.
core
.
conf
;
import
com.ejweb.core.security.DES3Utils
;
import
com.ejweb.core.security.DES3Utils
;
import
com.ejweb.core.util.Util
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
...
@@ -78,9 +79,9 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo
...
@@ -78,9 +79,9 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
DES3Utils
.
encrypt
(
"foctest"
,
CONF_DESC_KEY
));
//
System.out.println(DES3Utils.encrypt("foctest", CONF_DESC_KEY));
System
.
out
.
println
(
DES3Utils
.
decrypt
(
"dc6788486fc8fa46bdc79e88019874d2dba29c9323df0d41d422c89b73b481946acb4985946fc04c9e83784b79a27bf935e0dbe240259eb88daa2a68d7c26b3c05ef21acf1ec90e77072592f9207bf97"
,
CONF_DESC_KEY
));
//
System.out.println(DES3Utils.decrypt("dc6788486fc8fa46bdc79e88019874d2dba29c9323df0d41d422c89b73b481946acb4985946fc04c9e83784b79a27bf935e0dbe240259eb88daa2a68d7c26b3c05ef21acf1ec90e77072592f9207bf97", CONF_DESC_KEY));
System
.
out
.
println
(
DES3Utils
.
decrypt
(
"776b3d2f912b12f8"
,
CONF_DESC_KEY
));
//
System.out.println(DES3Utils.decrypt("776b3d2f912b12f8", CONF_DESC_KEY));
System
.
out
.
println
(
DES3Utils
.
decrypt
(
"
6f2237c231b1464c6474030c906ec914
"
,
CONF_DESC_KEY
));
System
.
out
.
println
(
DES3Utils
.
decrypt
(
"
f5c9d35c1df1eb31c0f15d23ee5af33d15ee14d1133b16ae580893ec603fc77c0057d3cccb34407d0505fc99a849cd7ee060d2c605d68b21ea7fea2a325dd4026e7f13e65e216d967bc7696f608fe56ef11ae4801b727c51d09bc4beb44b24f0
"
,
CONF_DESC_KEY
));
}
}
}
}
src/com/ejweb/core/util/Util.java
View file @
b29be75d
This diff is collapsed.
Click to expand it.
src/com/ejweb/modules/message/service/ShortMessageService.java
View file @
b29be75d
...
@@ -11,6 +11,7 @@ import com.ejweb.core.conf.GConstants;
...
@@ -11,6 +11,7 @@ import com.ejweb.core.conf.GConstants;
import
com.ejweb.core.fetcher.FetchEntity
;
import
com.ejweb.core.fetcher.FetchEntity
;
import
com.ejweb.core.fetcher.HCFetcher
;
import
com.ejweb.core.fetcher.HCFetcher
;
import
com.ejweb.core.util.IdWorker
;
import
com.ejweb.core.util.IdWorker
;
import
com.ejweb.core.util.Util
;
import
com.ejweb.modules.message.bean.ShortMsgBean
;
import
com.ejweb.modules.message.bean.ShortMsgBean
;
import
com.ejweb.modules.message.bean.ShortMsgListBean
;
import
com.ejweb.modules.message.bean.ShortMsgListBean
;
import
com.ejweb.modules.message.bean.ShortMsgUserListBean
;
import
com.ejweb.modules.message.bean.ShortMsgUserListBean
;
...
@@ -57,20 +58,34 @@ public class ShortMessageService extends BaseService<ShortMessageDao> {
...
@@ -57,20 +58,34 @@ public class ShortMessageService extends BaseService<ShortMessageDao> {
}
}
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
String
[]
phones
=
phone
.
split
(
",|,"
);
String
[]
phones
=
phone
.
split
(
",|,"
);
boolean
abroadPhone
=
false
;
for
(
int
i
=
0
,
len
=
phones
.
length
;
i
<
len
;
i
++)
{
for
(
int
i
=
0
,
len
=
phones
.
length
;
i
<
len
;
i
++)
{
if
(
i
>
0
)
{
if
(
i
>
0
)
{
builder
.
append
(
","
);
builder
.
append
(
","
);
}
}
builder
.
append
(
phones
[
i
].
replaceAll
(
"^0+"
,
""
));
//判断号码去掉开头的0之后是否是国内号码
String
phone1
=
phones
[
i
].
replaceAll
(
"^0+"
,
""
);
if
(
Util
.
phoneReg
(
phone1
))
{
builder
.
append
(
phone1
);
}
else
{
builder
.
append
(
phones
[
i
]);
abroadPhone
=
true
;
}
}
}
//电话号码去除空格,否则导致发送失败
//电话号码去除空格,否则导致发送失败
phone
=
builder
.
toString
().
trim
();
phone
=
builder
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
phone
))
{
if
(
StringUtils
.
isEmpty
(
phone
))
{
return
false
;
return
false
;
}
}
String
url
=
""
;
if
(
abroadPhone
)
{
url
=
GConstants
.
JDAIR_SMS_API
+
"&mobile="
+
phone
+
"&msg="
+
URLEncoder
.
encode
(
bean
.
getMessage
(),
"UTF-8"
)
+
"&isInternetPhone=1"
;
}
else
{
url
=
GConstants
.
JDAIR_SMS_API
+
"&mobile="
+
phone
+
"&msg="
+
URLEncoder
.
encode
(
bean
.
getMessage
(),
"UTF-8"
);
}
logger
.
info
(
"短信地址:"
+
url
);
HCFetcher
fetcher
=
HCFetcher
.
getInstance
();
HCFetcher
fetcher
=
HCFetcher
.
getInstance
();
FetchEntity
entity
=
fetcher
.
post
(
GConstants
.
JDAIR_SMS_API
+
"&mobile="
+
phone
+
"&msg="
+
URLEncoder
.
encode
(
bean
.
getMessage
(),
"UTF-8"
)
,
null
);
FetchEntity
entity
=
fetcher
.
post
(
url
,
null
);
if
(
entity
!=
null
&&
entity
.
isSuccess
())
{
if
(
entity
!=
null
&&
entity
.
isSuccess
())
{
String
resultStr
=
entity
.
getContent
(
"utf-8"
);
String
resultStr
=
entity
.
getContent
(
"utf-8"
);
// 成功获取数据
// 成功获取数据
...
...
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