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
68c5376c
Commit
68c5376c
authored
Jul 01, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://10.5.52.3/youjj/cloud-platform
into base-modify
parents
f9ffae79
8d0eacc7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
150 additions
and
11 deletions
+150
-11
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+36
-0
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+19
-4
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+17
-0
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+10
-0
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+10
-0
AppUserLoginBiz.java
...om/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
+1
-3
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+15
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+39
-1
ThirdFeign.java
...in/java/com/xxfc/platform/universal/feign/ThirdFeign.java
+3
-3
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
68c5376c
...
@@ -166,4 +166,40 @@ public class AuthController {
...
@@ -166,4 +166,40 @@ public class AuthController {
}
}
/**
* 根据用户id登录 Unbelievable ! ! !
* @param userId
* @return
* @throws Exception
*/
@PostMapping
(
value
=
"/applet/uid/login"
)
public
JSONObject
appletLoginByUserId
(
@RequestParam
(
"userId"
)
Integer
userId
)
throws
Exception
{
JSONObject
data
=
appAuthService
.
appletLoginByUserId
(
userId
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
}
else
{
String
token
=
appAuthService
.
getToken
(
String
.
valueOf
(
data
.
get
(
"username"
)),
data
.
getInteger
(
"userId"
));
data
.
put
(
"token"
,
token
);
}
}
return
data
;
}
@PostMapping
(
value
=
"/applet/registry"
)
public
JSONObject
registryWithApplet
(
@RequestParam
(
"username"
)
String
phone
,
@RequestParam
(
"password"
)
String
pwd
,
@RequestParam
(
"mobilecode"
)
String
code
)
throws
Exception
{
JSONObject
data
=
appAuthService
.
appletRegistry
(
phone
,
pwd
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
}
else
{
String
token
=
appAuthService
.
getToken
(
String
.
valueOf
(
data
.
get
(
"username"
)),
data
.
getInteger
(
"userId"
));
data
.
put
(
"token"
,
token
);
}
}
return
data
;
}
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
68c5376c
...
@@ -6,10 +6,7 @@ import com.github.wxiaoqi.security.api.vo.user.UserInfo;
...
@@ -6,10 +6,7 @@ import com.github.wxiaoqi.security.api.vo.user.UserInfo;
import
com.github.wxiaoqi.security.auth.configuration.FeignConfiguration
;
import
com.github.wxiaoqi.security.auth.configuration.FeignConfiguration
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
/**
...
@@ -51,4 +48,22 @@ public interface IUserService {
...
@@ -51,4 +48,22 @@ public interface IUserService {
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
)
String
username
,
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
)
String
password
);
@RequestParam
(
value
=
"password"
)
String
password
);
/**
* 小程序通过用户id登录登录
* @param userid
* @return
*/
@PostMapping
(
"/api/app/applet/uid/login"
)
JSONObject
appletLogin
(
@RequestParam
(
value
=
"userid"
)
Integer
userid
);
/**
* 小程序注册
* @param phone
* @param pwd
* @param code
* @return
*/
@PostMapping
(
"/api/app/applet/registry"
)
JSONObject
appletRegistry
(
@RequestParam
(
value
=
"phone"
)
String
phone
,
@RequestParam
(
"pwd"
)
String
pwd
,
@RequestParam
(
"code"
)
String
code
);
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
68c5376c
...
@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.auth.service;
...
@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.auth.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
org.springframework.web.bind.annotation.RequestParam
;
public
interface
AuthService
{
public
interface
AuthService
{
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
...
@@ -16,4 +17,20 @@ public interface AuthService {
...
@@ -16,4 +17,20 @@ public interface AuthService {
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
;
String
getToken
(
String
username
,
Integer
id
)
throws
Exception
;
String
getToken
(
String
username
,
Integer
id
)
throws
Exception
;
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
;
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
;
/**
* 使用用户id登录 Unbelievable ! ! !
* @param userid
* @return
*/
JSONObject
appletLoginByUserId
(
Integer
userid
);
/**
* 通过小程序注册
* @param phone
* @param pwd
* @param code
* @return
*/
JSONObject
appletRegistry
(
String
phone
,
String
pwd
,
String
code
);
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
68c5376c
...
@@ -86,4 +86,14 @@ public class AppAuthServiceImpl implements AuthService {
...
@@ -86,4 +86,14 @@ public class AppAuthServiceImpl implements AuthService {
return
userService
.
reset
(
username
,
mobilecode
,
password
);
return
userService
.
reset
(
username
,
mobilecode
,
password
);
}
}
@Override
public
JSONObject
appletLoginByUserId
(
Integer
userid
)
{
return
userService
.
appletLogin
(
userid
);
}
@Override
public
JSONObject
appletRegistry
(
String
phone
,
String
pwd
,
String
code
)
{
return
userService
.
appletRegistry
(
phone
,
pwd
,
code
);
}
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
68c5376c
...
@@ -83,4 +83,14 @@ public class AuthServiceImpl implements AuthService {
...
@@ -83,4 +83,14 @@ public class AuthServiceImpl implements AuthService {
public
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
{
public
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
{
return
userService
.
reset
(
username
,
mobilecode
,
password
);
return
userService
.
reset
(
username
,
mobilecode
,
password
);
}
}
@Override
public
JSONObject
appletLoginByUserId
(
Integer
userid
)
{
return
userService
.
appletLogin
(
userid
);
}
@Override
public
JSONObject
appletRegistry
(
String
phone
,
String
pwd
,
String
code
)
{
return
userService
.
appletRegistry
(
phone
,
pwd
,
code
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
View file @
68c5376c
...
@@ -100,7 +100,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -100,7 +100,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
public
AppUserLogin
checkeUserLogin
(
String
username
)
{
public
AppUserLogin
checkeUserLogin
(
String
username
)
{
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
example
=
new
Example
(
AppUserLogin
.
class
);
example
.
createCriteria
().
andEqualTo
(
"username"
,
username
).
andEqualTo
(
"isdel"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"username"
,
username
).
andEqualTo
(
"isdel"
,
0
)
.
andEqualTo
(
"status"
,
0
)
;
List
<
AppUserLogin
>
userLoginList
=
mapper
.
selectByExample
(
example
);
List
<
AppUserLogin
>
userLoginList
=
mapper
.
selectByExample
(
example
);
if
(
userLoginList
!=
null
&&
userLoginList
.
size
()
!=
0
)
{
if
(
userLoginList
!=
null
&&
userLoginList
.
size
()
!=
0
)
{
return
userLoginList
.
get
(
0
);
return
userLoginList
.
get
(
0
);
...
@@ -149,6 +149,4 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -149,6 +149,4 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
public
AppUserLogin
getUserById
(
Integer
userId
){
public
AppUserLogin
getUserById
(
Integer
userId
){
return
mapper
.
selectByPrimaryKey
(
userId
);
return
mapper
.
selectByPrimaryKey
(
userId
);
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
68c5376c
...
@@ -171,5 +171,20 @@ public class AppUserRest {
...
@@ -171,5 +171,20 @@ public class AppUserRest {
return
appPermissionService
.
upAuthentication
(
userId
,
name
,
idNumber
,
status
);
return
appPermissionService
.
upAuthentication
(
userId
,
name
,
idNumber
,
status
);
}
}
/**
* 通过用户id登录 unbelievable! ! !
* @param userid
* @return
*/
@PostMapping
(
"/applet/uid/login"
)
public
JSONObject
appletLogin
(
@RequestParam
(
value
=
"userid"
)
Integer
userid
){
return
appPermissionService
.
appletLoginByUserId
(
userid
);
}
@PostMapping
(
"/applet/registry"
)
public
JSONObject
appletRegistry
(
@RequestParam
(
value
=
"phone"
)
String
phone
,
@RequestParam
(
"pwd"
)
String
pwd
,
@RequestParam
(
"code"
)
String
code
){
return
appPermissionService
.
appletRegistry
(
phone
,
pwd
,
code
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
68c5376c
...
@@ -283,7 +283,7 @@ public class AppPermissionService {
...
@@ -283,7 +283,7 @@ public class AppPermissionService {
//userRedisTemplate.opsForValue().set("imtoken_" + userid,imtoken_,SystemConfig.REDISTOKENTIME, TimeUnit.SECONDS);
//userRedisTemplate.opsForValue().set("imtoken_" + userid,imtoken_,SystemConfig.REDISTOKENTIME, TimeUnit.SECONDS);
// 返回结果
// 返回结果
// data.put("token", token);
// data.put("token", token);
data
.
put
(
"username"
,
username
);
data
.
put
(
"username"
,
StringUtils
.
isNotEmpty
(
username
)?
username:
userLoign
.
getUsername
()
);
data
.
put
(
"userId"
,
userid
);
data
.
put
(
"userId"
,
userid
);
}
}
...
@@ -657,4 +657,42 @@ public class AppPermissionService {
...
@@ -657,4 +657,42 @@ public class AppPermissionService {
}
}
/**
* 通过用户id登录*** Unbelievable! ! !
* @param uid
* @return
*/
public
JSONObject
appletLoginByUserId
(
Integer
uid
)
{
JSONObject
data
=
autoLogin
(
uid
,
null
,
null
,
null
);
if
(
data
!=
null
){
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"用户不存在"
);
}
/**
*通过小程序注册
* @param username
* @param password
* @param mobilecode
* @return
*/
public
JSONObject
appletRegistry
(
String
username
,
String
password
,
String
mobilecode
){
try
{
// 是否已存在
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
JSONObject
data
=
new
JSONObject
();
if
(
null
==
user
)
{
data
=
register
(
username
,
password
,
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
),
mobilecode
,
null
,
null
,
0
);
}
else
{
data
=
login
(
username
,
null
,
mobilecode
,
2
);
}
return
data
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
EXCEPTION_CODE
,
"出现异常"
);
}
}
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/ThirdFeign.java
View file @
68c5376c
...
@@ -28,7 +28,7 @@ public interface ThirdFeign {
...
@@ -28,7 +28,7 @@ public interface ThirdFeign {
@RequestMapping
(
value
=
"/sms/app/unauth/send"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/sms/app/unauth/send"
,
method
=
RequestMethod
.
GET
)
public
JSONObject
send
(
@RequestParam
(
value
=
"phone"
)
String
phone
);
public
JSONObject
send
(
@RequestParam
(
value
=
"phone"
)
String
phone
);
@RequestMapping
(
value
=
"/file/app/unauth/uploadFiles"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/file/app/unauth/uploadFiles"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
uploadFiles
(
@RequestParam
(
"files"
)
MultipartFile
[]
files
);
public
JSONObject
uploadFiles
(
@RequestParam
(
value
=
"files"
)
MultipartFile
[]
files
);
@RequestMapping
(
value
=
"/pay/app/wx"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/pay/app/wx"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wx
(
@RequestBody
OrderPayVo
orderPayVo
);
public
JSONObject
wx
(
@RequestBody
OrderPayVo
orderPayVo
);
@RequestMapping
(
value
=
"/refund/app/wx"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/refund/app/wx"
,
method
=
RequestMethod
.
POST
)
...
@@ -61,9 +61,9 @@ public interface ThirdFeign {
...
@@ -61,9 +61,9 @@ public interface ThirdFeign {
// @GetMapping(value = "/dictionary/getParents")
// @GetMapping(value = "/dictionary/getParents")
@RequestMapping
(
value
=
"/dictionary/getParents"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/dictionary/getParents"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGetParent
(
@RequestParam
String
type
);
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGetParent
(
@RequestParam
(
value
=
"type"
)
String
type
);
// @GetMapping(value = "/dictionary/get")
// @GetMapping(value = "/dictionary/get")
@RequestMapping
(
value
=
"/dictionary/get"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/dictionary/get"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGet
(
@RequestParam
Map
<
String
,
Object
>
dictionary
);
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGet
(
@RequestParam
(
value
=
"dictionary"
)
Map
<
String
,
Object
>
dictionary
);
}
}
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