Merge branch 'master' of http://121.40.234.130:8899/root/nladmin
# Conflicts: # nladmin-system/src/main/java/org/nl/wms/pda/mps/rest/OutController.java
This commit is contained in:
154
doc/兰州铜箔LMS系统接口.postman_collection.json
Normal file
154
doc/兰州铜箔LMS系统接口.postman_collection.json
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
{
|
||||||
|
"info": {
|
||||||
|
"_postman_id": "3fab44b6-d4fb-4afd-81ad-31f1ec49c8c4",
|
||||||
|
"name": "兰州铜箔LMS系统接口",
|
||||||
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
||||||
|
},
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "手持请求LMS",
|
||||||
|
"description": "",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "登录",
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"body": {},
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8010/api/param/getStageCodeByCode",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8010",
|
||||||
|
"path": [
|
||||||
|
"api",
|
||||||
|
"param",
|
||||||
|
"getStageCodeByCode"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LMS请求MES",
|
||||||
|
"description": "",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "http://localhost:8010/api/param/getStageCodeByCode",
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"body": {},
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8010/api/param/getStageCodeByCode",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8010",
|
||||||
|
"path": [
|
||||||
|
"api",
|
||||||
|
"param",
|
||||||
|
"getStageCodeByCode"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MES请求LMS",
|
||||||
|
"description": "",
|
||||||
|
"item": [],
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": [
|
||||||
|
{
|
||||||
|
"key": "token",
|
||||||
|
"value": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI2ZjI2OGMxZjAyOTE0MTNiOWU3YThmMTM2ZTc2MWJkYSIsImF1dGgiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.lKxY3Wc_efzmBXXAS_dDC_Sfh32kZInxYmaxBzg83e5gviSJPPKolNt4IlCCaGM8HOc_yKByiIu8YFlgQif01Q",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LMS请求CRM",
|
||||||
|
"description": "",
|
||||||
|
"item": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CRM请求MES",
|
||||||
|
"description": "",
|
||||||
|
"item": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ACS请求LMS",
|
||||||
|
"description": "",
|
||||||
|
"item": [],
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"id": "2f9e1cf4-d33b-4c2c-85fb-546f276da5b7",
|
||||||
|
"type": "text/javascript",
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"id": "d7ddf3ac-5ecf-4a01-ae1c-c491bd7b645b",
|
||||||
|
"type": "text/javascript",
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LMS请求ACS",
|
||||||
|
"description": "",
|
||||||
|
"item": [],
|
||||||
|
"event": [
|
||||||
|
{
|
||||||
|
"listen": "prerequest",
|
||||||
|
"script": {
|
||||||
|
"id": "2f9e1cf4-d33b-4c2c-85fb-546f276da5b7",
|
||||||
|
"type": "text/javascript",
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"listen": "test",
|
||||||
|
"script": {
|
||||||
|
"id": "d7ddf3ac-5ecf-4a01-ae1c-c491bd7b645b",
|
||||||
|
"type": "text/javascript",
|
||||||
|
"exec": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SAP请求LMS",
|
||||||
|
"description": "",
|
||||||
|
"item": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LMS请求SAP",
|
||||||
|
"description": "",
|
||||||
|
"item": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ import org.aspectj.lang.reflect.MethodSignature;
|
|||||||
import org.nl.modules.common.utils.RequestHolder;
|
import org.nl.modules.common.utils.RequestHolder;
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.utils.StringUtils;
|
import org.nl.modules.common.utils.StringUtils;
|
||||||
|
import org.nl.modules.common.utils.ThrowableUtil;
|
||||||
import org.nl.modules.logging.domain.Log;
|
import org.nl.modules.logging.domain.Log;
|
||||||
import org.nl.modules.logging.service.LogService;
|
import org.nl.modules.logging.service.LogService;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -132,8 +133,7 @@ public class LogAspect {
|
|||||||
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
|
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
|
||||||
Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get());
|
Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get());
|
||||||
currentTime.remove();
|
currentTime.remove();
|
||||||
// log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes());
|
log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes());
|
||||||
// log.setExceptionDetail(null);
|
|
||||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log);
|
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import cn.hutool.core.lang.Dict;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
import org.nl.modules.common.utils.PageUtil;
|
import org.nl.modules.common.utils.PageUtil;
|
||||||
@@ -33,10 +33,6 @@ import org.nl.modules.logging.service.LogService;
|
|||||||
import org.nl.modules.logging.service.dto.LogQueryCriteria;
|
import org.nl.modules.logging.service.dto.LogQueryCriteria;
|
||||||
import org.nl.modules.logging.service.mapstruct.LogErrorMapper;
|
import org.nl.modules.logging.service.mapstruct.LogErrorMapper;
|
||||||
import org.nl.modules.logging.service.mapstruct.LogSmallMapper;
|
import org.nl.modules.logging.service.mapstruct.LogSmallMapper;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.slf4j.Marker;
|
|
||||||
import org.slf4j.MarkerFactory;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -57,9 +53,8 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
public class LogServiceImpl implements LogService {
|
public class LogServiceImpl implements LogService {
|
||||||
private static final Marker MARKER = MarkerFactory.getMarker("request");
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(LogServiceImpl.class);
|
|
||||||
private final LogRepository logRepository;
|
private final LogRepository logRepository;
|
||||||
private final LogErrorMapper logErrorMapper;
|
private final LogErrorMapper logErrorMapper;
|
||||||
private final LogSmallMapper logSmallMapper;
|
private final LogSmallMapper logSmallMapper;
|
||||||
@@ -107,9 +102,7 @@ public class LogServiceImpl implements LogService {
|
|||||||
logDto.setMethod(methodName);
|
logDto.setMethod(methodName);
|
||||||
logDto.setUsername(username);
|
logDto.setUsername(username);
|
||||||
logDto.setParams(getParameter(method, joinPoint.getArgs()));
|
logDto.setParams(getParameter(method, joinPoint.getArgs()));
|
||||||
// logDto.setParams("");
|
|
||||||
logDto.setBrowser(browser);
|
logDto.setBrowser(browser);
|
||||||
log.info(MARKER,JSONObject.toJSONString(logDto));
|
|
||||||
logRepository.save(logDto);
|
logRepository.save(logDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,16 +25,10 @@ public class LokiController {
|
|||||||
|
|
||||||
private final LokiService lokiService;
|
private final LokiService lokiService;
|
||||||
|
|
||||||
@GetMapping("/labels")
|
@GetMapping("/labels/values")
|
||||||
@ApiOperation("获取标签")
|
@ApiOperation("获取标签")
|
||||||
public ResponseEntity<Object> labels() {
|
public ResponseEntity<Object> labelsValues() {
|
||||||
return new ResponseEntity<>(lokiService.getLabels(), HttpStatus.OK);
|
return new ResponseEntity<>(lokiService.getLabelsValues(), HttpStatus.OK);
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/values")
|
|
||||||
@ApiOperation("根据标签获取值")
|
|
||||||
public ResponseEntity<Object> getAllValues(@RequestBody String label) {
|
|
||||||
return new ResponseEntity<>(lokiService.getValuesByLabel(label), HttpStatus.OK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/logs")
|
@PostMapping("/logs")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.modules.loki.service;
|
package org.nl.modules.loki.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -8,18 +9,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
* @Date: 2022-08-15
|
* @Date: 2022-08-15
|
||||||
*/
|
*/
|
||||||
public interface LokiService {
|
public interface LokiService {
|
||||||
/**
|
|
||||||
* 获取日志的所有标签
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
JSONObject getLabels();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据label获取值
|
|
||||||
* @param label
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
JSONObject getValuesByLabel(String label);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取日志信息
|
* 获取日志信息
|
||||||
@@ -27,4 +16,10 @@ public interface LokiService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
JSONObject getLogData(JSONObject json);
|
JSONObject getLogData(JSONObject json);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取labels和values树
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONArray getLabelsValues();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.modules.loki.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.CharsetUtil;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.modules.loki.service.LokiService;
|
import org.nl.modules.loki.service.LokiService;
|
||||||
@@ -23,20 +24,6 @@ public class LokiServiceImpl implements LokiService {
|
|||||||
@Value("${loki.systemName}")
|
@Value("${loki.systemName}")
|
||||||
private String systemName;
|
private String systemName;
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getLabels() {
|
|
||||||
String result = HttpUtil.get(lokiUrl + "/labels", CharsetUtil.CHARSET_UTF_8);
|
|
||||||
JSONObject parse = (JSONObject) JSONObject.parse(result);
|
|
||||||
return parse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getValuesByLabel(String label) {
|
|
||||||
String result = HttpUtil.get(lokiUrl + "/label/" + label + "/values", CharsetUtil.CHARSET_UTF_8);
|
|
||||||
JSONObject parse = (JSONObject) JSONObject.parse(result);
|
|
||||||
return parse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getLogData(JSONObject json) {
|
public JSONObject getLogData(JSONObject json) {
|
||||||
String logLabel = "";
|
String logLabel = "";
|
||||||
@@ -78,4 +65,49 @@ public class LokiServiceImpl implements LokiService {
|
|||||||
return parse;
|
return parse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取labels和values树
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public JSONArray getLabelsValues() {
|
||||||
|
/**
|
||||||
|
* [{
|
||||||
|
* label:
|
||||||
|
* value:
|
||||||
|
* children:[{
|
||||||
|
* label
|
||||||
|
* value
|
||||||
|
* }]
|
||||||
|
* }]
|
||||||
|
*/
|
||||||
|
JSONArray result = new JSONArray();
|
||||||
|
// 获取所有标签
|
||||||
|
String labelString = HttpUtil.get(lokiUrl + "/labels", CharsetUtil.CHARSET_UTF_8);
|
||||||
|
JSONObject parse = (JSONObject) JSONObject.parse(labelString);
|
||||||
|
JSONArray labels = parse.getJSONArray("data");
|
||||||
|
for (int i=0; i<labels.size(); i++) {
|
||||||
|
// 获取标签下的所有值
|
||||||
|
String valueString = HttpUtil.get(lokiUrl + "/label/" + labels.getString(i) + "/values", CharsetUtil.CHARSET_UTF_8);
|
||||||
|
JSONObject parse2 = (JSONObject) JSONObject.parse(valueString);
|
||||||
|
JSONArray values = parse2.getJSONArray("data");
|
||||||
|
JSONArray children = new JSONArray();
|
||||||
|
// 组成树形状态 两级
|
||||||
|
for (int j=0; j<values.size(); j++) {
|
||||||
|
JSONObject leaf = new JSONObject();
|
||||||
|
leaf.put("label", values.getString(j));
|
||||||
|
leaf.put("value", values.getString(j));
|
||||||
|
children.add(leaf);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject node = new JSONObject();
|
||||||
|
node.put("label", labels.getString(i));
|
||||||
|
node.put("value", labels.getString(i));
|
||||||
|
node.put("children", children);
|
||||||
|
result.add(node);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
package org.nl.modules.quartz.task;
|
package org.nl.modules.quartz.task;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +28,6 @@ import org.springframework.stereotype.Component;
|
|||||||
public class TestTask {
|
public class TestTask {
|
||||||
|
|
||||||
public void run(){
|
public void run(){
|
||||||
|
|
||||||
log.info("run 执行成功");
|
log.info("run 执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +36,6 @@ public class TestTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void run2(){
|
public void run2(){
|
||||||
WQLObject.getWQLObject("sys_param");
|
|
||||||
log.info("run2 执行成功");
|
log.info("run2 执行成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,29 +105,12 @@ public class ExecutionJob extends QuartzJobBean {
|
|||||||
//更新状态
|
//更新状态
|
||||||
quartzJobService.updateIsPause(quartzJob);
|
quartzJobService.updateIsPause(quartzJob);
|
||||||
}
|
}
|
||||||
// if (quartzJob.getEmail() != null) {
|
//异常时候打印日志
|
||||||
// EmailService emailService = SpringContextHolder.getBean(EmailService.class);
|
|
||||||
// // 邮箱报警
|
|
||||||
// EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e));
|
|
||||||
// emailService.send(emailVo, emailService.find());
|
|
||||||
// }
|
|
||||||
} finally {
|
|
||||||
log.info(logDto.toString());
|
log.info(logDto.toString());
|
||||||
quartzLogRepository.save(logDto);
|
quartzLogRepository.save(logDto);
|
||||||
|
} finally {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private EmailVo taskAlarm(QuartzJob quartzJob, String msg) {
|
|
||||||
// EmailVo emailVo = new EmailVo();
|
|
||||||
// emailVo.setSubject("定时任务【" + quartzJob.getJobName() + "】执行失败,请尽快处理!");
|
|
||||||
// Map<String, Object> data = new HashMap<>(16);
|
|
||||||
// data.put("task", quartzJob);
|
|
||||||
// data.put("msg", msg);
|
|
||||||
// TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
|
|
||||||
// Template template = engine.getTemplate("email/taskAlarm.ftl");
|
|
||||||
// emailVo.setContent(template.render(data));
|
|
||||||
// List<String> emails = Arrays.asList(quartzJob.getEmail().split("[,,]"));
|
|
||||||
// emailVo.setTos(emails);
|
|
||||||
// return emailVo;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.common.config.RsaProperties;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.utils.RedisUtils;
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
|
import org.nl.modules.common.utils.RsaUtils;
|
||||||
import org.nl.modules.common.utils.dto.CurrentUser;
|
import org.nl.modules.common.utils.dto.CurrentUser;
|
||||||
import org.nl.modules.security.service.dto.AuthUserDto;
|
import org.nl.modules.security.service.dto.AuthUserDto;
|
||||||
import org.nl.modules.system.service.RoleService;
|
import org.nl.modules.system.service.RoleService;
|
||||||
@@ -48,8 +50,8 @@ public class MobileAuthorizationController {
|
|||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
||||||
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
||||||
String password = authUser.getPassword();
|
// String password = authUser.getPassword();
|
||||||
// String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
||||||
// 校验数据库
|
// 校验数据库
|
||||||
// 根据用户名查询,在比对密码
|
// 根据用户名查询,在比对密码
|
||||||
UserDto userDto = userService.findByName(authUser.getUsername()); // 拿不到已经抛出异常
|
UserDto userDto = userService.findByName(authUser.getUsername()); // 拿不到已经抛出异常
|
||||||
@@ -75,7 +77,6 @@ public class MobileAuthorizationController {
|
|||||||
|
|
||||||
// 返回 token 与 用户信息
|
// 返回 token 与 用户信息
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("roles", permissionList);
|
|
||||||
jsonObject.put("user", userDto);
|
jsonObject.put("user", userDto);
|
||||||
Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
|
Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
|
||||||
put("token", StpUtil.getTokenValue());
|
put("token", StpUtil.getTokenValue());
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.nl.wms.autotask;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动清除日志(操作日志、异常日志)数据
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class CleanLog {
|
||||||
|
public void run(){
|
||||||
|
log.info("run 执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
15
nladmin-system/src/main/java/org/nl/wms/log/LokiLog.java
Normal file
15
nladmin-system/src/main/java/org/nl/wms/log/LokiLog.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package org.nl.wms.log;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: lyd
|
||||||
|
* @description: 自定义日志注解,用作LOKI日志分类
|
||||||
|
* @Date: 2022/10/10
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ ElementType.METHOD})
|
||||||
|
@Documented
|
||||||
|
public @interface LokiLog {
|
||||||
|
LokiLogType type() default LokiLogType.DEFAULT;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.nl.wms.log;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.Signature;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
|
import org.slf4j.MDC;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: lyd
|
||||||
|
* @description: 自定义日志切面:https://cloud.tencent.com/developer/article/1655923
|
||||||
|
* @Date: 2022/10/10
|
||||||
|
*/
|
||||||
|
@Aspect
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class LokiLogAspect {
|
||||||
|
/**
|
||||||
|
* 切到所有OperatorLog注解修饰的方法
|
||||||
|
*/
|
||||||
|
@Pointcut("@annotation(org.nl.wms.log.LokiLog)")
|
||||||
|
public void operatorLog() {
|
||||||
|
// 空方法
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用@Around环绕增强
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Around("operatorLog()")
|
||||||
|
public synchronized Object around(ProceedingJoinPoint pjp) throws Throwable {
|
||||||
|
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
// HttpServletRequest request = attributes.getRequest();
|
||||||
|
// HttpServletResponse response = attributes.getResponse();
|
||||||
|
|
||||||
|
Signature signature = pjp.getSignature();
|
||||||
|
MethodSignature methodSignature = (MethodSignature) signature;
|
||||||
|
Method method = methodSignature.getMethod();
|
||||||
|
LokiLog lokiLog = method.getAnnotation(LokiLog.class);
|
||||||
|
|
||||||
|
// 获取描述信息
|
||||||
|
LokiLogType logType = lokiLog.type();
|
||||||
|
|
||||||
|
MDC.put("log_file_type", logType.name());
|
||||||
|
log.info("输入参数:" + JSONObject.toJSONString(pjp.getArgs()));
|
||||||
|
|
||||||
|
Object proceed = pjp.proceed();
|
||||||
|
|
||||||
|
log.info("返回参数:" + JSONObject.toJSONString(proceed));
|
||||||
|
MDC.remove("log_file_type");
|
||||||
|
return proceed;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
17
nladmin-system/src/main/java/org/nl/wms/log/LokiLogType.java
Normal file
17
nladmin-system/src/main/java/org/nl/wms/log/LokiLogType.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package org.nl.wms.log;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: lyd
|
||||||
|
* @description:
|
||||||
|
* @Date: 2022/10/11
|
||||||
|
*/
|
||||||
|
public enum LokiLogType {
|
||||||
|
DEFAULT( "默认"),
|
||||||
|
LMS_TO_MES( "LMS请求MES"),
|
||||||
|
MES_TO_LMS( "MES请求LMS");
|
||||||
|
|
||||||
|
private String desc;
|
||||||
|
LokiLogType(String desc) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -79,12 +79,15 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<springProfile name="dev">
|
<springProfile name="dev">
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<!-- <appender-ref ref="lokiAppender" />-->
|
<appender-ref ref="lokiAppender" />
|
||||||
</root>
|
</root>
|
||||||
|
|
||||||
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
<logger name="jdbc.sqltiming" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="CONSOLE"/>
|
||||||
|
</logger>
|
||||||
<logger name="jdbc.resultset" level="ERROR" additivity="false">
|
<logger name="jdbc.resultset" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
@@ -106,6 +109,9 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<appender-ref ref="asyncFileAppender"/>
|
<appender-ref ref="asyncFileAppender"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
<appender-ref ref="lokiAppender" />
|
||||||
</root>
|
</root>
|
||||||
|
<logger name="jdbc.sqltiming" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="CONSOLE"/>
|
||||||
|
</logger>
|
||||||
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|||||||
@@ -1,20 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getAllLabels() {
|
|
||||||
return request({
|
|
||||||
url: 'api/loki/labels',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getAllValues(label) {
|
|
||||||
return request({
|
|
||||||
url: 'api/loki/values',
|
|
||||||
method: 'post',
|
|
||||||
data: label
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getLogData(param) {
|
export function getLogData(param) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/loki/logs',
|
url: 'api/loki/logs',
|
||||||
@@ -23,4 +8,11 @@ export function getLogData(param) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { getAllLabels, getAllValues, getLogData }
|
export function labelsValues() {
|
||||||
|
return request({
|
||||||
|
url: 'api/loki/labels/values',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { getLogData, labelsValues }
|
||||||
|
|||||||
@@ -2,37 +2,25 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<!--工具栏-->
|
<!--工具栏-->
|
||||||
<el-form :inline="true" class="demo-form-inline">
|
<el-form :inline="true" class="demo-form-inline" label-suffix=":" label-width="80px">
|
||||||
<el-form-item label="标签">
|
<el-form-item label="日志标签">
|
||||||
<el-select v-model="logLabel" filterable placeholder="请选择标签" size="mini" @change="getValues">
|
<el-cascader
|
||||||
<el-option
|
v-model="labelAndValue"
|
||||||
v-for="item in labelOptions"
|
:options="labelsOptions"
|
||||||
:key="item.index"
|
placeholder="请选择标签"
|
||||||
:label="item"
|
|
||||||
:value="item"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="=">
|
|
||||||
<el-select v-model="logLabelValue" filterable placeholder="请选择标签" size="mini" @change="queryData">
|
|
||||||
<el-option
|
|
||||||
v-for="item in labelValueOptions"
|
|
||||||
:key="item.index"
|
|
||||||
:label="item"
|
|
||||||
:value="item"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="方向">
|
|
||||||
<el-radio-group v-model="direction" size="mini" @change="queryData">
|
|
||||||
<el-radio label="backward">backward</el-radio>
|
|
||||||
<el-radio label="forward">forward</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="时间范围" style="margin-left: 10px" v-show="!showOptions">
|
|
||||||
<el-date-picker
|
|
||||||
@change="queryData"
|
@change="queryData"
|
||||||
@blur="queryData"
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关键字">
|
||||||
|
<el-input
|
||||||
|
v-model="text"
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-show="!showOptions" label="时间范围">
|
||||||
|
<el-date-picker
|
||||||
v-model="timeRange"
|
v-model="timeRange"
|
||||||
size="mini"
|
size="mini"
|
||||||
clearable
|
clearable
|
||||||
@@ -41,9 +29,11 @@
|
|||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
align="right"
|
align="right"
|
||||||
|
@change="queryData"
|
||||||
|
@blur="queryData"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="showOptions" label="时差" style="margin-left: 10px">
|
<el-form-item v-show="showOptions" label="时间段">
|
||||||
<el-select v-model="timeZoneValue" filterable placeholder="请选择标签" size="mini" @change="queryData">
|
<el-select v-model="timeZoneValue" filterable placeholder="请选择标签" size="mini" @change="queryData">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in timeZoneOptions"
|
v-for="item in timeZoneOptions"
|
||||||
@@ -58,18 +48,13 @@
|
|||||||
<span class="el-icon-sort" @click="changeShow" />
|
<span class="el-icon-sort" @click="changeShow" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
<el-form-item label="方向">
|
||||||
<el-form :inline="true" class="demo-form-inline">
|
<el-radio-group v-model="direction" size="mini" @change="queryData">
|
||||||
<el-form-item label="关键字">
|
<el-radio label="backward">backward</el-radio>
|
||||||
<el-input
|
<el-radio label="forward">forward</el-radio>
|
||||||
v-model="text"
|
</el-radio-group>
|
||||||
style="width: 300px"
|
|
||||||
size="mini"
|
|
||||||
placeholder="请输入内容"
|
|
||||||
clearable
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="条数" style="margin-left: 10px">
|
<el-form-item label="显示条数">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="limits"
|
v-model="limits"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -79,7 +64,7 @@
|
|||||||
:step="100"
|
:step="100"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="滚动步数" style="margin-left: 10px">
|
<el-form-item label="滚动步数">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="scrollStep"
|
v-model="scrollStep"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -105,7 +90,7 @@
|
|||||||
<!--数据加载-->
|
<!--数据加载-->
|
||||||
<el-card v-else shadow="hover" style="width: 100%" class="log-warpper">
|
<el-card v-else shadow="hover" style="width: 100%" class="log-warpper">
|
||||||
<div style="width: 100%">
|
<div style="width: 100%">
|
||||||
<div v-for="(log, index) in logs" :key="index" >
|
<div v-for="(log, index) in logs" :key="index">
|
||||||
<div style="margin-bottom: 5px; font-size: 12px;" v-html="log[1]" />
|
<div style="margin-bottom: 5px; font-size: 12px;" v-html="log[1]" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -132,10 +117,8 @@ export default {
|
|||||||
name: 'Loki',
|
name: 'Loki',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
labelOptions: [], // 标签数据
|
labelAndValue: [], // 搜索的值
|
||||||
labelValueOptions: [], // 标签值
|
labelsOptions: [], // 所有标签和对应所有值数据
|
||||||
logLabel: '',
|
|
||||||
logLabelValue: '',
|
|
||||||
timeRange: [],
|
timeRange: [],
|
||||||
text: '',
|
text: '',
|
||||||
limits: 100,
|
limits: 100,
|
||||||
@@ -214,7 +197,14 @@ export default {
|
|||||||
window.addEventListener('scroll', this.handleScroll)
|
window.addEventListener('scroll', this.handleScroll)
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initLabelOptions()
|
this.initLabelsValues()
|
||||||
|
},
|
||||||
|
// 关闭定时器 - 加了缓存就必须使用deactivated
|
||||||
|
deactivated() {
|
||||||
|
// js提供的clearInterval方法用来清除定时器
|
||||||
|
console.log('定时任务销毁')
|
||||||
|
clearInterval(this.timer)
|
||||||
|
window.removeEventListener('scroll', this.handleScroll)
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// js提供的clearInterval方法用来清除定时器
|
// js提供的clearInterval方法用来清除定时器
|
||||||
@@ -223,25 +213,18 @@ export default {
|
|||||||
window.removeEventListener('scroll', this.handleScroll)
|
window.removeEventListener('scroll', this.handleScroll)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initLabelOptions() { // 获取lables
|
initLabelsValues() {
|
||||||
logOperation.getAllLabels().then(res => {
|
logOperation.labelsValues().then(res => {
|
||||||
this.labelOptions = res.data
|
this.labelsOptions = res
|
||||||
})
|
|
||||||
},
|
|
||||||
getValues() {
|
|
||||||
this.logLabelValue = null
|
|
||||||
logOperation.getAllValues(this.logLabel).then(res => {
|
|
||||||
this.labelValueOptions = res.data
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
queryData() {
|
queryData() {
|
||||||
|
console.log(this.labelAndValue)
|
||||||
// 清空查询数据
|
// 清空查询数据
|
||||||
this.clearParam()
|
this.clearParam()
|
||||||
if (this.logLabel !== '') { // 标签
|
if (this.labelAndValue.length > 0) {
|
||||||
queryParam.logLabel = this.logLabel
|
queryParam.logLabel = this.labelAndValue[0]
|
||||||
}
|
queryParam.logLabelValue = this.labelAndValue[1]
|
||||||
if (this.logLabelValue !== '') { // 标签值
|
|
||||||
queryParam.logLabelValue = this.logLabelValue
|
|
||||||
}
|
}
|
||||||
if (queryParam.logLabelValue === null) { // 判空
|
if (queryParam.logLabelValue === null) { // 判空
|
||||||
this.$message({
|
this.$message({
|
||||||
@@ -256,14 +239,8 @@ export default {
|
|||||||
if (this.timeRange.length !== 0) { // 如果是输入时间范围
|
if (this.timeRange.length !== 0) { // 如果是输入时间范围
|
||||||
queryParam.start = (new Date(this.timeRange[0]).getTime() * 1000000).toString()
|
queryParam.start = (new Date(this.timeRange[0]).getTime() * 1000000).toString()
|
||||||
queryParam.end = (new Date(this.timeRange[1]).getTime() * 1000000).toString()
|
queryParam.end = (new Date(this.timeRange[1]).getTime() * 1000000).toString()
|
||||||
console.log(queryParam.start)
|
|
||||||
console.log('-----------------------------')
|
|
||||||
console.log(queryParam.end)
|
|
||||||
}
|
}
|
||||||
if (this.timeZoneValue) {
|
if (this.timeZoneValue) {
|
||||||
// console.log('时差:', this.timeZoneValue)
|
|
||||||
// console.log('start时间:', new Date().getTime() - this.timeZoneValue)
|
|
||||||
// console.log('end时间:', new Date().getTime())
|
|
||||||
const time = new Date()
|
const time = new Date()
|
||||||
queryParam.start = ((time.getTime() - this.timeZoneValue) * 1000000).toString()
|
queryParam.start = ((time.getTime() - this.timeZoneValue) * 1000000).toString()
|
||||||
queryParam.end = (time.getTime() * 1000000).toString()
|
queryParam.end = (time.getTime() * 1000000).toString()
|
||||||
@@ -275,10 +252,8 @@ export default {
|
|||||||
queryParam.limits = this.limits
|
queryParam.limits = this.limits
|
||||||
}
|
}
|
||||||
queryParam.direction = this.direction
|
queryParam.direction = this.direction
|
||||||
console.log('最后参数:', queryParam)
|
|
||||||
var ansi_up = new AnsiUp()
|
var ansi_up = new AnsiUp()
|
||||||
logOperation.getLogData(queryParam).then(res => {
|
logOperation.getLogData(queryParam).then(res => {
|
||||||
console.log('结果', res)
|
|
||||||
this.showEmpty = false
|
this.showEmpty = false
|
||||||
if (res.data.result.length === 1) {
|
if (res.data.result.length === 1) {
|
||||||
this.logs = res.data.result[0].values
|
this.logs = res.data.result[0].values
|
||||||
@@ -324,7 +299,6 @@ export default {
|
|||||||
const scrollHeight = document.documentElement.scrollHeight// 内容高度
|
const scrollHeight = document.documentElement.scrollHeight// 内容高度
|
||||||
const bottomest = Math.ceil(scrollTop + clientHeight)
|
const bottomest = Math.ceil(scrollTop + clientHeight)
|
||||||
if (bottomest >= scrollHeight) {
|
if (bottomest >= scrollHeight) {
|
||||||
console.log(1)
|
|
||||||
// 加载新数据
|
// 加载新数据
|
||||||
queryParam.limits = this.scrollStep
|
queryParam.limits = this.scrollStep
|
||||||
queryParam.direction = this.direction
|
queryParam.direction = this.direction
|
||||||
@@ -339,7 +313,6 @@ export default {
|
|||||||
if (zone === 0) {
|
if (zone === 0) {
|
||||||
zone = 3600 * 1000 * 6
|
zone = 3600 * 1000 * 6
|
||||||
}
|
}
|
||||||
console.log('时间差:', zone)
|
|
||||||
if (this.direction === 'backward') { // 设置时间区间
|
if (this.direction === 'backward') { // 设置时间区间
|
||||||
queryParam.start = (this.logs[this.logs.length - 1][0] - zone).toString()
|
queryParam.start = (this.logs[this.logs.length - 1][0] - zone).toString()
|
||||||
queryParam.end = this.logs[this.logs.length - 1][0]
|
queryParam.end = this.logs[this.logs.length - 1][0]
|
||||||
@@ -347,7 +320,6 @@ export default {
|
|||||||
queryParam.start = this.logs[this.logs.length - 1][0]
|
queryParam.start = this.logs[this.logs.length - 1][0]
|
||||||
queryParam.end = (parseFloat(this.logs[this.logs.length - 1][0]) + parseFloat(zone.toString())).toString()
|
queryParam.end = (parseFloat(this.logs[this.logs.length - 1][0]) + parseFloat(zone.toString())).toString()
|
||||||
}
|
}
|
||||||
console.log('滚动的参数:', queryParam)
|
|
||||||
var ansi_up = new AnsiUp()
|
var ansi_up = new AnsiUp()
|
||||||
logOperation.getLogData(queryParam).then(res => {
|
logOperation.getLogData(queryParam).then(res => {
|
||||||
this.showEmpty = false
|
this.showEmpty = false
|
||||||
@@ -464,7 +436,7 @@ export default {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.log-warpper {
|
.log-warpper {
|
||||||
word-break: break-all;
|
word-break: break-word;
|
||||||
word-wrap: break-word
|
word-wrap: break-word
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
<el-table-column prop="username" label="用户名" />
|
<el-table-column prop="username" label="用户名" />
|
||||||
<el-table-column prop="requestIp" label="IP" />
|
<el-table-column prop="requestIp" label="IP" />
|
||||||
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||||
<el-table-column prop="description" label="描述" />
|
<el-table-column prop="description" label="描述" show-overflow-tooltip />
|
||||||
<el-table-column prop="browser" label="浏览器" />
|
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="createTime" label="创建日期">
|
<el-table-column prop="createTime" label="创建日期" min-width="100" show-overflow-tooltip>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -78,7 +78,7 @@ export default {
|
|||||||
add: false,
|
add: false,
|
||||||
edit: false,
|
edit: false,
|
||||||
del: false,
|
del: false,
|
||||||
download: true
|
download: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
<el-table-column prop="username" label="用户名" />
|
<el-table-column prop="username" label="用户名" />
|
||||||
<el-table-column prop="requestIp" label="IP" />
|
<el-table-column prop="requestIp" label="IP" />
|
||||||
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||||
<el-table-column prop="description" label="描述" />
|
<el-table-column prop="description" label="描述" show-overflow-tooltip />
|
||||||
<el-table-column prop="browser" label="浏览器" />
|
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="time" label="请求耗时" align="center">
|
<el-table-column prop="time" label="请求耗时" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
add: false,
|
add: false,
|
||||||
edit: false,
|
edit: false,
|
||||||
del: false,
|
del: false,
|
||||||
download: true
|
download: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export default {
|
|||||||
add: false,
|
add: false,
|
||||||
edit: false,
|
edit: false,
|
||||||
del: false,
|
del: false,
|
||||||
download: true
|
download: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -42,11 +42,10 @@
|
|||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column v-if="false" prop="id" label="id" />
|
<el-table-column v-if="false" prop="id" label="id" />
|
||||||
<el-table-column prop="code" label="编码" />
|
<el-table-column prop="code" label="编码" min-width="130" show-overflow-tooltip />
|
||||||
<el-table-column prop="name" label="名称" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="name" label="名称" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="value" label="值" min-width="270" show-overflow-tooltip />
|
<el-table-column prop="value" label="值" min-width="270" show-overflow-tooltip />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column prop="update_optname" label="修改者" />
|
|
||||||
<el-table-column v-permission="['admin','param:edit','param:del']" label="操作" width="150px" align="center">
|
<el-table-column v-permission="['admin','param:edit','param:del']" label="操作" width="150px" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<udOperation
|
<udOperation
|
||||||
|
|||||||
@@ -63,10 +63,10 @@
|
|||||||
<!-- 操作日志 -->
|
<!-- 操作日志 -->
|
||||||
<el-tab-pane label="操作日志" name="second">
|
<el-tab-pane label="操作日志" name="second">
|
||||||
<el-table v-loading="loading" :data="data" style="width: 100%;">
|
<el-table v-loading="loading" :data="data" style="width: 100%;">
|
||||||
<el-table-column prop="description" label="行为" />
|
<el-table-column prop="description" label="行为" min-width="130" show-overflow-tooltip />
|
||||||
<el-table-column prop="requestIp" label="IP" />
|
<el-table-column prop="requestIp" label="IP" />
|
||||||
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||||
<el-table-column prop="browser" label="浏览器" />
|
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="time" label="请求耗时" align="center">
|
<el-table-column prop="time" label="请求耗时" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||||
@@ -76,6 +76,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="right"
|
align="right"
|
||||||
|
min-width="120"
|
||||||
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<div style="display:inline-block;float: right;cursor: pointer" @click="init">创建日期<i class="el-icon-refresh" style="margin-left: 40px" /></div>
|
<div style="display:inline-block;float: right;cursor: pointer" @click="init">创建日期<i class="el-icon-refresh" style="margin-left: 40px" /></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user