fanxp il y a 1 an
Parent
commit
c9ce72c017

+ 3 - 1
docker-compose.yml

@@ -19,7 +19,9 @@ services:
           cpus: '0.50'
           memory: 2048M
     labels:
-      - "traefik.http.routers.tl_api.rule=Host(`test.tl.api.yingcaibx.com`)"
+      - "traefik.http.routers.tl_api.rule=Host(`test.tl.web.yingcaibx.com`) && PathPrefix(`/api`)"
+      - "traefik.http.routers.tl_api.middlewares=tl_api-stripprefix"
+      - "traefik.http.middlewares.tl_api-stripprefix.stripprefix.prefixes=/api"
       - "traefik.http.routers.tl_api.entrypoints=websecure"
       - "traefik.http.routers.tl_api.tls.certresolver=yxt"
 

+ 12 - 6
src/main/java/com/xjrsoft/common/sms/SmsCtcc.java

@@ -62,17 +62,23 @@ public class SmsCtcc {
      * @param code   验证码
      * @return {"message":"提交成功","taskId":7103189661382795265,"status":1} || {"message":"提交数据错误","status":2}
      */
-    public JSONObject sendCaptcha(String mobile, String code) {
+    public JSONObject sendCaptcha(String mobile, String code, boolean isSend) {
         String key = GlobalConstant.CAPTCHA + mobile;
         if (redisUtil.containsKey(key)) {
             throw new MyException("验证码发送频繁,请稍后再试!");
         }
-        String content = String.format("验证码为%s,有效时间为%d分钟,请勿将验证码泄露给其他人。", code, 2);
-//        JSONObject result = send(mobile, content);
-//        if (result.getInt("status") == 1) {
+        if (isSend) {
+            String content = String.format("验证码为%s,有效时间为%d分钟,请勿将验证码泄露给其他人。", code, 2);
+            JSONObject result = send(mobile, content);
+            if (result.getInt("status") == 1) {
+                redisUtil.set(key, code, 120L);
+            }else{
+                throw new MyException("验证码发送失败!");
+            }
+            return result;
+        }else{
             redisUtil.set(key, code, 120L);
-//        }
-//        return result;
+        }
         return null;
     }
 

+ 20 - 13
src/main/java/com/xjrsoft/module/system/controller/LoginController.java

@@ -3,10 +3,12 @@ package com.xjrsoft.module.system.controller;
 import cn.dev33.satoken.session.SaSession;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.spring.SpringUtil;
 import cn.hutool.jwt.JWT;
 import cn.hutool.jwt.JWTUtil;
 import com.baomidou.mybatisplus.core.toolkit.StringPool;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.yulichang.toolkit.SpringContentUtils;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.EnabledMark;
@@ -93,20 +95,25 @@ public class LoginController {
     @ApiOperation(value = "发送验证码", notes = "传入账号:mobile")
     public R captcha(@RequestBody @Valid CaptchaDto captchaDto) {
 
-//        String captchaCode = redisUtil.get(captchaDto.getKey(), 0);
-//        if (captchaCode == null) {
-//            throw new MyException("验证码已过期,请刷新验证码!");
-//        }
-//
-//        if (!captchaCode.equals(captchaDto.getCode())) {
-//            throw new MyException("验证码不正确,请刷新验证码!");
-//        }
-
-        //生成六位数的字符串
-        String code = RandomUtils.nextInt(100000, 999999) + StringPool.EMPTY;
-
-        smsCtcc.sendCaptcha(captchaDto.getMobile(), "111111");
+        String active = SpringUtil.getActiveProfile();
+        String code = "111111";
 
+        // 测试环境使用模拟短信,正式环境才发送短信
+        if (active.equals("prod")) {
+//            String captchaCode = redisUtil.get(captchaDto.getKey(), 0);
+//            if (captchaCode == null) {
+//                throw new MyException("验证码已过期,请刷新验证码!");
+//            }
+//
+//            if (!captchaCode.equals(captchaDto.getCode())) {
+//                throw new MyException("验证码不正确,请刷新验证码!");
+//            }
+            //生成六位数的字符串
+            code = RandomUtils.nextInt(100000, 999999) + StringPool.EMPTY;
+            smsCtcc.sendCaptcha(captchaDto.getMobile(), code, true);
+        } else {
+            smsCtcc.sendCaptcha(captchaDto.getMobile(), code, false);
+        }
         return R.ok(Boolean.TRUE);
     }
 

+ 45 - 24
src/main/resources/application-prod.yml

@@ -9,16 +9,16 @@ spring:
       datasource:
         master:
           driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://114.116.210.204:3306/xjrsoft_boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+          url: jdbc:mysql://219.153.208.35:3306/smart_campus?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&autoReconnect=true&failOverReadOnly=false
           username: root
-          password: Xjrsoft9012@@
+          password: xzNDL3dcx#TyEz^a
 
 
   redis:
-    database: 11
-    host: 114.116.210.204
+    database: 10
+    host: 219.153.208.35
     port: 6379
-    password: xjrsoft   # 密码(默认为空)
+    password: huHJMucfC!tJ59Ri   # 密码(默认为空)
     timeout: 6000ms  # 连接超时时长(毫秒)
     jedis:
       pool:
@@ -27,29 +27,35 @@ spring:
         max-idle: 10      # 连接池中的最大空闲连接
         min-idle: 5       # 连接池中的最小空闲连接
 
-#logging:
-#  level:
-#    org.camunda: none #打印camunda 日志  一般用于 查看camunda  执行sql
+logging:
+  level:
+    org.camunda: debug #打印camunda 日志  一般用于 查看camunda  执行sql
+
+# 课表时段
+timetable:
+  summer-start: 05-01
+  summer-end: 09-30
+  winter-start: 10-01
+  winter-end: 04-30
+
+mqtt:
+  username: admin
+  password: c94kKEhkYfMSiQh8
+  server: tcp://219.153.208.35:1880
+  qos: 1
 
 xjrsoft:
   oss:
     #enabled: true
-    cloud-type: alicloud
-    #    access-key: xjrsoft
-    #    secret-key: Xjrsoft9012@@
-    #    endpoint: http://47.106.153.7:9000
-    #    bucket-name: xjrsoft
-    #    prefix: xjr
-    #阿里云
-    access-key: LTAI5t79TMdxqDVJoAyL56aT
-    secret-key: jzWa5TzDBQDg0y7hxbwAyVg7C0pi5l
-    endpoint: oss-cn-hangzhou.aliyuncs.com
+    cloud-type: minio
+    access-key: ycbx
+    secret-key: qwe123QWE
+    endpoint: https://test.minio.yingcaibx.com
     bucket-name: learun
     prefix: xjr
-
   generate:
     webPath: E:\code\font\xjrsoft-vue3 #生成代码的路径
-    appPath: E:\code\font\xjrVue   #前端app
+    appPath: E:\code\uniapp\xjrsoft-uni   #前端app
   common:
     druid-account: admin # druid 监控账户
     druid-password: admin # druid 监控密码
@@ -65,6 +71,8 @@ xjrsoft:
       - /druid/**         #druid 监控
       - /ureport/**
       - /system/captcha    # 验证码
+      - /system/imgcaptcha #图形验证码
+      - /system/loginCaptcha # 手机验证登录
       - /system/login      # 登录接口
       - /system/logout     # 登出接口
       - /camunda/**        # camunda工作台
@@ -72,6 +80,8 @@ xjrsoft:
       - /${magic-api.web}/**    # magic-api web
       - /${magic-api.prefix}/** # magic-api 前缀
       - /bi/project/info # 桌面
+      - /system/loginByCode #编号登录
+      - /organization/user/register # 注册
   email:
     host:  #邮件服务器的SMTP地址,可选,默认为smtp.<发件人邮箱后缀>
     port:  # 邮件服务器的SMTP端口,可选,默认25
@@ -84,6 +94,9 @@ xjrsoft:
     secret: 02YXuJw_vYYJiDQvG-eKlXCUTDAaAJ1z7m9t8_hqoa0
     secret1: z3R17Od4ROW1zPisguiQmTfx0NvcYKmoIu19-82vdtU
     agentid: 1000003
+  mpWeixin:
+    appKey: wx93175d7fe68cd170
+    appSecret: 4bab1c5ccd9d4d1d7854464d7251becf
   dingtalk:
     appKey: dingaex2gok1rllumlqs
     appSecret: Nv2pe-UoR0Z_Iw8d29laZfL3kH6ElmhZpRdPwI7SvmKJmaCI29qCrSlFEiMM88MB
@@ -112,15 +125,23 @@ xjrsoft:
     platform: HW_CLOUD #默认使用短信服务商
     captcha-sender: 8823053028920 #验证码通道号
     captcha-template-id: 97c6fcf9fd0149b39c0ed0e53480116f # 验证码 模板id
-    notify-sender: 8823053111843 # 提示类短信 通道号
+    notify-sender: 8823053111843 # 提示类提示短信 通道号
     notify-template-id: d424de0f2a9244ac9d2f2685cd158635 #提示类短信 模板id
+    circulated-sender: 8823053111843 # 提示类传阅短信 通道号
+    circulated-template-id: 5c179070a72447c79568ac22371be803 #提示类传阅短信 模板id
+    timeout-sender: 8823053111843 # 提示类短超时信 通道号
+    timeout-template-id: 5c179070a72447c79568ac22371be803 #提示类超时短信 模板id
+  ctccsms: #电信三网短信配置
+    app-key: 105649
+    app-secret: c3868470891526d9
+    signature: "【重庆市铜梁职业教育中心】"
   license:
-    enabled: false                   #是否需要验证
+    enabled: false                  #是否需要验证
     login-max: 100                  #最大登陆人数
     start-time: 2023-07-01 00:00:00 #开始时间
-    end-time: 2023-07-05 00:00:00   #结束时间
+    end-time: 2023-07-03 17:00:00   #结束时间
     company-name: xxx               #公司名
-    contact-number: xxx
+    contact-number: xxx             #联系人
 
 sms:
   huawei:

+ 1 - 0
src/main/resources/sqlScript/init_data.sql

@@ -1,3 +1,4 @@
+insert xjr_role(id,name,code,sort_code,remark,create_user_id,create_date,delete_mark,enabled_mark) value(1,'超级管理员','ADMIN',2,'超级管理员',1,'2021-07-25 20:42:11',0,1);
 insert xjr_role(id,name,code,sort_code,remark,create_user_id,create_date,delete_mark,enabled_mark) value(2,'教师','TEACHER',2,'教师',1,'2021-07-25 20:42:11',0,1);
 insert xjr_role(id,name,code,sort_code,remark,create_user_id,create_date,delete_mark,enabled_mark) value(3,'学生','STUDENT',3,'学生',1,'2021-07-25 20:42:11',0,1);
 insert xjr_role(id,name,code,sort_code,remark,create_user_id,create_date,delete_mark,enabled_mark) value(4,'家长','PARENT',4,'家长',1,'2021-07-25 20:42:11',0,1);

+ 25 - 2
src/main/resources/sqlScript/init_sql.sql

@@ -735,8 +735,8 @@ CREATE TABLE `base_car_park_records`  (
   `in_time` datetime not null COMMENT '进场时间',
   `out_time` datetime COMMENT '出场时间',
   `status` tinyint(4) unsigned default 1 not null COMMENT '状态 1=进 2=出',
-  `in_passing` tinyint(4) unsigned default 0 not null COMMENT '进类型 0=识别过车  1=人工处置',
-  `out_passing` tinyint(4) unsigned default 0 not null COMMENT '出类型 0=识别过车  1=人工处置',
+  `in_passing` tinyint(4) unsigned default 0 not null COMMENT '进类型 0=识别过车  1=手工进免费车 2=手工进临时车 3=匹配进车',
+  `out_passing` tinyint(4) unsigned default 0 not null COMMENT '出类型 0=识别过车  1=手工出免费车 2=手工进临时车 3=匹配进车',
   `remark` varchar(500) COMMENT '备注',
   `c_sync_id` int default 0 not null COMMENT '数据同步编号',
   PRIMARY KEY (`id`) USING BTREE
@@ -874,4 +874,27 @@ create table course_table
     primary key (`id`)
 ) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment '课表';
 
+-- ----------------------------
+-- 三方客户端管理
+-- ----------------------------
+drop table if exists oauth_client_details;
+create table oauth_client_details
+(
+    id bigint not null comment '主键编号' ,
+    `client_id` varchar(100) not null COMMENT '应用标识',
+    `client_name` varchar(200) not null COMMENT '应用名称',
+    `client_secret` varchar(200) not null COMMENT '应用密钥',
+    `web_server_redirect_uri` varchar(2000) not null COMMENT '回调地址',
+    `scope` varchar(200) not null default 'all' COMMENT '授权',
+    access_token_validity_seconds bigint not null default 3600 comment '令牌时效(s)' ,
+    refresh_token_validity_seconds bigint not null default 28800 comment '刷新时效(s)' ,
+    authorized_grant_types varchar(1000) not null default 'authorization_code,password,client_credentials,implicit,refresh_token,password_code,openId,mobile_password' COMMENT '授权模式',
+    status int not null default 1 comment '状态 1=启用 2=禁用',
+    `create_date` date null default null COMMENT '创建时间',
+    `modify_date` date null default null COMMENT '修改时间',
+    `delete_mark` int NOT NULL COMMENT '删除标记',
+    `enabled_mark` int NOT NULL COMMENT '有效标志',
+    primary key (`id`)
+) engine=innodb default charset=utf8mb4 COLLATE = utf8mb4_0900_ai_ci comment 'oauth用户列表';
+
 SET FOREIGN_KEY_CHECKS = 1;