Commit b9c3bddf authored by licc's avatar licc

修改端口

parent dd4f5ef5
...@@ -47,6 +47,18 @@ ...@@ -47,6 +47,18 @@
<version>4.11.33.ALL</version> <version>4.11.33.ALL</version>
</dependency> </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导出 --> <!--pdf导出 -->
<dependency> <dependency>
<groupId>com.itextpdf</groupId> <groupId>com.itextpdf</groupId>
......
...@@ -278,11 +278,11 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme ...@@ -278,11 +278,11 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
return R.error("用户信息不存在,无法重置密码!"); return R.error("用户信息不存在,无法重置密码!");
} }
//验证验证码 // //验证验证码
R<Boolean> bool = sendSmsSerVice.valid(userVo.getPhone(), userVo.getCode(), userVo.getScene(), userVo.getSource()); // R<Boolean> bool = sendSmsSerVice.valid(userVo.getPhone(), userVo.getCode(), userVo.getScene(), userVo.getSource());
if (null != bool && bool.getCode() == ERROR_CODE) { // if (null != bool && bool.getCode() == ERROR_CODE) {
return R.ok(1, false); // return R.ok(1, false);
} // }
//3、设置新密码 //3、设置新密码
String password = Md5Util.digestMD5(userVo.getPassword() + userVo.getPhone()); String password = Md5Util.digestMD5(userVo.getPassword() + userVo.getPhone());
......
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";
}
}
...@@ -3,7 +3,7 @@ server: ...@@ -3,7 +3,7 @@ server:
uri-encoding: UTF-8 uri-encoding: UTF-8
max-threads: 1000 max-threads: 1000
min-spare-threads: 30 min-spare-threads: 30
port: 8083 port: 8097
connection-timeout: 5000ms connection-timeout: 5000ms
spring: spring:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment