Commit 7f7d0d5a authored by 赵啸非's avatar 赵啸非

添加批量激活设备

parent 64515fa9
......@@ -275,13 +275,12 @@ export default {
},
onSubmit() {
let { path, query } = this.$route;
let data = this.decode(this.form);
this.$router.push({
path: path,
query: Object.assign({}, query, data),
});
this.decodetwo(this.form)
},
// 解析url字符串,去除query字段
encode(data, formTemp) {
......@@ -290,7 +289,6 @@ export default {
if (/^query\./.test(item)) {
let val = data[item];
let key = item.replace(/^query\./, "");
this.search.forEach((obj) => {
if (
obj.name === key &&
......@@ -340,6 +338,33 @@ export default {
});
return newData;
},
decodetwo(data) {
Object.keys(data).forEach((item) => {
let val = data[item];
this.search.forEach((obj) => {
if (
obj.name === item &&
obj.fuzzy === true &&
val &&
val.length > 0
) {
//支持模糊查询,收尾增加百分号
val = val.trim();
if (val.charAt(0) == "%") {
val = val.slice(1);
}
if (val.charAt(val.length - 1) == "%") {
val = val + "%";
}
}
});
newData[item] = this.decodeVal(val);
});
return newData;
},
decodeVal(val) {
let valType = type(val);
if (["Number", "Boolean"].indexOf(valType) > -1) {
......
......@@ -61,6 +61,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.net.URL;
......@@ -141,6 +144,13 @@ public class DeviceApiController {
@PostMapping("register")
public String register(@RequestBody DeviceReq req) {
log.info("【设备注册】【请求体】--> " + JSONObject.toJSONString(req));
RequestAttributes requstAttr = RequestContextHolder.getRequestAttributes();
HttpServletRequest request = ((ServletRequestAttributes) requstAttr).getRequest();
log.info("request uri:{},request url:{}",request.getRequestURI(),request.getRequestURL());
//ServletUtil.
//ServletUtil.getClientIP()
ApiResp<DeviceResp> rsp = new ApiResp<>();
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
DeviceResp deviceResp = new DeviceResp();
......
......@@ -23,8 +23,9 @@
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 文件保存策略-->
<fileNamePattern>${logFilePath}/${springApplicationName:-default}/${springApplicationName:-default}-info.log.%d{yyyyMMdd}</fileNamePattern>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
<!--日志文件保留天数-->
<MaxHistory>7</MaxHistory>
<MaxHistory>15</MaxHistory>
</rollingPolicy>
</appender>
<!-- 异常文件输出策略-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment