ruoyi-admin/src/main/resources/application-prod.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ruoyi-admin/src/main/resources/application-test.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ruoyi-applet/src/main/resources/application-prod.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ruoyi-applet/src/main/resources/application-test.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ruoyi-common/src/main/java/com/ruoyi/common/utils/TencentMailUtil.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ruoyi-admin/src/main/resources/application-prod.yml
@@ -14,14 +14,13 @@ addressEnabled: false # 验证码类型 math 数字计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8081 port: 8080 servlet: # 应用的访问路径 context-path: /admin context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 @@ -70,13 +69,20 @@ # redis 配置 redis: # 地址 # host: 127.0.0.1 # # 端口,默认为6379 # port: 6379 # # 数据库索引 # database: 0 # # 密码 # password: 123456 host: 127.0.0.1 # 端口,默认为6379 port: 6379 port: 16379 # 数据库索引 database: 0 # 密码 password: 123456 password: 8f5z9g52gx4bg # 连接超时时间 timeout: 10s lettuce: @@ -89,16 +95,16 @@ max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # 数据源配置 # 数据源配置 datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver druid: # 主库数据源 master: url: jdbc:mysql://127.0.0.1:10633/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai username: root password: XiZang@2025! url: jdbc:mysql://172.27.0.13:3306/xizang?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai username: xzgt password: changyun!6f2gshj6h3j # 从库数据源 slave: # 从数据源开关/默认关闭 @@ -149,7 +155,6 @@ wall: config: multi-statement-allow: true # token配置 token: # 令牌自定义标识 @@ -167,7 +172,7 @@ db-config: logic-not-delete-value: 0 logic-delete-value: 1 type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.vo type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.vo,com.ruoyi.**.model # 指定Mapper文件位置 mapper-locations: classpath*:mapper/**/*.xml @@ -193,10 +198,12 @@ qrLocation: /file/qrCode/ accessPath: /file/ allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF url: prefix: https://xzgt.test.591taxi.cn:${server.port}${server.servlet.context-path} wx: config: appId: wxc3985a05da7d86dc secret: 5cca42633c25439613b328c08ef20cc9 conf: appId: wxe91f1af7638aa5dd secretId: a787e1a462715604e0c9528b6d8960d1 #OSS及短信配置 code: config: @@ -214,6 +221,12 @@ bucketAddr: ap-chengdu rootSrc: https://xzgttest-1305134071.cos.ap-chengdu.myqcloud.com/ location: /xizang sms: enable: true appId: 1400957506 secretid: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x secretkey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU sign: 畅云出行 com: taxi591: bank: ruoyi-admin/src/main/resources/application-test.yml
@@ -199,7 +199,8 @@ accessPath: /file/ allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF url: prefix: http://localhost:${server.port}${server.servlet.context-path} # prefix: http://localhost:${server.port}${server.servlet.context-path} prefix: https://xzgt.test.591taxi.cn:${server.port}${server.servlet.context-path} wx: conf: appId: wxe91f1af7638aa5dd ruoyi-applet/src/main/resources/application-prod.yml
@@ -70,13 +70,20 @@ # redis 配置 redis: # 地址 # host: 127.0.0.1 # # 端口,默认为6379 # port: 6379 # # 数据库索引 # database: 0 # # 密码 # password: 123456 host: 127.0.0.1 # 端口,默认为6379 port: 6379 port: 16379 # 数据库索引 database: 0 # 密码 password: 123456 password: 8f5z9g52gx4bg # 连接超时时间 timeout: 10s lettuce: @@ -89,16 +96,16 @@ max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # 数据源配置 # 数据源配置 datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver druid: # 主库数据源 master: url: jdbc:mysql://127.0.0.1:10633/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai username: root password: XiZang@2025! url: jdbc:mysql://172.27.0.13:3306/xizang?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai username: xzgt password: changyun!6f2gshj6h3j # 从库数据源 slave: # 从数据源开关/默认关闭 @@ -149,7 +156,6 @@ wall: config: multi-statement-allow: true # token配置 token: # 令牌自定义标识 @@ -167,7 +173,7 @@ db-config: logic-not-delete-value: 0 logic-delete-value: 1 type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.vo type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.vo,com.ruoyi.**.model # 指定Mapper文件位置 mapper-locations: classpath*:mapper/**/*.xml @@ -193,10 +199,12 @@ qrLocation: /file/qrCode/ accessPath: /file/ allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF url: prefix: https://xzgt.test.591taxi.cn:${server.port}${server.servlet.context-path} wx: config: appId: wxc3985a05da7d86dc secret: 5cca42633c25439613b328c08ef20cc9 conf: appId: wxe91f1af7638aa5dd secretId: a787e1a462715604e0c9528b6d8960d1 #OSS及短信配置 code: config: @@ -219,4 +227,4 @@ appId: 1400957506 secretid: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x secretkey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU sign: 畅云出行 sign: 畅云出行 ruoyi-applet/src/main/resources/application-test.yml
@@ -199,6 +199,9 @@ qrLocation: /file/qrCode/ accessPath: /file/ allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF url: # prefix: http://localhost:${server.port}${server.servlet.context-path} prefix: https://xzgt.test.591taxi.cn:${server.port}${server.servlet.context-path} wx: conf: appId: wxe91f1af7638aa5dd ruoyi-common/src/main/java/com/ruoyi/common/utils/TencentMailUtil.java
@@ -121,27 +121,20 @@ try { // 创建邮件会话 Session mailSession = Session.getInstance(getMailProperties(), getAuthenticator()); // 创建邮件消息 MimeMessage message = new MimeMessage(mailSession); // 设置发件人 InternetAddress from = new InternetAddress(properties.getUserAddr(), properties.getUserName()); message.setFrom(from); // 设置收件人 InternetAddress to = new InternetAddress(emailAddress); message.setRecipient(MimeMessage.RecipientType.TO, to); // 设置邮件标题 message.setSubject("发票"); // 创建邮件内容 Multipart multipart = createMultipart(list); // 设置邮件内容 message.setContent(multipart); // 发送邮件 Transport.send(message); } catch (MessagingException | UnsupportedEncodingException | MalformedURLException e) { @@ -160,7 +153,8 @@ props.put("mail.user", properties.getUserAddr()); props.put("mail.password", properties.getPassword()); props.setProperty("mail.smtp.socketFactory.fallback", "false"); props.put("mail.smtp.ssl.enable", "false"); props.put("mail.smtp.ssl.enable", "true"); props.put("mail.smtp.ssl.protocols", "TLSv1.2"); return props; } @@ -175,42 +169,35 @@ }; } private Multipart createMultipart(List<Map<String, String>> list) throws MessagingException, UnsupportedEncodingException, MalformedURLException { Multipart multipart = new MimeMultipart(); // 添加文本消息部分 BodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setHeader("Content-Type", "text/plain;charset=utf-8"); messageBodyPart.setContent("您在小程序提交的开票申请已开票成功,请查看附件内容","text/html;charset=UTF-8"); multipart.addBodyPart(messageBodyPart); // 添加附件部分 for (Map<String, String> map : list) { messageBodyPart = new MimeBodyPart(); String url = map.get("url"); String fileName = map.get("fileName"); URLDataSource source = new URLDataSource(new URL(url)); messageBodyPart.setDataHandler(new DataHandler(source)); String filenameEncode = MimeUtility.encodeText(fileName, "UTF-8", "base64"); messageBodyPart.setFileName(filenameEncode); messageBodyPart.setHeader("Content-Transfer-Encoding", "base64"); messageBodyPart.setHeader("Content-Disposition", "attachment"); messageBodyPart.setHeader("Content-Type", "application/octet-stream;name=\"" + filenameEncode + "\""); multipart.addBodyPart(messageBodyPart); } return multipart; } public static void main(String[] args) throws UnsupportedEncodingException { TencentMailUtil tencentMailUtil = new TencentMailUtil(); MailProperties properties = new MailProperties(); tencentMailUtil.properties = properties; tencentMailUtil.send("645025773@qq.com","大学城揽院24栋"); } // public static void main(String[] args) throws UnsupportedEncodingException { // TencentMailUtil tencentMailUtil = new TencentMailUtil(); // MailProperties properties = new MailProperties(); // tencentMailUtil.properties = properties; // tencentMailUtil.send("645025773@qq.com","大学城揽院24栋"); // } }