Commit d4ad2df2 authored by wzp's avatar wzp

修改bug

parent 1e61a8d2
......@@ -64,7 +64,7 @@ public class MvcConfiguration extends WebMvcConfigurationSupport {
FastJsonConfig fastJsonConfig = new FastJsonConfig();
fastJsonConfig.setSerializerFeatures(
SerializerFeature.PrettyFormat, // 结果格式化
// SerializerFeature.WriteMapNullValue, // 输出空值字段
SerializerFeature.WriteMapNullValue, // 输出空值字段
SerializerFeature.WriteNullStringAsEmpty, // String如果为null,输出为"",而不是null
SerializerFeature.DisableCircularReferenceDetect, // 消除对同一对象循环引用的问题
SerializerFeature.WriteNullListAsEmpty, // List集合如果为null,输出为[],而不是null
......
......@@ -30,6 +30,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authc.DisabledAccountException;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.bytedeco.opencv.presets.opencv_core;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.validation.annotation.Validated;
......@@ -237,6 +238,7 @@ public class ChinaMobileRestApiController extends BaseController {
jsonObject.put("userId", user.getId());
jsonObject.put("userName", user.getUserName());
jsonObject.put("expire", TimeUtils.format(LocalDateTime.now().plusMinutes(240), TimeUtils.FORMAT_ONE));
jsonObject.put("expireDate", user.getExiredDate());
jsonObject.put("orgCode", user.getOrgId());
jsonObject.put("orgName", user.getOrgName());
......@@ -268,19 +270,19 @@ public class ChinaMobileRestApiController extends BaseController {
return resultMap;
}
JSONObject jsonObject = new JSONObject(true);
jsonObject.put("userId", user.getId());
jsonObject.put("userName", user.getUserName());
HashMap<String, Object> map = new HashMap<>();
map.put("userId", user.getId());
map.put("userName", user.getUserName());
// long expire = stringRedisTemplate.getExpire(SHIRO_JWT_TOKEN + token) == null ? 0L : stringRedisTemplate.getExpire(SHIRO_JWT_TOKEN + token);
//jsonObject.put("expire", TimeUtils.format(LocalDateTime.now().plusMinutes(expire), TimeUtils.FORMAT_ONE));
jsonObject.put("effectiveDate", user.getEffectiveDate());
jsonObject.put("expireDate", user.getExiredDate());
jsonObject.put("orgCode", user.getOrgId());
jsonObject.put("orgName", organ.getName());
map.put("effectiveDate", user.getEffectiveDate());
map.put("expireDate", user.getExiredDate());
map.put("orgCode", user.getOrgId());
map.put("orgName", organ.getName());
resultMap.put("resultCode", "200");
resultMap.put("message", "成功");
resultMap.put("data", jsonObject);
resultMap.put("data", map);
return resultMap;
} catch (Exception e) {
resultMap.put("resultCode", "500");
......
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