Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
30afb6e1
Commit
30afb6e1
authored
Jun 11, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(96333):公众号登录报错问题处理
parent
ba49be21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
WechatController.java
...boot/module/elevator/biz/controller/WechatController.java
+19
-10
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/controller/WechatController.java
View file @
30afb6e1
...
@@ -19,15 +19,13 @@ import com.yeejoin.amos.boot.module.elevator.api.entity.DispatchTask;
...
@@ -19,15 +19,13 @@ import com.yeejoin.amos.boot.module.elevator.api.entity.DispatchTask;
import
com.yeejoin.amos.boot.module.elevator.api.entity.WechatRelation
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.WechatRelation
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IDispatchTaskService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IDispatchTaskService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IWechatService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IWechatService
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.*
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.AlertFormValueServiceImpl
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.DispatchTaskServiceImpl
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.WechatRelationServiceImpl
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.HttpUtils
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.HttpUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.model.LoginInfoModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.SmsRecordModel
;
import
com.yeejoin.amos.feign.systemctl.model.SmsRecordModel
;
...
@@ -51,6 +49,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -51,6 +49,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
@@ -122,6 +121,8 @@ public class WechatController extends BaseController {
...
@@ -122,6 +121,8 @@ public class WechatController extends BaseController {
ISourceFileService
sourceFileService
;
ISourceFileService
sourceFileService
;
private
Long
TOKEN_TIME
=
1209600
l
;
private
Long
TOKEN_TIME
=
1209600
l
;
@Autowired
private
StartPlatformTokenService
startPlatformTokenService
;
/**
/**
* 获取微信回调信息返回验证是否通过
* 获取微信回调信息返回验证是否通过
...
@@ -310,8 +311,12 @@ public class WechatController extends BaseController {
...
@@ -310,8 +311,12 @@ public class WechatController extends BaseController {
if
(
ValidationUtil
.
isEmpty
(
model
.
getOpenId
())
||
ValidationUtil
.
isEmpty
(
model
.
getPhone
())
if
(
ValidationUtil
.
isEmpty
(
model
.
getOpenId
())
||
ValidationUtil
.
isEmpty
(
model
.
getPhone
())
||
ValidationUtil
.
isEmpty
(
model
.
getCode
()))
||
ValidationUtil
.
isEmpty
(
model
.
getCode
()))
throw
new
BadRequest
(
"参数校验失败."
);
throw
new
BadRequest
(
"参数校验失败."
);
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
startPlatformTokenService
.
getToken
();
logger
.
info
(
"========================请求登录接口token"
+
RequestContext
.
getToken
());
FeignClientResult
<
LoginInfoModel
>
loginInfo
=
Privilege
.
agencyUserClient
.
getLoginInfo
(
model
.
getPhone
());
String
passwd
=
DesUtil
.
encode
(
"a_"
+
model
.
getPhone
(),
"qaz"
);
String
passwd
=
DesUtil
.
encode
(
"a_"
+
model
.
getPhone
(),
"qaz"
);
if
(
loginInfo
==
null
||
loginInfo
.
getResult
()
==
null
)
{
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setUserName
(
model
.
getPhone
());
agencyUserModel
.
setUserName
(
model
.
getPhone
());
agencyUserModel
.
setRealName
(
model
.
getPhone
());
agencyUserModel
.
setRealName
(
model
.
getPhone
());
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
...
@@ -320,6 +325,7 @@ public class WechatController extends BaseController {
...
@@ -320,6 +325,7 @@ public class WechatController extends BaseController {
agencyUserModel
.
setAgencyCode
(
"tzs"
);
agencyUserModel
.
setAgencyCode
(
"tzs"
);
agencyUserModel
.
setMobile
(
model
.
getPhone
());
agencyUserModel
.
setMobile
(
model
.
getPhone
());
agencyUserModel
.
setVerifyCode
(
model
.
getCode
());
agencyUserModel
.
setVerifyCode
(
model
.
getCode
());
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
mobileRegister
(
agencyUserModel
);
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
mobileRegister
(
agencyUserModel
);
agencyUserModel
=
result
.
getResult
();
agencyUserModel
=
result
.
getResult
();
if
(
agencyUserModel
!=
null
&&
StringUtils
.
isNotBlank
(
agencyUserModel
.
getUserId
()))
{
if
(
agencyUserModel
!=
null
&&
StringUtils
.
isNotBlank
(
agencyUserModel
.
getUserId
()))
{
...
@@ -328,19 +334,22 @@ public class WechatController extends BaseController {
...
@@ -328,19 +334,22 @@ public class WechatController extends BaseController {
}
else
{
}
else
{
throw
new
BadRequest
(
"注册失败"
);
throw
new
BadRequest
(
"注册失败"
);
}
}
}
else
{
model
.
setUserId
(
loginInfo
.
getResult
().
getUserId
());
wechatRelationServiceImpl
.
createWithModel
(
model
);
}
WechatAccessDto
dto
=
new
WechatAccessDto
();
WechatAccessDto
dto
=
new
WechatAccessDto
();
dto
.
setOpenId
(
model
.
getOpenId
());
dto
.
setOpenId
(
model
.
getOpenId
());
dto
.
setTel
(
model
.
getPhone
());
dto
.
setTel
(
model
.
getPhone
());
IdPasswordAuthModel
lo
n
inData
=
new
IdPasswordAuthModel
();
IdPasswordAuthModel
lo
g
inData
=
new
IdPasswordAuthModel
();
lo
n
inData
.
setLoginId
(
model
.
getPhone
());
lo
g
inData
.
setLoginId
(
model
.
getPhone
());
lo
n
inData
.
setPassword
(
passwd
);
lo
g
inData
.
setPassword
(
passwd
);
FeignClientResult
loginResult
=
Privilege
.
authClient
.
idpassword
(
lo
n
inData
);
FeignClientResult
loginResult
=
Privilege
.
authClient
.
idpassword
(
lo
g
inData
);
if
(
loginResult
.
getStatus
()
==
200
)
{
if
(
loginResult
.
getStatus
()
==
200
)
{
HashMap
resultMap
=
(
HashMap
)
loginResult
.
getResult
();
HashMap
resultMap
=
(
HashMap
)
loginResult
.
getResult
();
dto
.
setToken
(
resultMap
.
get
(
"token"
).
toString
());
dto
.
setToken
(
resultMap
.
get
(
"token"
).
toString
());
redisUtils
.
set
(
model
.
getPhone
()
+
"_token"
,
resultMap
.
get
(
"token"
).
toString
(),
TOKEN_TIME
);
redisUtils
.
set
(
model
.
getPhone
()
+
"_token"
,
resultMap
.
get
(
"token"
).
toString
(),
TOKEN_TIME
);
}
}
return
ResponseHelper
.
buildResponse
(
dto
);
return
ResponseHelper
.
buildResponse
(
dto
);
}
}
...
...
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