|
@@ -21,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
import static com.xy.utils.Beans.copy;
|
|
@@ -65,9 +66,10 @@ public class SysDictLogServiceImpl extends ServiceImpl<SysDictLogMapper, SysDict
|
|
|
*/
|
|
|
public boolean handleLog(SysDictLog sysDictLog, EnumSysDictOperateType operateType) {
|
|
|
// 判断当前环境是否为测试环境
|
|
|
- String activeProfile = environment.getActiveProfiles()[0];
|
|
|
- log.info("当前环境:{}", activeProfile);
|
|
|
- if (!activeProfile.equals("uat")) {
|
|
|
+ String[] activeProfiles = environment.getActiveProfiles();
|
|
|
+ log.info("当前环境:{}", activeProfiles);
|
|
|
+ boolean isTestEnvironment = Arrays.asList(activeProfiles).contains("uat");
|
|
|
+ if (!isTestEnvironment) {
|
|
|
return false; // 如果不是测试环境,返回false
|
|
|
}
|
|
|
sysDictLog.setId(null);
|