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
b9c3bddf
Commit
b9c3bddf
authored
Feb 03, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改端口
parent
dd4f5ef5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
6 deletions
+70
-6
pom.xml
wisenergy-service/pom.xml
+12
-0
UserLoginServiceImpl.java
...a/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
+5
-5
Sign.java
...service/src/main/java/cn/wisenergy/service/util/Sign.java
+52
-0
application.yml
wisenergy-web-admin/src/main/resources/application.yml
+1
-1
No files found.
wisenergy-service/pom.xml
View file @
b9c3bddf
...
...
@@ -47,6 +47,18 @@
<version>
4.11.33.ALL
</version>
</dependency>
<!--微信支付-->
<dependency>
<groupId>
com.github.wechatpay-apiv3
</groupId>
<artifactId>
wechatpay-apache-httpclient
</artifactId>
<version>
0.2.1
</version>
</dependency>
<dependency>
<groupId>
com.squareup.okhttp3
</groupId>
<artifactId>
okhttp
</artifactId>
<version>
3.6.0
</version>
</dependency>
<!--pdf导出 -->
<dependency>
<groupId>
com.itextpdf
</groupId>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
View file @
b9c3bddf
...
...
@@ -278,11 +278,11 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
return
R
.
error
(
"用户信息不存在,无法重置密码!"
);
}
//验证验证码
R
<
Boolean
>
bool
=
sendSmsSerVice
.
valid
(
userVo
.
getPhone
(),
userVo
.
getCode
(),
userVo
.
getScene
(),
userVo
.
getSource
());
if
(
null
!=
bool
&&
bool
.
getCode
()
==
ERROR_CODE
)
{
return
R
.
ok
(
1
,
false
);
}
//
//验证验证码
//
R<Boolean> bool = sendSmsSerVice.valid(userVo.getPhone(), userVo.getCode(), userVo.getScene(), userVo.getSource());
//
if (null != bool && bool.getCode() == ERROR_CODE) {
//
return R.ok(1, false);
//
}
//3、设置新密码
String
password
=
Md5Util
.
digestMD5
(
userVo
.
getPassword
()
+
userVo
.
getPhone
());
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/util/Sign.java
0 → 100644
View file @
b9c3bddf
package
cn
.
wisenergy
.
service
.
util
;
import
okhttp3.HttpUrl
;
import
java.io.UnsupportedEncodingException
;
import
java.security.*
;
import
java.util.Base64
;
public
class
Sign
{
String
schema
=
"WECHATPAY2-SHA256-RSA2048"
;
String
url
=
"https://api.mch.weixin.qq.com/v3/certificates"
;
HttpUrl
httpurl
=
HttpUrl
.
parse
(
url
);
String
yourMerchantId
=
""
;
String
yourCertificateSerialNo
=
""
;
String
getToken
(
String
method
,
HttpUrl
url
,
String
body
)
throws
UnsupportedEncodingException
,
SignatureException
,
NoSuchAlgorithmException
,
InvalidKeyException
{
String
nonceStr
=
"your nonce string"
;
long
timestamp
=
System
.
currentTimeMillis
()
/
1000
;
String
message
=
buildMessage
(
method
,
url
,
timestamp
,
nonceStr
,
body
);
String
signature
=
sign
(
message
.
getBytes
(
"utf-8"
));
return
"mchid=\""
+
yourMerchantId
+
"\","
+
"nonce_str=\""
+
nonceStr
+
"\","
+
"timestamp=\""
+
timestamp
+
"\","
+
"serial_no=\""
+
yourCertificateSerialNo
+
"\","
+
"signature=\""
+
signature
+
"\""
;
}
String
sign
(
byte
[]
message
)
throws
NoSuchAlgorithmException
,
SignatureException
,
InvalidKeyException
{
Signature
sign
=
Signature
.
getInstance
(
"SHA256withRSA"
);
PrivateKey
yourPrivateKey
=
null
;
sign
.
initSign
(
yourPrivateKey
);
sign
.
update
(
message
);
return
Base64
.
getEncoder
().
encodeToString
(
sign
.
sign
());
}
String
buildMessage
(
String
method
,
HttpUrl
url
,
long
timestamp
,
String
nonceStr
,
String
body
)
{
String
canonicalUrl
=
url
.
encodedPath
();
if
(
url
.
encodedQuery
()
!=
null
)
{
canonicalUrl
+=
"?"
+
url
.
encodedQuery
();
}
return
method
+
"\n"
+
canonicalUrl
+
"\n"
+
timestamp
+
"\n"
+
nonceStr
+
"\n"
+
body
+
"\n"
;
}
}
wisenergy-web-admin/src/main/resources/application.yml
View file @
b9c3bddf
...
...
@@ -3,7 +3,7 @@ server:
uri-encoding
:
UTF-8
max-threads
:
1000
min-spare-threads
:
30
port
:
80
83
port
:
80
97
connection-timeout
:
5000ms
spring
:
...
...
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