Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
d4ad2df2
Commit
d4ad2df2
authored
Apr 25, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
1e61a8d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
MvcConfiguration.java
src/main/java/cn/chnmuseum/party/conf/MvcConfiguration.java
+1
-1
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+10
-8
No files found.
src/main/java/cn/chnmuseum/party/conf/MvcConfiguration.java
View file @
d4ad2df2
...
...
@@ -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
...
...
src/main/java/cn/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
d4ad2df2
...
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment