Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
e572769f
Commit
e572769f
authored
Jun 13, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加注册和登录
parent
db8fafaf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+29
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
e572769f
...
@@ -231,7 +231,11 @@ public class AppPermissionService {
...
@@ -231,7 +231,11 @@ public class AppPermissionService {
userLogin
.
setId
(
userid
);
userLogin
.
setId
(
userid
);
userLogin
.
setImPassword
(
imPassword
);
userLogin
.
setImPassword
(
imPassword
);
userLogin
.
setImUserid
(
imUserId
);
userLogin
.
setImUserid
(
imUserId
);
userLogin
.
setUsername
(
username
);
appUserLoginBiz
.
updateSelectiveById
(
userLogin
);
}
}
data
.
put
(
"im_token"
,
access_token
);
data
.
put
(
"im_UserId"
,
imUserId
);
}
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
...
@@ -349,6 +353,14 @@ public class AppPermissionService {
...
@@ -349,6 +353,14 @@ public class AppPermissionService {
}
}
// 登录结果要做做统一处理
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
// 到im注册,获取返回结果
Integer
imUserId
=
userLogin
.
getImUserid
();
String
imPassword
=
userLogin
.
getImPassword
();
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
String
access_token
=
loginIm
(
username
,
imPassword
,
imUserId
);
data
.
put
(
"im_token"
,
access_token
);
data
.
put
(
"im_UserId"
,
imUserId
);
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
}
...
@@ -428,6 +440,14 @@ public class AppPermissionService {
...
@@ -428,6 +440,14 @@ public class AppPermissionService {
nickname
=
userDetail
.
getNickname
();
nickname
=
userDetail
.
getNickname
();
}
}
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
);
// 到im注册,获取返回结果
Integer
imUserId
=
userLogin
.
getImUserid
();
String
imPassword
=
userLogin
.
getImPassword
();
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
String
access_token
=
loginIm
(
userLogin
.
getUsername
(),
imPassword
,
imUserId
);
data
.
put
(
"im_token"
,
access_token
);
data
.
put
(
"im_UserId"
,
imUserId
);
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
}
...
@@ -462,6 +482,14 @@ public class AppPermissionService {
...
@@ -462,6 +482,14 @@ public class AppPermissionService {
Integer
userid
=
user
.
getId
();
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
// 到im注册,获取返回结果
Integer
imUserId
=
user
.
getImUserid
();
String
imPassword
=
user
.
getImPassword
();
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
String
access_token
=
loginIm
(
username
,
imPassword
,
imUserId
);
data
.
put
(
"im_token"
,
access_token
);
data
.
put
(
"im_UserId"
,
imUserId
);
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
}
...
@@ -571,7 +599,7 @@ public class AppPermissionService {
...
@@ -571,7 +599,7 @@ public class AppPermissionService {
//登录im
//登录im
public
String
loginIm
(
String
username
,
String
password
,
String
userId
)
{
public
String
loginIm
(
String
username
,
String
password
,
Integer
userId
)
{
log
.
error
(
"------登录loginIm----username====="
+
username
+
"-----password==="
+
password
+
"---userId==="
+
userId
);
log
.
error
(
"------登录loginIm----username====="
+
username
+
"-----password==="
+
password
+
"---userId==="
+
userId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"telephone"
,
username
);
map
.
put
(
"telephone"
,
username
);
...
...
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