Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
cbc5d96a
Commit
cbc5d96a
authored
Dec 12, 2017
by
Java—KA—李 青
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.quantgroup.cn/head_group/xyqb-user2
parents
c219a835
d72fcbfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+26
-6
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
cbc5d96a
...
...
@@ -15,10 +15,7 @@ import cn.quantgroup.xyqb.service.register.IUserRegisterService;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.util.AESUtil
;
import
cn.quantgroup.xyqb.util.IPUtil
;
import
cn.quantgroup.xyqb.util.MqUtils
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
cn.quantgroup.xyqb.util.*
;
import
cn.quantgroup.xyqb.util.encrypt.MD5Util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -92,6 +89,11 @@ public class InnerController implements IBaseController {
MAPPER
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
MAPPER
.
configure
(
SerializationFeature
.
WRITE_ENUMS_USING_INDEX
,
true
);
}
private
static
final
char
[]
PWD_BASE
=
{
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'g'
,
'h'
,
'i'
,
'j'
,
'k'
,
'l'
,
'm'
,
'n'
,
'o'
,
'p'
,
'q'
,
'r'
,
's'
,
't'
,
'u'
,
'v'
,
'w'
,
'x'
,
'y'
,
'z'
,
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
};
@RequestMapping
(
"/user/search/phoneNo"
)
@LogHttpCaller
...
...
@@ -187,7 +189,8 @@ public class InnerController implements IBaseController {
registeredFrom
=
0L
;
}
if
(
StringUtils
.
isBlank
(
password
))
{
password
=
""
;
password
=
genRandomPwd
();
password
=
PasswordUtil
.
MD5
(
password
.
toLowerCase
()
+
Constants
.
PASSWORD_SALT
);
}
if
(
StringUtils
.
isBlank
(
uuid
))
{
return
JsonResult
.
buildErrorStateResult
(
"用户uuid为空."
,
null
);
...
...
@@ -1037,5 +1040,22 @@ public class InnerController implements IBaseController {
httpService
.
get
(
hanguguanUrl
.
concat
(
"/innerapi/forbiddenUserOrNot"
),
param
);
return
JsonResult
.
buildSuccessResult
(
"用户禁用或重启成功成功"
,
affectedRows
);
}
private
String
genRandomPwd
()
{
int
pwdMax
=
PWD_BASE
.
length
;
// 生成的随机数
int
i
;
// 生成的密码的长度
int
count
=
0
;
StringBuffer
pwd
=
new
StringBuffer
();
Random
r
=
new
Random
();
while
(
count
<
15
)
{
// 生成的数最大为36-1
i
=
Math
.
abs
(
r
.
nextInt
(
pwdMax
));
if
(
i
>=
0
&&
i
<
PWD_BASE
.
length
)
{
pwd
.
append
(
PWD_BASE
[
i
]);
count
++;
}
}
return
pwd
.
toString
();
}
}
\ 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