فهرست منبع

接入门户配置

zhangcl 5 ساعت پیش
والد
کامیت
c5ab4dc4bc

+ 9 - 81
randd-server/src/main/resources/application-prod.yaml

@@ -50,34 +50,13 @@ spring:
           url: jdbc:mysql://172.21.20.20:3306/rqrd?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
           username: ruiqi
           password: .N_Mdq!BR1W4
-        #slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
-          #lazy: true # 开启懒加载,保证启动速度
-          #          url: jdbc:mysql://1.94.244.160:3306/rqiot?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
-          #url: jdbc:mysql://172.21.20.20:3306/yanfan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-          #username: ruiqi
-          #password: .N_Mdq!BR1W4
-        #yanfan:
-          #url: jdbc:mysql://172.21.20.20:3306/yanfan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-          #username: ruiqi
-          #password: .N_Mdq!BR1W4
-        #tdengine:
-          #enabled: true
-          #url: jdbc:TAOS-RS://172.21.10.65:6041/iot_log?allowMultiQueries=true
-          #username: root
-          #password: taosdata
-          #driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
   # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
-#  redis:
-#    host: localhost # 地址
-#    port: 6379 # 端口
-#    username: default
-#    database: 1 # 数据库索引
-#    password: r1q6IrEp@4s # 密码,建议生产环境开启
   redis:
     host: localhost # 地址
     port: 6379 # 端口
+    username: default
     database: 10  # 数据库索引
-    password: 123456
+    password: r1q6IrEp@4s
 
 mybatis-plus:
   configuration:
@@ -167,9 +146,9 @@ logging:
 
 --- #################### 钉微应用相关配置 ####################
 dingtalk:
-  AGENT_ID: 3687646006  # DeepOil 微应用 agent_id
-  APP_KEY: dingmr9ez0ecgbmscfeb # 钉钉微应用 appkey
-  APP_SECRET: VhG_zMdTvIBwA_0Ef8FJ0foH3VYYo5T-kw0ukX_PBA8Ah1xl7AjDw5RVYCU0DTpe # 钉钉微应用 appkey
+  AGENT_ID: 4849455173  # DeepOil 微应用 agent_id
+  APP_KEY: dingixs2wmtiduibhkck # 钉钉微应用 appkey
+  APP_SECRET: jO2SP-gNS7LHt64THBPXmAaBxPh_S01JSePzdbszmLGH8MhQ_4Al0zQG3MZ-qihB # 钉钉微应用 appkey
   GET_ACCESS_TOKEN_URL: https://oapi.dingtalk.com/gettoken  # 获取access_token
   URL_GET_USERINFO_BYCODE: https://oapi.dingtalk.com/sns/getuserinfo_bycode # 通过二维码扫码获取UNIONID
   URL_GET_USERINFO_BYUNIONID: https://oapi.dingtalk.com/topapi/user/getbyunionid # 通过UNIONID获取用户信息
@@ -178,18 +157,6 @@ dingtalk:
   URL_GET_SEND_MESSAGE: https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2 # 发送钉钉工作消息
   URL_GET_USERINFO_BYMOBILE: https://oapi.dingtalk.com/topapi/v2/user/getbymobile # 根据用户手机号获取钉钉用户信息 url
 
---- #################### SAP相关配置 ####################
-#sap:
-  #jco:
-    #ashost: 172.17.25.120
-    #sysnr: 00
-    #client: 901
-    #user: ZPMS
-    #passwd: Kr2024.0
-    #lang: zh
-    #pool_capacity: 10
-    #peak_limit: 20
-
 --- #################### 微信公众号相关配置 ####################
 wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
   mp:
@@ -226,8 +193,8 @@ justauth:
   enabled: true
   type:
     DINGTALK: # 钉钉
-      client-id: dingmr9ez0ecgbmscfeb
-      client-secret: VhG_zMdTvIBwA_0Ef8FJ0foH3VYYo5T-kw0ukX_PBA8Ah1xl7AjDw5RVYCU0DTpe
+      client-id: dingixs2wmtiduibhkck
+      client-secret: jO2SP-gNS7LHt64THBPXmAaBxPh_S01JSePzdbszmLGH8MhQ_4Al0zQG3MZ-qihB
       ignore-check-redirect-uri: true
       ignore-check-state: true
     WECHAT_ENTERPRISE: # 企业微信
@@ -250,51 +217,12 @@ justauth:
     prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
     timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
 
-
---- #################### iot相关配置 TODO 芋艿:再瞅瞅 ####################
-#iot:
-  #emq:
-    # 账号
-    #username: anhaohao
-    # 密码
-    #password: ahh@123456
-    # 主机地址
-    #hostUrl: tcp://chaojiniu.top:1883
-    # 客户端Id,不能相同,采用随机数 ${random.value}
-    #client-id: ${random.int}
-    # 默认主题
-    #default-topic: test
-    # 保持连接
-    #keepalive: 60
-    # 清除会话(设置为false,断开连接,重连后使用原来的会话 保留订阅的主题,能接收离线期间的消息)
-    #clearSession: true
-
-#yanfan:
-  #url: http://172.21.10.65
 # 插件配置
 pf4j:
   pluginsDir: ${user.home}/plugins # 插件目录
 system:
   url: https://rdm.deepoil.cc/
-
-#portal:
-  #secret: cc99d802-ce5c-5f62-b037-9a00726e7109
-
-#oa:
-  #register: https://172.17.25.231/api/ec/dev/auth/regist
-  #gettoken: https://172.17.25.231/api/ec/dev/auth/applytoken
-  #outMaintain: https://172.17.25.231/api/workflow/paService/doCreateRequest
-  #companyUrl: https://172.17.25.231/api/hrm/resful/getHrmsubcompanyWithPage
-  #departmentUrl: https://172.17.25.231/api/hrm/resful/getHrmdepartmentWithPage
-  #userUrl: https://172.17.25.231/api/hrm/resful/getHrmUserInfoWithPage
-  #workflowId: "640"
-  #requestName: "设备委外维修申请流程"
-  #  appid: EEAA5436-7577-4BE0-8C6C-89E9D88805EE
-  #  appid: EEAA5436-7577-4BE0-8C6C-89E9D88805E1
-  #appid: tw
-  #cpk: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApmtQUp9M82/z22P7am5owQCknjQnjF4U4ckEh7XVtJVQZrZx7d1lCPfoYrwOKEM4DEV7khW6++4Zv5caJ/9nqPn4QFwCqJWVmCEm9vC1BA6i2yfa4bmTxdR1/oeU/Af9pDFlvv5GC9XyilO7CIKu19Ce50v7aN6h1Tjix+h5Ba8e12XAEpEZk9pFroEYfR4lrecvi1pQOwRw8YzDRC4lhGNOo5Cen1rGjk7dwzzgs4uEv9ZyPZoVJnty5P9JE/ctboEf3x4jbqIliuCRgOyXYsLlp+N282CKcWZ35URkGw2orKyG1U6L1hNoj7kkpvAo8Zagf97SdZ0nYdRBIHv6PQIDAQAB
-  #oaSecret: kryfoa20250905@szh
-  #user: OAuser
-  #userid: cLPEaFs9moW6b3xZMl1kNNWAAo7bp61ZRRTKmpiJUe56hSxQvrC2vWtY5ogj7g5FAnUOlzYjYg9MRktKXcseh/nsvZCQGa3BAlYixlDJruV19y4Omx5dYnqu/qv2rJAqTzUS71sOwuB1M2nKlLVsphw1GF74UhGP4xsjpZP7mC8=
+portal:
+  secret: 71ba46d3-3dd4-5232-9b7e-75765b36897f
 file:
   upload-path: /rdfiles

+ 9 - 6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java

@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
 import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
+import cn.iocoder.yudao.framework.common.exception.ErrorCode;
+import cn.iocoder.yudao.framework.common.exception.ServiceException;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.security.config.SecurityProperties;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
@@ -26,6 +28,7 @@ import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.Parameters;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -66,10 +69,10 @@ public class AuthController {
     @Resource
     private SocialUserService socialUserService;
     /* @Value("${oa.oaSecret}")
-    private String oaSecret;
+    private String oaSecret; */
 
     @Value("${portal.secret}")
-    private String portalSecret; */
+    private String portalSecret;
 
     @PostMapping("/login")
     @PermitAll
@@ -219,9 +222,9 @@ public class AuthController {
     @PermitAll
     @TenantIgnore
     public CommonResult<AuthLoginRespVO> portalLogin(@RequestHeader("portal-secret") String secret, @RequestBody AuthPortalLoginReqVO reqVO) {
-        /* if (!portalSecret.equals(secret)){
+        if (!portalSecret.equals(secret)){
             throw new ServiceException(new ErrorCode(100, "验证失败"));
-        } */
+        }
         return success(authService.portalLogin(reqVO));
     }
 
@@ -237,9 +240,9 @@ public class AuthController {
     @TenantIgnore
     @Operation(summary = "第三方应用获取随机码 用于请求真正的token", description = "")
     public CommonResult<String> getToken(@RequestBody AuthPortalLoginReqVO reqVO) {
-        /* if (!portalSecret.equals(reqVO.getAppid())) {
+        if (!portalSecret.equals(reqVO.getAppid())) {
             throw new ServiceException(new ErrorCode(100, "验证失败"));
-        } */
+        }
         return success(authService.ssoGetToken(reqVO));
     }