Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
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
曲欣亮
member-api
Commits
3c9f700f
Commit
3c9f700f
authored
Oct 10, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改国际化配置
parent
5c3dc2fd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
6 deletions
+34
-6
MemberOpenApiController.java
...main/java/com/egolm/film/api/MemberOpenApiController.java
+3
-3
LocaleConfig.java
src/main/java/com/egolm/film/config/LocaleConfig.java
+20
-0
application.properties
src/main/resources/application.properties
+1
-3
message_zh_CN.properties
src/main/resources/i18n/message_zh_CN.properties
+0
-0
messages.properties
src/main/resources/i18n/messages.properties
+0
-0
messages_en_US.properties
src/main/resources/i18n/messages_en_US.properties
+0
-0
messages_zh_CN.properties
src/main/resources/i18n/messages_zh_CN.properties
+10
-0
No files found.
src/main/java/com/egolm/film/api/MemberOpenApiController.java
View file @
3c9f700f
...
@@ -67,17 +67,17 @@ public class MemberOpenApiController {
...
@@ -67,17 +67,17 @@ public class MemberOpenApiController {
}
}
@ResponseBody
@ResponseBody
@PostMapping
(
"
g
etPassword"
)
@PostMapping
(
"
res
etPassword"
)
@ApiOperation
(
"找回密码"
)
@ApiOperation
(
"找回密码"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
)})
public
Object
g
etPassword
(
String
email
)
{
public
Object
res
etPassword
(
String
email
)
{
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
);
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
);
String
password
=
String
.
valueOf
(
code
);
String
password
=
String
.
valueOf
(
code
);
Fc_member
member
=
memberService
.
getMemberByEmail
(
email
);
Fc_member
member
=
memberService
.
getMemberByEmail
(
email
);
String
encodePwd
=
memberService
.
encodePassword
(
member
.
getSalt
(),
password
);
String
encodePwd
=
memberService
.
encodePassword
(
member
.
getSalt
(),
password
);
memberService
.
changePassword
(
member
.
getId
(),
encodePwd
);
memberService
.
changePassword
(
member
.
getId
(),
encodePwd
);
String
subject
=
messages
.
get
(
"email.getPassword.subject"
);
String
subject
=
messages
.
get
(
"email.getPassword.subject"
);
String
content
=
messages
.
get
(
"email.getPassword.
subjec
t"
,
member
.
getRealname
(),
password
);
String
content
=
messages
.
get
(
"email.getPassword.
conten
t"
,
member
.
getRealname
(),
password
);
emailService
.
send
(
subject
,
content
,
email
);
emailService
.
send
(
subject
,
content
,
email
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
...
src/main/java/com/egolm/film/config/LocaleConfig.java
0 → 100644
View file @
3c9f700f
package
com
.
egolm
.
film
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.support.ResourceBundleMessageSource
;
@ConfigurationProperties
(
prefix
=
"spring.messages"
)
public
class
LocaleConfig
{
@Bean
public
MessageSource
messageSource
()
{
ResourceBundleMessageSource
messageSource
=
new
ResourceBundleMessageSource
();
messageSource
.
setBasename
(
"/i18n/messages"
);
messageSource
.
setDefaultEncoding
(
"utf-8"
);
messageSource
.
setAlwaysUseMessageFormat
(
true
);
messageSource
.
setCacheSeconds
(-
1
);
return
messageSource
;
}
}
src/main/resources/application.properties
View file @
3c9f700f
...
@@ -13,9 +13,7 @@ spring.http.encoding.force=true
...
@@ -13,9 +13,7 @@ spring.http.encoding.force=true
spring.http.encoding.enabled
=
true
spring.http.encoding.enabled
=
true
spring.http.encoding.charset
=
utf-8
spring.http.encoding.charset
=
utf-8
spring.messages.basename
=
classpath:i18n/messages
spring.messages.basename
=
classpath:i18n/messages
spring.messages.cache-seconds
=
3600
spring.messages.encoding
=
UTF-8
com.egolm.film.email.smtp.host
=
mail.egolm.com
com.egolm.film.email.smtp.host
=
mail.egolm.com
com.egolm.film.email.smtp.port
=
25
com.egolm.film.email.smtp.port
=
25
...
...
src/main/resources/i18n/message_zh_CN.properties
deleted
100644 → 0
View file @
5c3dc2fd
src/main/resources/i18n/message.properties
→
src/main/resources/i18n/message
s
.properties
View file @
3c9f700f
File moved
src/main/resources/i18n/message_en_US.properties
→
src/main/resources/i18n/message
s
_en_US.properties
View file @
3c9f700f
File moved
src/main/resources/i18n/messages_zh_CN.properties
0 → 100644
View file @
3c9f700f
email.getPassword.subject
=
\u
4E2D
\u
56FD
\u7535\u
5F71
\u8282
[
\u
627E
\u
56DE
\u
5BC6
\u7801
]
\u
90AE
\u
4EF6
email.getPassword.content
=
{0},
\u
60A8
\u
597D,
\u
60A8
\u7684\u
65B0
\u
5BC6
\u7801\u
662F: [{1}]
sys.err
=
\u
7CFB
\u
7EDF
\u9519\u
8BEF
sys.err.user_disabled
=
\u7528\u6237\u
5DF2
\u
7ECF
\u7981\u7528
sys.err.user_pwd_err=
\u7528\u6237\u6216\u
5BC6
\u7801\u9519\u
8BEF
sys.err.user_pwd_null
=
\u7528\u6237\u
540D
\u
548C
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
msg.hello
=
\u
60A8
\u
597D
msg.your_pwd
=
\u
60A8
\u7684\u
5BC6
\u7801\u
662F
\ No newline at end of file
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