From 10f226826f5e7a65d7ffb874dbac6159593b7728 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Sun, 25 Dec 2022 15:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/ext/wms/rest/AcsToWmsController.java | 2 ++ .../acs/ext/wms/rest/WmsToAcsController.java | 2 +- .../modules/common/utils/SecurityUtils.java | 7 ++++- .../resources/config/application-prod.yml | 26 +++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java index 84a7905..87eaa35 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java @@ -2,6 +2,7 @@ package org.nl.acs.ext.wms.rest; +import cn.dev33.satoken.annotation.SaIgnore; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; @@ -28,6 +29,7 @@ import java.util.Map; @Api(tags = "wms接口") @RequestMapping("/api/wms") @Slf4j +@SaIgnore public class AcsToWmsController { private final AcsToWmsService acstowmsService; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index 769893e..26a4e22 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -26,13 +26,13 @@ import org.springframework.web.bind.annotation.RestController; @Api(tags = "wms接口") @RequestMapping("/api/wms") @Slf4j +@SaIgnore public class WmsToAcsController { private final WmsToAcsService wmstoacsService; @PostMapping("/task") @Log("接收WMS任务") @ApiOperation("接收WMS任务") - @SaIgnore public ResponseEntity createFromWms(@RequestBody String whereJson) { return new ResponseEntity<>(wmstoacsService.createFromWms(whereJson), HttpStatus.OK); } diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/common/utils/SecurityUtils.java b/acs/nladmin-system/src/main/java/org/nl/modules/common/utils/SecurityUtils.java index 3c5bd75..2114a4a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/common/utils/SecurityUtils.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/common/utils/SecurityUtils.java @@ -31,7 +31,12 @@ public class SecurityUtils { } catch (Exception e) { return new CurrentUser(); } - return null; + // 给一个acs + CurrentUser currentUser = new CurrentUser(); + currentUser.setId(2L); + currentUser.setUsername("acs"); + currentUser.setNickName("ACS系统"); + return currentUser; } /** diff --git a/acs/nladmin-system/src/main/resources/config/application-prod.yml b/acs/nladmin-system/src/main/resources/config/application-prod.yml index c3d9781..3b734b7 100644 --- a/acs/nladmin-system/src/main/resources/config/application-prod.yml +++ b/acs/nladmin-system/src/main/resources/config/application-prod.yml @@ -139,3 +139,29 @@ logging: file: path: /app/jar/logs config: classpath:logback-spring.xml + +# Sa-Token配置 +sa-token: + # token 名称 (同时也是cookie名称) + token-name: Authorization + # token 有效期,单位s 默认30天, -1代表永不过期 + timeout: 2592000 + # token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 + activity-timeout: -1 + # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) + is-share: false + # token风格 + token-style: random-128 + # 是否输出操作日志 + is-log: false + jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq + # token 前缀 + token-prefix: Bearer + is-read-cookie: false + is-read-body: false + +loki: + url: http://localhost:3100/loki/api/v1 + systemName: acs