修改--修改druid默认账号密码
This commit is contained in:
parent
d404295269
commit
cfe7eb323f
@ -88,13 +88,16 @@ public class WxAuthController {
|
||||
// 当前用户的微信账号id
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
|
||||
// 微信用户账号
|
||||
SysUser sysUserWx = sysUserService.selectUserById(userId);
|
||||
|
||||
|
||||
|
||||
// 若存在手机号说明该微信账号已经绑定过手机号.
|
||||
if(!sysUserWx.getPhonenumber().isEmpty()){
|
||||
System.out.println("用户手机号: "+ sysUserWx.getPhonenumber());
|
||||
return AjaxResult.error("该账号已绑定, 请不要重复绑定手机号");
|
||||
return AjaxResult.warn("该账号已绑定, 请不要重复绑定手机号");
|
||||
}
|
||||
|
||||
//更新账号手机号信息
|
||||
|
||||
@ -153,6 +153,9 @@ public class ApiController extends BaseController {
|
||||
if (!sms.equals(xmLoginDto.getSmsCode())) {
|
||||
return AjaxResult.error("短信验证码错误");
|
||||
}
|
||||
// 删除短信验证码
|
||||
redisCache.deleteObject("SMSCODE:" + xmLoginDto.getPhone());
|
||||
|
||||
//-------------------------------end 验证码--------------------------------
|
||||
SysUser sysUser = sysUserService.selectUserByUserName(xmLoginDto.getPhone());
|
||||
System.out.println(sysUser);
|
||||
@ -209,18 +212,29 @@ public class ApiController extends BaseController {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping("/sendSmsCode")
|
||||
@PostMapping ("/sendSmsCode")
|
||||
public AjaxResult loginPhone(@RequestBody XmLoginDto xmLoginDto) throws Exception {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
|
||||
//------------------测试时可以注释掉---------------------------
|
||||
// 验证码校验 但是不删除校验码
|
||||
loginService.validateCaptchaOne(xmLoginDto.getPhone(), xmLoginDto.getImgCode(), xmLoginDto.getUuid());
|
||||
//--------------------测试时注释掉结束
|
||||
|
||||
|
||||
//上面已经验证成功了
|
||||
Random random = new Random();
|
||||
String smsCode = String.valueOf(100000 + random.nextInt(900000));
|
||||
|
||||
// if(redisCache.hasKey("SMSCODE:" + xmLoginDto.getPhone())){
|
||||
// return AjaxResult.error("验证码已发送, 请不要多次点击发送验证码, 请2分钟后再试");
|
||||
//
|
||||
// }
|
||||
SendSms.sendSmsCode(xmLoginDto.getPhone(), smsCode);
|
||||
System.out.println("phone 发送短信验证码成功: "+ xmLoginDto.getPhone());
|
||||
System.out.println("验证码是"+smsCode);
|
||||
// 将短信验证码存入redis
|
||||
redisCache.setCacheObject("SMSCODE:" + xmLoginDto.getPhone(), smsCode, 1, TimeUnit.HOURS);
|
||||
redisCache.setCacheObject("SMSCODE:" + xmLoginDto.getPhone(), smsCode, 2, TimeUnit.MINUTES);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ public class BackController {
|
||||
public String wxRechargeCallback(HttpServletRequest req, @PathVariable String type) throws Exception {
|
||||
String result = "failure";
|
||||
try {
|
||||
System.out.println("微信支付回调函数开始执行");
|
||||
System.out.println("支付回调函数开始执行");
|
||||
|
||||
|
||||
Map<String, Object> map = getParamsMap(req);
|
||||
|
||||
@ -118,18 +118,19 @@ public class PayController extends BaseController {
|
||||
model.setSubject("" + MCHNO + "");
|
||||
model.setBody(orderTitle + "[" + MCHNO + "]");
|
||||
|
||||
// model.setNotifyUrl("http://62.234.19.34:8991/wxPay/result/wxRechargeCallback/" + type); //APP端回调地址
|
||||
model.setNotifyUrl("https://cesuan.doni.link/wxPay/result/wxRechargeCallback/" + type); //微信端回调地址
|
||||
model.setNotifyUrl("http://62.234.19.34:8991/wxPay/result/wxRechargeCallback/" + type); //APP端回调地址
|
||||
// model.setNotifyUrl("https://cesuan.doni.link/wxPay/result/wxRechargeCallback/" + type); //微信端回调地址
|
||||
model.setReturnUrl("");
|
||||
model.setDivisionMode(divisionMode); //分账模式
|
||||
|
||||
//设置扩展参数
|
||||
JSONObject extParams = new JSONObject();
|
||||
|
||||
//// 返回图片二维码url----------解除注释就是不返回支付地址,而是返回支付二维码
|
||||
// if (StringUtils.isNotEmpty(payDataType)) {
|
||||
// extParams.put("payDataType", payDataType.trim());
|
||||
// }
|
||||
// 返回图片二维码url----------解除注释就是不返回支付地址,而是返回支付二维码--APP端支付
|
||||
if (StringUtils.isNotEmpty(payDataType)) {
|
||||
extParams.put("payDataType", payDataType.trim());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(authCode)) {
|
||||
extParams.put("authCode", authCode.trim());
|
||||
}
|
||||
|
||||
@ -6,6 +6,9 @@ import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.sms.v20210111.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//导入可选配置类
|
||||
// 导入对应SMS模块的client
|
||||
@ -69,7 +72,8 @@ public class SendSms {
|
||||
|
||||
/* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名 */
|
||||
// 签名信息可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-sign) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-sign) 的签名管理查看
|
||||
String signName = "易道艺公众号";
|
||||
// String signName = "易道艺公众号";
|
||||
String signName = "易道合一河北健康科技";
|
||||
req.setSignName(signName);
|
||||
|
||||
/* 模板 ID: 必须填写已审核通过的模板 ID */
|
||||
@ -90,6 +94,18 @@ public class SendSms {
|
||||
* 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
|
||||
SendSmsResponse res = client.SendSms(req);
|
||||
|
||||
SendStatus[] sendStatusSet = res.getSendStatusSet();
|
||||
for (SendStatus status : sendStatusSet) {
|
||||
System.out.println("PhoneNumber: " + status.getPhoneNumber());
|
||||
System.out.println("SerialNo: " + status.getSerialNo());
|
||||
System.out.println("Fee: " + status.getFee());
|
||||
System.out.println("SessionContext: " + status.getSessionContext());
|
||||
System.out.println("Code: " + status.getCode());
|
||||
System.out.println("Message: " + status.getMessage());
|
||||
}
|
||||
|
||||
// System.out.println(res);
|
||||
|
||||
// 输出json格式的字符串回包
|
||||
|
||||
// 也可以取出单个值,你可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义
|
||||
|
||||
@ -8,7 +8,12 @@ spring:
|
||||
# 主库数据源
|
||||
master:
|
||||
# url: jdbc:mysql://localhost:3306/xingming?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://172.17.0.3:3306/xingming?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
|
||||
# 郑老师
|
||||
url: jdbc:mysql://172.17.0.4:3306/xingming?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
#
|
||||
# 测算腾讯云 mysql地址
|
||||
# url: jdbc:mysql://172.17.0.4:3306/xingming?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
password: dnxxkj
|
||||
# password: root
|
||||
@ -50,8 +55,8 @@ spring:
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: ruoyi
|
||||
login-password: 123456
|
||||
login-username: dnxxkj
|
||||
login-password: dnxxkj0703xxxx!
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
|
||||
@ -7,7 +7,7 @@ ruoyi:
|
||||
# 版权年份
|
||||
copyrightYear: 2023
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
demoEnabled: False
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
@ -76,8 +76,10 @@ spring:
|
||||
enabled: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 172.17.0.4
|
||||
# 地址 郑老师腾讯云姓名学
|
||||
host: 172.17.0.5
|
||||
# 测算 腾讯云一年服务器 redis的地址
|
||||
# host: 172.17.0.3
|
||||
# host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
@ -103,8 +105,8 @@ token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
secret: abcdefghijklmnopqrstuvwxyzsfadxsev
|
||||
# 令牌有效期(默认30分钟) 默认单位分钟
|
||||
expireTime: 43200
|
||||
|
||||
# MyBatis配置
|
||||
@ -125,7 +127,7 @@ pagehelper:
|
||||
# Swagger配置
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
enabled: false
|
||||
# 请求前缀
|
||||
pathMapping: /dev-api
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user