Skip to content

Instantly share code, notes, and snippets.

View codax-ai's full-sized avatar
❤️‍🔥
enjoying

阿星的麦田 codax-ai

❤️‍🔥
enjoying
View GitHub Profile
@Configuration
public class FeignConfig implements RequestInterceptor
{
@Value("${auth.user.token-header}")
private String tokenHeader;
@Override
public void apply(RequestTemplate requestTemplate)
{
HttpServletRequest httpServletRequest = HttpContextUtils.getHttpServletRequest();
@Component
public class HttpContextUtils implements ApplicationContextAware
{
public static ApplicationContext applicationContext;
public static HttpServletRequest getHttpServletRequest()
{
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
if (requestAttributes == null)
{
/**
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
*/
@InitBinder
public void initBinder(WebDataBinder binder)
{
// Date 类型转换
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
{
@Override
@Configuration
public class RestTemplateConfig
{
@Bean
public RestTemplate restTemplate()
{
ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient());
return new RestTemplate(requestFactory);
}
public JSONObject get(ServiceCatalogEnum service, Map<String, Object> paramMap)
{
pointLog(service.getUrl(), service.getTip());
HttpEntity requestEntity = new HttpEntity(null, HttpHeaderEnum.valueOf(service.getProvider()).get());
try
{
ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(httpUrlPrefix.get(service.getProvider()) + service.getUrl(), HttpMethod.GET, requestEntity, JSONObject.class, paramMap);
return responseEntity.getBody();
}
catch (RestClientException e)

官方支持多级表头,只需要嵌套列就行,但是场景受限

这里需求是表头有一部分是动态变化的,其他部分是固定的,通过自定义组件实现。

效果如下: 截图

组件

表格和列:

  • 表格
<template>

windows命令

  • 查看当前所有的tcp连接netstat -ano
  • 查看所有8080端口的tcp连接netstat -ano |findstr "8080"
  • 查看所有的“TIME_WAIT”状态的tcp连接netstat -ano |findstr "TIME_WAIT"
  • 统计time_wait出现的次数(按行统计) /i 忽略大小写netstat -ano |find /i /c "TIME_WAIT"

设置TIME_WAIT的自动关闭时间(默认4分钟)和可用端口个数

  • 运行/cmdregedit进入注册表
  • 进入HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters
  • 新建 DWORD 类型的注册表项,命名为:TCPTimedWaitDelay,值数据: 30(TIME_WAIT的自动断开时间,默认为4分钟)

同步上传

<template>
  ...
  <el-form-item label="上传附件" prop="fileList" style="width: 500px;">
    <el-upload
      ref="upload"
      action="action"
      :limit="10"
      multiple
@codax-ai
codax-ai / #Vue #全局样式 #element-ui #下拉菜单.md
Created August 26, 2020 06:52
设置下拉菜单内容超长显示三个点

全局设置Select下拉菜单列表样式

1、全局样式element-ui.css中设置下拉列表固定宽度,当Select下拉菜单宽度大于这里设置的宽度时,会自动显示三个点

.el-select-dropdown {
    width: 200px;
}

2、main.js中引入全局样式

import './assets/style/element-ui.css'
private String createZipFile(List<BaseFile> fileList) {
String path = "/temp/download/";
String filename = UUID.randomUUID().toString() + "_附件.zip";
try (FileOutputStream out = new FileOutputStream(path + filename))
{
ZipOutputStream zip;
zip = new ZipOutputStream(new BufferedOutputStream(out));
fileList.forEach(doc -> {
try
{