//时间戳转为 时间格式
getMyDate:function(str) {
var oDate = new Date(str),
oYear = oDate.getFullYear(),
oMonth = oDate.getMonth()+1,
oDay = oDate.getDate(),
oTime = oYear +'-'+ this.addZero(oMonth) +'-'+ this.addZero(oDay);
return oTime;
},
//补零操作
addZero:function (num){
if(parseInt(num) < 10){
num = '0'+num;
}
return num;
},
//删除maven中没有下载完善的jar
for /r %i in (*.lastUpdated) do del %i
解决get 传递对象的问题
1.解决get 传递对象的问题
package com.wt.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FeignConfig {
@Bean
public FeignInterceptor interceptor() {
return new FeignInterceptor();
}
}
2.解决get 传递对象的问题
package com.wt.config;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import java.io.IOException;
import java.util.*;
public class FeignInterceptor implements RequestInterceptor {
@Autowired
private ObjectMapper objectMapper;
@Override
public void apply(RequestTemplate template) {
// feign 不支持 GET 方法传 POJO, json body转query
if (template.method().equals("GET") && template.body() != null) {
try {
JsonNode jsonNode = objectMapper.readTree(template.body());
template.body(null);
Map<String, Collection<String>> queries = new HashMap<>();
buildQuery(jsonNode, "", queries);
template.queries(queries);
} catch (IOException e) {
e.printStackTrace();
}
}
}
private void buildQuery(JsonNode jsonNode, String path, Map<String, Collection<String>> queries) {
if (!jsonNode.isContainerNode()) { // 叶子节点
if (jsonNode.isNull()) {
return;
}
Collection<String> values = queries.get(path);
if (null == values) {
values = new ArrayList<>();
queries.put(path, values);
}
values.add(jsonNode.asText());
return;
}
if (jsonNode.isArray()) { // 数组节点
Iterator<JsonNode> it = jsonNode.elements();
while (it.hasNext()) {
buildQuery(it.next(), path, queries);
}
} else {
Iterator<Map.Entry<String, JsonNode>> it = jsonNode.fields();
while (it.hasNext()) {
Map.Entry<String, JsonNode> entry = it.next();
if (StringUtils.hasText(path)) {
buildQuery(entry.getValue(), path + "." + entry.getKey(), queries);
} else { // 根节点
buildQuery(entry.getValue(), entry.getKey(), queries);
}
}
}
}
}
第一步:下载jar
1.搜索idea破解 找到 IntelliJ IDEA 注册码点开:
2.破解补丁无需使用注册码,下载地址:http://idea.lanyus.com/jar/JetbrainsIdesCrack-3.4-release-enc.jar
3.找到idea的bin 将下载好的jar放入就好
4.将 idea.exe.vmoptions 与 idea64.exe.vmoptions 修改配置文件 加入:(jar包的全路径 且加入前缀 -javaagent:)-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2018.2\bin\JetbrainsCrack-2.10-release-enc.jar
5.加入注册码
ThisCrackLicenseId-{
"licenseId":"ThisCrackLicenseId",
"licenseeName":"你想要的用户名",
"assigneeName":"",
"assigneeEmail":"随便填一个邮箱(我填的:[email protected])",
"licenseRestriction":"For This Crack, Only Test! Please support genuine!!!",
"checkConcurrentUse":false,
"products":[
{"code":"II","paidUpTo":"2099-12-31"},
{"code":"DM","paidUpTo":"2099-12-31"},
{"code":"AC","paidUpTo":"2099-12-31"},
{"code":"RS0","paidUpTo":"2099-12-31"},
{"code":"WS","paidUpTo":"2099-12-31"},
{"code":"DPN","paidUpTo":"2099-12-31"},
{"code":"RC","paidUpTo":"2099-12-31"},
{"code":"PS","paidUpTo":"2099-12-31"},
{"code":"DC","paidUpTo":"2099-12-31"},
{"code":"RM","paidUpTo":"2099-12-31"},
{"code":"CL","paidUpTo":"2099-12-31"},
{"code":"PC","paidUpTo":"2099-12-31"}
],
"hash":"2911276/0",
"gracePeriodDays":7,
"autoProlongated":false}
6.破解完成
JSON.stringify([
{name:"zhangsan",shuxue:100,yuwen:100},
{name:"lisi",shuxue:90,yuwen:92},
{name:"wangwu",shuxue:40,yuwen:50}
])
线上项目:
https://gitee.com/y_project/RuoYi