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
b12b237d
Commit
b12b237d
authored
Jun 13, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
1ff1d410
7f6bf439
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
3 deletions
+47
-3
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+29
-1
pom.xml
xx-im/xx-im-server/pom.xml
+16
-1
ImApplication.java
...ver/src/main/java/com/xxfc/platform/im/ImApplication.java
+2
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
b12b237d
...
...
@@ -231,7 +231,11 @@ public class AppPermissionService {
userLogin
.
setId
(
userid
);
userLogin
.
setImPassword
(
imPassword
);
userLogin
.
setImUserid
(
imUserId
);
userLogin
.
setUsername
(
username
);
appUserLoginBiz
.
updateSelectiveById
(
userLogin
);
}
data
.
put
(
"im_token"
,
access_token
);
data
.
put
(
"im_UserId"
,
imUserId
);
}
if
(
data
!=
null
)
{
...
...
@@ -349,6 +353,14 @@ public class AppPermissionService {
}
// 登录结果要做做统一处理
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
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
...
...
@@ -428,6 +440,14 @@ public class AppPermissionService {
nickname
=
userDetail
.
getNickname
();
}
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
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
...
...
@@ -462,6 +482,14 @@ public class AppPermissionService {
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
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
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
...
...
@@ -571,7 +599,7 @@ public class AppPermissionService {
//登录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
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"telephone"
,
username
);
...
...
xx-im/xx-im-server/pom.xml
View file @
b12b237d
...
...
@@ -109,5 +109,20 @@
<scope>
compile
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/ImApplication.java
View file @
b12b237d
...
...
@@ -4,12 +4,13 @@ import com.ace.cache.EnableAceCache;
import
com.github.wxiaoqi.security.auth.client.EnableAceAuthClient
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@SpringBootApplication
@SpringBootApplication
(
exclude
=
DataSourceAutoConfiguration
.
class
)
@EnableDiscoveryClient
@EnableScheduling
@EnableAceAuthClient
...
...
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