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
4cab2170
Commit
4cab2170
authored
Jul 13, 2023
by
王亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update previous code.(Wechat appId)
parent
e7f9695a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
5 deletions
+60
-5
WechatConfiguration.java
...a/cn/quantgroup/xyqb/config/data/WechatConfiguration.java
+5
-0
UserConstant.java
src/main/java/cn/quantgroup/xyqb/constant/UserConstant.java
+1
-1
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+23
-3
WeChatController.java
...quantgroup/xyqb/controller/external/WeChatController.java
+12
-0
InnerController.java
...tgroup/xyqb/controller/internal/user/InnerController.java
+7
-0
AppletController.java
...xyqb/controller/middleoffice/applet/AppletController.java
+8
-1
WechatConfigBean.java
src/main/java/cn/quantgroup/xyqb/model/WechatConfigBean.java
+4
-0
No files found.
src/main/java/cn/quantgroup/xyqb/config/data/WechatConfiguration.java
View file @
4cab2170
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.config.data;
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.config.data;
import
cn.quantgroup.xyqb.exception.BizException
;
import
cn.quantgroup.xyqb.exception.BizException
;
import
cn.quantgroup.xyqb.exception.BizExceptionEnum
;
import
cn.quantgroup.xyqb.exception.BizExceptionEnum
;
import
cn.quantgroup.xyqb.model.WechatConfigBean
;
import
cn.quantgroup.xyqb.model.WechatConfigBean
;
import
cn.quantgroup.xyqb.util.StringUtils
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.ConfigService
;
import
lombok.Getter
;
import
lombok.Getter
;
...
@@ -32,4 +33,8 @@ public class WechatConfiguration {
...
@@ -32,4 +33,8 @@ public class WechatConfiguration {
return
optional
.
get
();
return
optional
.
get
();
}
}
}
}
public
WechatConfigBean
getDefault
(){
return
list
.
stream
().
filter
(
WechatConfigBean:
:
isDefaultMini
).
findFirst
().
get
();
}
}
}
src/main/java/cn/quantgroup/xyqb/constant/UserConstant.java
View file @
4cab2170
...
@@ -10,7 +10,7 @@ public class UserConstant {
...
@@ -10,7 +10,7 @@ public class UserConstant {
public
static
final
Integer
defaultTenantId
=
560761
;
public
static
final
Integer
defaultTenantId
=
560761
;
public
static
final
String
defaultTenantIdString
=
"560761"
;
public
static
final
String
defaultTenantIdString
=
"560761"
;
public
static
final
String
defaultAppId
=
"
560761
"
;
public
static
final
String
defaultAppId
=
""
;
public
static
final
String
IMAGE_FORMAT_PNG
=
"png"
;
public
static
final
String
IMAGE_FORMAT_PNG
=
"png"
;
public
static
final
String
IMG_BASE64_PATTREN
=
"data:image/"
+
IMAGE_FORMAT_PNG
+
";base64,%s"
;
public
static
final
String
IMG_BASE64_PATTREN
=
"data:image/"
+
IMAGE_FORMAT_PNG
+
";base64,%s"
;
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
4cab2170
...
@@ -7,6 +7,7 @@ import cn.quantgroup.xyqb.aspect.captcha.CaptchaNewValidator;
...
@@ -7,6 +7,7 @@ import cn.quantgroup.xyqb.aspect.captcha.CaptchaNewValidator;
import
cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator
;
import
cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator
;
import
cn.quantgroup.xyqb.aspect.limit.PasswordFreeAccessValidator
;
import
cn.quantgroup.xyqb.aspect.limit.PasswordFreeAccessValidator
;
import
cn.quantgroup.xyqb.aspect.lock.PasswordErrorFiniteValidator
;
import
cn.quantgroup.xyqb.aspect.lock.PasswordErrorFiniteValidator
;
import
cn.quantgroup.xyqb.config.data.WechatConfiguration
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.constant.enums.LoginType
;
import
cn.quantgroup.xyqb.constant.enums.LoginType
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
...
@@ -98,6 +99,9 @@ public class UserController implements IBaseController {
...
@@ -98,6 +99,9 @@ public class UserController implements IBaseController {
@Autowired
@Autowired
private
IGeetestLogService
geetestLogService
;
private
IGeetestLogService
geetestLogService
;
@Autowired
private
WechatConfiguration
wechatConfiguration
;
/**
/**
* 登录(账号 + 密码)
* 登录(账号 + 密码)
...
@@ -126,6 +130,9 @@ public class UserController implements IBaseController {
...
@@ -126,6 +130,9 @@ public class UserController implements IBaseController {
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
,
,
HttpServletRequest
request
)
{
HttpServletRequest
request
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
log
.
info
(
"loginV1 -> channelId:{},appChennel:{},createdFrom:{},userId:{},key:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
);
log
.
info
(
"loginV1 -> channelId:{},appChennel:{},createdFrom:{},userId:{},key:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
);
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
,
null
,
request
,
appId
,
tenantId
);
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
,
null
,
request
,
appId
,
tenantId
);
}
}
...
@@ -160,6 +167,10 @@ public class UserController implements IBaseController {
...
@@ -160,6 +167,10 @@ public class UserController implements IBaseController {
@RequestParam
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
@RequestParam
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
)
{
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
log
.
info
(
"loginV2 -> channelId:{},appChennel:{},createdFrom:{},userId:{},key:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
);
log
.
info
(
"loginV2 -> channelId:{},appChennel:{},createdFrom:{},userId:{},key:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
);
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
,
geetestlog_id
,
request
,
appId
,
tenantId
);
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
,
geetestlog_id
,
request
,
appId
,
tenantId
);
}
}
...
@@ -183,6 +194,9 @@ public class UserController implements IBaseController {
...
@@ -183,6 +194,9 @@ public class UserController implements IBaseController {
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
)
{
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
log
.
info
(
"login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
);
log
.
info
(
"login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
dimension
);
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
merchant
==
null
)
{
if
(
merchant
==
null
)
{
...
@@ -221,6 +235,9 @@ public class UserController implements IBaseController {
...
@@ -221,6 +235,9 @@ public class UserController implements IBaseController {
@RequestParam
(
required
=
false
)
Integer
tenantId
,
@RequestParam
(
required
=
false
)
Integer
tenantId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
HttpServletRequest
request
)
{
HttpServletRequest
request
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
log
.
info
(
"login/fastV1 -> channelId:{},ZappChennel:{},createdFrom:{},key:{},btRegisterChannelId:{},dimension:{},clickId:{}"
,
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
clickId
);
log
.
info
(
"login/fastV1 -> channelId:{},ZappChennel:{},createdFrom:{},key:{},btRegisterChannelId:{},dimension:{},clickId:{}"
,
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
clickId
);
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
clickId
,
tenantId
,
null
,
appId
,
request
);
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
clickId
,
tenantId
,
null
,
appId
,
request
);
}
}
...
@@ -242,6 +259,9 @@ public class UserController implements IBaseController {
...
@@ -242,6 +259,9 @@ public class UserController implements IBaseController {
@RequestParam
(
required
=
false
)
Long
geetestLogId
,
@RequestParam
(
required
=
false
)
Long
geetestLogId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
,
HttpServletRequest
request
)
{
HttpServletRequest
request
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
Map
<
String
,
JsonResult
>
validMap
=
getHeaderParam
(
request
);
Map
<
String
,
JsonResult
>
validMap
=
getHeaderParam
(
request
);
log
.
info
(
"login/fast -> channelId:{},appChannel:{},createdFrom:{},btRegisterChannelId:{},key:{},dimension:{},clickId:{}"
,
channelId
,
appChannel
,
createdFrom
,
btRegisterChannelId
,
key
,
dimension
,
clickId
);
log
.
info
(
"login/fast -> channelId:{},appChannel:{},createdFrom:{},btRegisterChannelId:{},key:{},dimension:{},clickId:{}"
,
channelId
,
appChannel
,
createdFrom
,
btRegisterChannelId
,
key
,
dimension
,
clickId
);
JsonResult
failResult
=
validMap
.
get
(
Constants
.
CHECK_FAIL
);
JsonResult
failResult
=
validMap
.
get
(
Constants
.
CHECK_FAIL
);
...
@@ -538,12 +558,12 @@ public class UserController implements IBaseController {
...
@@ -538,12 +558,12 @@ public class UserController implements IBaseController {
if
(
token
.
contains
(
Constants
.
TOKEN_MASTER
))
{
if
(
token
.
contains
(
Constants
.
TOKEN_MASTER
))
{
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
}
}
SessionStruct
sessionStruct
=
XyqbSessionContextHolder
.
getXSessionFromRedis
(
token
,
tenantId
);
SessionStruct
sessionStruct
=
XyqbSessionContextHolder
.
getXSessionFromRedis
(
token
,
tenantId
);
if
(
sessionStruct
==
null
||
sessionStruct
.
getValues
()
==
null
)
{
if
(
sessionStruct
==
null
||
sessionStruct
.
getValues
()
==
null
)
{
// 使用token去电商查询信息, 如果token 不包含本系统token前缀
// 使用token去电商查询信息, 如果token 不包含本系统token前缀
if
(!
token
.
contains
(
prefix
))
{
if
(!
token
.
contains
(
prefix
))
{
findTokenExchange
(
token
,
tenantId
);
findTokenExchange
(
token
,
tenantId
);
sessionStruct
=
XyqbSessionContextHolder
.
getXSessionFromRedis
(
token
,
tenantId
);
sessionStruct
=
XyqbSessionContextHolder
.
getXSessionFromRedis
(
token
,
tenantId
);
if
(
sessionStruct
==
null
||
sessionStruct
.
getValues
()
==
null
)
{
if
(
sessionStruct
==
null
||
sessionStruct
.
getValues
()
==
null
)
{
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
return
JsonResult
.
buildSuccessResult
(
null
,
result
);
}
}
...
@@ -584,7 +604,7 @@ public class UserController implements IBaseController {
...
@@ -584,7 +604,7 @@ public class UserController implements IBaseController {
if
(
token
.
contains
(
Constants
.
TOKEN_MASTER
))
{
if
(
token
.
contains
(
Constants
.
TOKEN_MASTER
))
{
return
JsonResult
.
buildSuccessResult
(
null
,
tokenExchange
);
return
JsonResult
.
buildSuccessResult
(
null
,
tokenExchange
);
}
}
SessionStruct
sessionStruct
=
XyqbSessionContextHolder
.
getXSessionFromRedis
(
token
,
tenantId
);
SessionStruct
sessionStruct
=
XyqbSessionContextHolder
.
getXSessionFromRedis
(
token
,
tenantId
);
if
(
sessionStruct
==
null
||
sessionStruct
.
getValues
()
==
null
)
{
if
(
sessionStruct
==
null
||
sessionStruct
.
getValues
()
==
null
)
{
return
JsonResult
.
buildSuccessResult
(
null
,
tokenExchange
);
return
JsonResult
.
buildSuccessResult
(
null
,
tokenExchange
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/WeChatController.java
View file @
4cab2170
package
cn
.
quantgroup
.
xyqb
.
controller
.
external
;
package
cn
.
quantgroup
.
xyqb
.
controller
.
external
;
import
cn.quantgroup.xyqb.config.data.WechatConfiguration
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.constant.enums.LoginType
;
import
cn.quantgroup.xyqb.constant.enums.LoginType
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.Constants
;
...
@@ -67,6 +68,9 @@ public class WeChatController implements IBaseController {
...
@@ -67,6 +68,9 @@ public class WeChatController implements IBaseController {
@Autowired
@Autowired
private
IUserService
userService
;
private
IUserService
userService
;
@Autowired
private
WechatConfiguration
wechatConfiguration
;
/**
/**
* 用户中心UI的http协议头域名
* 用户中心UI的http协议头域名
* http://passport.xyqb.com
* http://passport.xyqb.com
...
@@ -189,6 +193,11 @@ public class WeChatController implements IBaseController {
...
@@ -189,6 +193,11 @@ public class WeChatController implements IBaseController {
String
redirect
=
null
;
String
redirect
=
null
;
String
schema
=
null
;
String
schema
=
null
;
String
customRedirect
=
null
;
String
customRedirect
=
null
;
if
(
StringUtils
.
isEmpty
(
appId
)){
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
try
{
try
{
extData
=
new
String
(
Base64
.
decodeBase64
(
extData
),
"UTF-8"
);
extData
=
new
String
(
Base64
.
decodeBase64
(
extData
),
"UTF-8"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
...
@@ -356,6 +365,9 @@ public class WeChatController implements IBaseController {
...
@@ -356,6 +365,9 @@ public class WeChatController implements IBaseController {
if
(
Objects
.
equals
(
Constants
.
PROTOCOL_HEAD_HTTPS
,
request
.
getScheme
()))
{
if
(
Objects
.
equals
(
Constants
.
PROTOCOL_HEAD_HTTPS
,
request
.
getScheme
()))
{
schema
=
Constants
.
PROTOCOL_HEAD_HTTPS
;
schema
=
Constants
.
PROTOCOL_HEAD_HTTPS
;
}
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
receiveCodeWithDefault
(
code
,
systemKey
,
schema
,
registerFrom
,
redirect
,
redirect
,
response
,
appId
,
tenantId
);
receiveCodeWithDefault
(
code
,
systemKey
,
schema
,
registerFrom
,
redirect
,
redirect
,
response
,
appId
,
tenantId
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/InnerController.java
View file @
4cab2170
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.controller.internal.user;
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.controller.internal.user;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.aspect.accessable.IpValidator
;
import
cn.quantgroup.xyqb.aspect.accessable.IpValidator
;
import
cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator
;
import
cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator
;
import
cn.quantgroup.xyqb.config.data.WechatConfiguration
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.controller.internal.user.resp.UserFullResp
;
import
cn.quantgroup.xyqb.controller.internal.user.resp.UserFullResp
;
...
@@ -87,6 +88,8 @@ public class InnerController implements IBaseController {
...
@@ -87,6 +88,8 @@ public class InnerController implements IBaseController {
@Autowired
@Autowired
private
StmsRemoteService
stmsRemoteService
;
private
StmsRemoteService
stmsRemoteService
;
@Autowired
private
WechatConfiguration
wechatConfiguration
;
@Autowired
@Autowired
private
IUserDeregisterService
userDeregisterService
;
private
IUserDeregisterService
userDeregisterService
;
...
@@ -577,6 +580,10 @@ public class InnerController implements IBaseController {
...
@@ -577,6 +580,10 @@ public class InnerController implements IBaseController {
public
JsonResult
queryOpenIdByPhoneNo
(
String
phoneNo
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
public
JsonResult
queryOpenIdByPhoneNo
(
String
phoneNo
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_TENANT
,
defaultValue
=
UserConstant
.
defaultTenantIdString
)
Integer
tenantId
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
)
{
,
@RequestHeader
(
value
=
Constants
.
X_AUTH_APP_ID
,
defaultValue
=
UserConstant
.
defaultAppId
)
String
appId
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"手机号格式错误"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"手机号格式错误"
,
null
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/applet/AppletController.java
View file @
4cab2170
package
cn
.
quantgroup
.
xyqb
.
controller
.
middleoffice
.
applet
;
package
cn
.
quantgroup
.
xyqb
.
controller
.
middleoffice
.
applet
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.config.data.WechatConfiguration
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.constant.UserConstant
;
import
cn.quantgroup.xyqb.controller.middleoffice.login.ILoginModule
;
import
cn.quantgroup.xyqb.controller.middleoffice.login.ILoginModule
;
import
cn.quantgroup.xyqb.controller.middleoffice.login.LoginVo
;
import
cn.quantgroup.xyqb.controller.middleoffice.login.LoginVo
;
import
cn.quantgroup.xyqb.entity.middleoffice.AppletParamEntry
;
import
cn.quantgroup.xyqb.entity.middleoffice.AppletParamEntry
;
import
cn.quantgroup.xyqb.exception.DataException
;
import
cn.quantgroup.xyqb.exception.DataException
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.WechatConfigBean
;
import
cn.quantgroup.xyqb.service.middleoffice.applet.IAppletService
;
import
cn.quantgroup.xyqb.service.middleoffice.applet.IAppletService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -36,6 +38,9 @@ public class AppletController {
...
@@ -36,6 +38,9 @@ public class AppletController {
private
final
IAppletService
iAppletService
;
private
final
IAppletService
iAppletService
;
private
ILoginModule
loginModule
;
private
ILoginModule
loginModule
;
@Autowired
private
WechatConfiguration
wechatConfiguration
;
@Autowired
@Autowired
AppletController
(
IAppletService
iAppletService
,
AppletController
(
IAppletService
iAppletService
,
ILoginModule
loginModule
ILoginModule
loginModule
...
@@ -70,7 +75,9 @@ public class AppletController {
...
@@ -70,7 +75,9 @@ public class AppletController {
if
(!
containsAppName
(
appName
))
{
if
(!
containsAppName
(
appName
))
{
throw
new
DataException
(
"appName不合法"
);
throw
new
DataException
(
"appName不合法"
);
}
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
appId
))
{
appId
=
wechatConfiguration
.
getDefault
().
getAppId
();
}
LoginVo
login
=
iAppletService
.
login
(
appName
,
openId
,
tenantId
,
utmSource
,
unionId
,
appId
);
LoginVo
login
=
iAppletService
.
login
(
appName
,
openId
,
tenantId
,
utmSource
,
unionId
,
appId
);
return
JsonResult
.
buildSuccessResultGeneric
(
login
);
return
JsonResult
.
buildSuccessResultGeneric
(
login
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/model/WechatConfigBean.java
View file @
4cab2170
...
@@ -11,4 +11,8 @@ public class WechatConfigBean {
...
@@ -11,4 +11,8 @@ public class WechatConfigBean {
* 0:为小程序
* 0:为小程序
*/
*/
private
Integer
type
;
private
Integer
type
;
/**
* 是否是默认的小程序
*/
private
boolean
defaultMini
;
}
}
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