Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
8b5c3556
提交
8b5c3556
authored
5月 30, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
http://git.mmcuav.cn/iuav/cms
# Conflicts: # kustomization/overlays/prod/kustomization.yaml
上级
10e30b18
e672359c
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
193 行增加
和
35 行删除
+193
-35
LoginSuccessDTO.java
...ain/java/com/mmc/iuav/user/model/dto/LoginSuccessDTO.java
+1
-0
AppUserSucVO.java
...rc/main/java/com/mmc/iuav/user/model/vo/AppUserSucVO.java
+4
-0
CompanyAuthVO.java
...c/main/java/com/mmc/iuav/user/model/vo/CompanyAuthVO.java
+2
-2
JwtConstant.java
...mon-util/src/main/java/com/mmc/iuav/auth/JwtConstant.java
+1
-0
ResultEnum.java
...-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
+2
-2
TokenCheckHandleInterceptor.java
...a/com/mmc/iuav/user/auth/TokenCheckHandleInterceptor.java
+17
-16
BaseController.java
...ain/java/com/mmc/iuav/user/controller/BaseController.java
+7
-1
CompanyAuthController.java
...a/com/mmc/iuav/user/controller/CompanyAuthController.java
+13
-2
CooperationController.java
...a/com/mmc/iuav/user/controller/CooperationController.java
+7
-0
TempLoginController.java
...ava/com/mmc/iuav/user/controller/TempLoginController.java
+42
-0
CooperationDao.java
...r/src/main/java/com/mmc/iuav/user/dao/CooperationDao.java
+7
-0
AuthService.java
.../src/main/java/com/mmc/iuav/user/service/AuthService.java
+16
-0
CooperationService.java
...in/java/com/mmc/iuav/user/service/CooperationService.java
+7
-0
AuthServiceImpl.java
.../java/com/mmc/iuav/user/service/impl/AuthServiceImpl.java
+43
-7
CooperationServiceImpl.java
...om/mmc/iuav/user/service/impl/CooperationServiceImpl.java
+9
-0
application-dev.yml
...e/cms-service-user/src/main/resources/application-dev.yml
+1
-1
application-local.yml
...cms-service-user/src/main/resources/application-local.yml
+1
-1
CooperationDao.xml
...service-user/src/main/resources/mapper/CooperationDao.xml
+6
-1
not-check.yml
...service/cms-service-user/src/main/resources/not-check.yml
+5
-1
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
kustomization.yaml
kustomization/overlays/prod/kustomization.yaml
+1
-0
没有找到文件。
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/dto/LoginSuccessDTO.java
浏览文件 @
8b5c3556
...
...
@@ -21,6 +21,7 @@ public class LoginSuccessDTO implements Serializable {
private
String
token
;
private
Integer
userAccountId
;
private
String
accountNo
;
private
Integer
portType
;
private
String
uid
;
private
String
phoneNum
;
private
String
userName
;
...
...
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/AppUserSucVO.java
浏览文件 @
8b5c3556
...
...
@@ -30,4 +30,8 @@ public class AppUserSucVO implements Serializable {
private
String
nickName
;
@ApiModelProperty
(
value
=
"sessionKey"
)
private
String
sessionKey
;
@ApiModelProperty
(
value
=
"端口:0后台管理账号 ; 100云享飞-客户端;"
)
private
Integer
portType
;
@ApiModelProperty
(
value
=
"端口:0后台管理账号 ; 100云享飞-客户端;"
)
private
Integer
authStatus
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/CompanyAuthVO.java
浏览文件 @
8b5c3556
...
...
@@ -25,8 +25,8 @@ public class CompanyAuthVO implements Serializable {
@ApiModelProperty
(
value
=
"id"
)
@NotNull
(
message
=
"id创建修改不能为空"
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@ApiModelProperty
(
value
=
"用户id"
)
@NotNull
(
message
=
"用户id不能为空"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
@ApiModelProperty
(
value
=
"用户id"
,
hidden
=
true
)
//
@NotNull(message = "用户id不能为空", groups = { Insert.class, Update.class})
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"企业名称"
)
@NotBlank
(
message
=
"企业名称"
,
groups
=
{
Insert
.
class
,
Update
.
class
})
...
...
cms-common/cms-common-util/src/main/java/com/mmc/iuav/auth/JwtConstant.java
浏览文件 @
8b5c3556
...
...
@@ -9,6 +9,7 @@ public interface JwtConstant {
public
final
static
String
SUBJECT
=
"mmc_iuav888"
;
public
final
static
String
ISSUER
=
"mmc_uav"
;
public
final
static
long
EXPIRATION
=
1
*
24
*
60
*
60
*
1000L
;
public
final
static
long
TEMP_EXPIRATION
=
10
*
60
*
1000L
;
public
final
static
String
TOKEN_TYPE
=
"TOKEN_TYPE"
;
public
final
static
String
M_TOKEN
=
"M_TOKEN"
;
//后台管理用户token
public
final
static
String
IUAV_TOKEN
=
"IUAV_TOKEN"
;
//小程序token
...
...
cms-common/cms-common-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
浏览文件 @
8b5c3556
...
...
@@ -16,7 +16,7 @@ public enum ResultEnum implements BaseErrorInfoInterface{
LOGIN_ACCOUNT_NOT_EXIT_ERROR
(
"5005"
,
"账号不存在"
),
LOGIN_PASSWORD_ERROR
(
"5006"
,
"密码错误"
),
LOGIN_ACCOUNT_STATUS_ERROR
(
"5008"
,
"
外部访问
"
),
LOGIN_ACCOUNT_STATUS_ERROR
(
"5008"
,
"
未登录
"
),
//微信相关
PASSWORD_INCONSISTENT
(
"5026"
,
"新密码与确认密码不一致,请确认一致"
),
...
...
@@ -31,7 +31,7 @@ public enum ResultEnum implements BaseErrorInfoInterface{
APPLET_PORT_TYPE_ERROR
(
"7001"
,
"小程序端口类型错误"
),
APPLET_LOGIN_ERROR
(
"7002"
,
"获取小程序登录失败"
),
APPLET_LOGIN_ERROR
(
"7002"
,
"获取小程序登录
信息
失败"
),
UPDATE_USER_ACCOUNT_REPEAT
(
"7003"
,
"修改后的账户名已存在"
),
ADD_USER_ACCOUNT_NAME_EXISTS
(
"7004"
,
"新增账户名已经存在"
);
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/auth/TokenCheckHandleInterceptor.java
浏览文件 @
8b5c3556
...
...
@@ -31,23 +31,24 @@ public class TokenCheckHandleInterceptor implements HandlerInterceptor {
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
//扫码登录还没做好,暂时先注释
// String requestURI = request.getRequestURI();
String
requestURI
=
request
.
getRequestURI
();
// //根据uri确认是否要拦截
// if (!shouldFilter(requestURI)){
// return true;
// }
// String token = request.getHeader("token");
// String tokenJson = stringRedisTemplate.opsForValue().get(token);
//
// if (StringUtils.isBlank(tokenJson)){
// exceptionProcess(response);
// return false;
// }
// LoginSuccessDTO loginSuccessDTO = JSONObject.parseObject(tokenJson, LoginSuccessDTO.class);
// if (loginSuccessDTO != null){
// request.setAttribute("userAccountId", loginSuccessDTO.getUserAccountId());
// }
if
(!
shouldFilter
(
requestURI
)){
return
true
;
}
if
(
request
.
getServerName
().
equals
(
"iuav.mmcuav.cn"
)
||
request
.
getServerName
().
equals
(
"test.iuav.mmcuav.cn"
)){
String
token
=
request
.
getHeader
(
"token"
);
if
(
StringUtils
.
isBlank
(
token
)){
exceptionProcess
(
response
);
return
false
;
}
String
tokenJson
=
stringRedisTemplate
.
opsForValue
().
get
(
token
);
if
(
StringUtils
.
isBlank
(
tokenJson
)){
exceptionProcess
(
response
);
return
false
;
}
return
true
;
}
return
true
;
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/BaseController.java
浏览文件 @
8b5c3556
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import
com.mmc.iuav.auth.JwtConstant
;
import
com.mmc.iuav.auth.JwtUtil
;
import
com.mmc.iuav.http.BizException
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.user.model.dto.BaseAccountDTO
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
...
...
@@ -13,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.PrintWriter
;
/**
* @author: zj
...
...
@@ -46,8 +49,11 @@ public abstract class BaseController {
* @param request
* @return
*/
public
LoginSuccessDTO
getUserLoginInfoFromRedis
(
HttpServletRequest
request
)
{
public
LoginSuccessDTO
getUserLoginInfoFromRedis
(
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"token"
);
if
(
StringUtils
.
isBlank
(
token
)){
throw
new
BizException
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
);
}
String
json
=
stringRedisTemplate
.
opsForValue
().
get
(
token
);
if
(
StringUtils
.
isBlank
(
json
)){
throw
new
BizException
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
);
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/CompanyAuthController.java
浏览文件 @
8b5c3556
...
...
@@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author: zj
* @Date: 2023/5/17 13:33
...
...
@@ -18,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
@Api
(
tags
=
"企业认证相关"
)
@RequestMapping
(
"/company-auth/"
)
@RestController
public
class
CompanyAuthController
{
public
class
CompanyAuthController
extends
BaseController
{
@Autowired
private
CompanyAuthService
companyAuthService
;
...
...
@@ -26,7 +28,9 @@ public class CompanyAuthController {
@ApiOperation
(
value
=
"提交企业认证"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@PostMapping
(
"add"
)
public
ResultBody
add
(
@Validated
(
value
=
{
Insert
.
class
})
@RequestBody
CompanyAuthVO
companyAuthVO
){
public
ResultBody
add
(
@Validated
(
value
=
{
Insert
.
class
})
@RequestBody
CompanyAuthVO
companyAuthVO
,
HttpServletRequest
request
){
Integer
userAccountId
=
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
();
companyAuthVO
.
setUserAccountId
(
userAccountId
);
return
companyAuthService
.
add
(
companyAuthVO
);
}
...
...
@@ -36,4 +40,11 @@ public class CompanyAuthController {
public
ResultBody
fuzzyQueryCompany
(
@ApiParam
(
value
=
"企业名称"
,
required
=
true
)
@RequestParam
String
searchKey
)
{
return
companyAuthService
.
fuzzyQueryCompany
(
searchKey
);
}
@ApiOperation
(
value
=
"企业认证详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
CompanyAuthVO
.
class
)
})
@GetMapping
(
"getCompanyAuthInfo"
)
public
ResultBody
getCompanyAuthInfo
(
@RequestParam
Integer
userAccountId
)
{
return
ResultBody
.
success
(
companyAuthService
.
getCompanyAuthByUId
(
userAccountId
));
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/CooperationController.java
浏览文件 @
8b5c3556
...
...
@@ -29,6 +29,13 @@ public class CooperationController {
return
cooperationService
.
listTag
();
}
@ApiOperation
(
value
=
"根据id获取标签信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
CooperationTagVO
.
class
)
})
@GetMapping
(
"getTagById"
)
public
ResultBody
getTagById
(
@RequestParam
(
"id"
)
Integer
id
)
{
return
cooperationService
.
getTagById
(
id
);
}
@ApiOperation
(
value
=
"申请加盟"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@PostMapping
(
"apply"
)
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/TempLoginController.java
0 → 100644
浏览文件 @
8b5c3556
package
com
.
mmc
.
iuav
.
user
.
controller
;
import
com.mmc.iuav.group.Insert
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.vo.AppUserSucVO
;
import
com.mmc.iuav.user.model.vo.WxLoginVO
;
import
com.mmc.iuav.user.service.AuthService
;
import
com.mmc.iuav.user.service.UserAccountService
;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author: zj
* @Date: 2023/5/29 14:37
*/
@Api
(
tags
=
"临时登录授权"
)
@RequestMapping
(
"/temp-auth/"
)
@RestController
public
class
TempLoginController
extends
BaseController
{
@Autowired
private
AuthService
authService
;
@ApiOperation
(
value
=
"小程序确认登录"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@GetMapping
(
"tempConfirmLogin"
)
public
ResultBody
tempConfirmLogin
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"临时登录code"
,
example
=
"kj6d9wcxyp92jajugdnc"
)
@RequestParam
String
randomLoginCode
)
{
return
authService
.
tempConfirmLogin
(
this
.
getUserLoginInfoFromRedis
(
request
),
randomLoginCode
);
}
@ApiOperation
(
value
=
"查询登录信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@GetMapping
(
"getLoginInfo"
)
public
ResultBody
getLoginInfo
(
@ApiParam
(
value
=
"临时登录code"
,
example
=
"kj6d9wcxyp92jajugdnc"
)
@RequestParam
String
randomLoginCode
){
return
authService
.
getLoginInfo
(
randomLoginCode
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/CooperationDao.java
浏览文件 @
8b5c3556
...
...
@@ -56,4 +56,11 @@ public interface CooperationDao {
* @param userTagDO
*/
void
updateUserTag
(
UserTagDO
userTagDO
);
/**
* 根据id查询标签信息
* @param id
* @return
*/
CooperationTagDO
getTagById
(
Integer
id
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/AuthService.java
浏览文件 @
8b5c3556
package
com
.
mmc
.
iuav
.
user
.
service
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.qo.LoginUserQO
;
import
com.mmc.iuav.user.model.vo.WxLoginVO
;
...
...
@@ -29,4 +30,19 @@ public interface AuthService {
* @return
*/
ResultBody
testAppletLogin
(
String
unionId
);
/**
* 小程序确认登录
* @param loginSuccessDTO
* @param randomLoginCode
* @return
*/
ResultBody
tempConfirmLogin
(
LoginSuccessDTO
loginSuccessDTO
,
String
randomLoginCode
);
/**
* 获取用登录信息
* @param randomLoginCode
* @return
*/
ResultBody
getLoginInfo
(
String
randomLoginCode
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/CooperationService.java
浏览文件 @
8b5c3556
...
...
@@ -28,4 +28,11 @@ public interface CooperationService {
* @return
*/
ResultBody
changeUserTag
(
Integer
userAccountId
,
Integer
cooperationTagId
);
/**
* 根据ID查询标签信息
* @param id
* @return
*/
ResultBody
getTagById
(
Integer
id
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/AuthServiceImpl.java
浏览文件 @
8b5c3556
...
...
@@ -5,10 +5,13 @@ import com.alibaba.fastjson2.JSONObject;
import
com.mmc.iuav.auth.JwtConstant
;
import
com.mmc.iuav.auth.JwtUtil
;
import
com.mmc.iuav.general.CodeUtil
;
import
com.mmc.iuav.http.BizException
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.user.auth.PwdUtil
;
import
com.mmc.iuav.user.constant.WxConstant
;
import
com.mmc.iuav.user.dao.CompanyAuthDao
;
import
com.mmc.iuav.user.entity.CompanyAuthDO
;
import
com.mmc.iuav.user.entity.UserAccountDO
;
import
com.mmc.iuav.user.enums.UserAccountStatus
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
...
...
@@ -47,6 +50,9 @@ public class AuthServiceImpl implements AuthService {
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
@Autowired
private
CompanyAuthDao
companyAuthDao
;
@Override
public
ResultBody
appletLogin
(
WxLoginVO
wxLoginVO
)
{
String
unionId
;
...
...
@@ -87,7 +93,8 @@ public class AuthServiceImpl implements AuthService {
}
//数据库查询用户信息
UserAccountVO
userAccountVO
=
userAccountService
.
getUserAccountInfoByUnionId
(
unionId
);
String
uid
=
userAccountVO
.
getUid
();
String
uid
;
Integer
companyAuthStatus
=
0
;
if
(
userAccountVO
==
null
)
{
UserAccountDO
userAccountDO
=
new
UserAccountDO
();
userAccountDO
.
setUnionId
(
unionId
);
...
...
@@ -99,6 +106,12 @@ public class AuthServiceImpl implements AuthService {
userAccountDO
.
setSource
(
wxLoginVO
.
getSource
());
userAccountService
.
insertUserAccount
(
userAccountDO
);
userAccountVO
=
userAccountDO
.
buildUserAccountVO
();
}
else
{
uid
=
userAccountVO
.
getUid
();
CompanyAuthDO
companyAuthDO
=
companyAuthDao
.
getCompanyAuth
(
userAccountVO
.
getId
());
if
(
companyAuthDO
!=
null
)
{
companyAuthStatus
=
companyAuthDO
.
getAuthStatus
();
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
JwtConstant
.
USER_ACCOUNT_ID
,
userAccountVO
.
getId
());
...
...
@@ -107,14 +120,14 @@ public class AuthServiceImpl implements AuthService {
String
token
=
JwtUtil
.
createJwt
(
map
);
LoginSuccessDTO
loginSuccessDTO
=
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
userAccountVO
.
getId
()).
accountNo
(
userAccountVO
.
getAccountNo
()).
uid
(
uid
)
.
userName
(
userAccountVO
.
getUserName
()).
nickName
(
userAccountVO
.
getNickName
()).
phoneNum
(
userAccountVO
.
getPhoneNum
()).
build
();
.
userName
(
userAccountVO
.
getUserName
()).
nickName
(
userAccountVO
.
getNickName
()).
phoneNum
(
userAccountVO
.
getPhoneNum
()).
portType
(
100
).
build
();
stringRedisTemplate
.
opsForValue
().
set
(
token
,
JSONObject
.
toJSONString
(
loginSuccessDTO
),
JwtConstant
.
EXPIRATION
,
TimeUnit
.
MILLISECONDS
);
return
ResultBody
.
success
(
AppUserSucVO
.
builder
().
token
(
token
).
uid
(
userAccountVO
.
getUid
()).
phoneNum
(
userAccountVO
.
getPhoneNum
())
.
nickName
(
userAccountVO
.
getNickName
()).
userAccountId
(
userAccountVO
.
getId
()).
sessionKey
(
sessionKey
).
build
());
.
nickName
(
userAccountVO
.
getNickName
()).
userAccountId
(
userAccountVO
.
getId
()).
sessionKey
(
sessionKey
).
portType
(
100
).
authStatus
(
companyAuthStatus
).
build
());
}
@Override
...
...
@@ -144,12 +157,12 @@ public class AuthServiceImpl implements AuthService {
map
.
put
(
JwtConstant
.
TOKEN_TYPE
,
JwtConstant
.
M_TOKEN
);
String
token
=
JwtUtil
.
createJwt
(
map
);
LoginSuccessDTO
loginSuccessDTO
=
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
user
.
getId
()).
accountNo
(
user
.
getAccountNo
()).
uid
(
user
.
getUid
())
.
userName
(
user
.
getUserName
()).
nickName
(
user
.
getNickName
()).
phoneNum
(
user
.
getPhoneNum
()).
build
();
.
userName
(
user
.
getUserName
()).
nickName
(
user
.
getNickName
()).
phoneNum
(
user
.
getPhoneNum
()).
portType
(
100
).
build
();
stringRedisTemplate
.
opsForValue
().
set
(
token
,
JSONObject
.
toJSONString
(
loginSuccessDTO
),
JwtConstant
.
EXPIRATION
,
TimeUnit
.
MILLISECONDS
);
return
ResultBody
.
success
(
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
user
.
getId
()).
accountNo
(
user
.
getAccountNo
()).
build
());
return
ResultBody
.
success
(
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
user
.
getId
()).
accountNo
(
user
.
getAccountNo
()).
portType
(
100
).
build
());
}
@Override
...
...
@@ -159,16 +172,39 @@ public class AuthServiceImpl implements AuthService {
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
JwtConstant
.
USER_ACCOUNT_ID
,
userAccountVO
.
getId
());
map
.
put
(
JwtConstant
.
TOKEN_TYPE
,
JwtConstant
.
IUAV_TOKEN
);
CompanyAuthDO
companyAuthDO
=
companyAuthDao
.
getCompanyAuth
(
userAccountVO
.
getId
());
Integer
companyAuthStatus
=
0
;
if
(
companyAuthDO
!=
null
)
{
companyAuthStatus
=
companyAuthDO
.
getAuthStatus
();
}
String
token
=
JwtUtil
.
createJwt
(
map
);
LoginSuccessDTO
loginSuccessDTO
=
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
userAccountVO
.
getId
()).
accountNo
(
userAccountVO
.
getAccountNo
()).
uid
(
userAccountVO
.
getUid
())
.
userName
(
userAccountVO
.
getUserName
()).
nickName
(
userAccountVO
.
getNickName
()).
phoneNum
(
userAccountVO
.
getPhoneNum
()).
build
();
.
userName
(
userAccountVO
.
getUserName
()).
nickName
(
userAccountVO
.
getNickName
()).
phoneNum
(
userAccountVO
.
getPhoneNum
()).
portType
(
100
).
build
();
stringRedisTemplate
.
opsForValue
().
set
(
token
,
JSONObject
.
toJSONString
(
loginSuccessDTO
),
JwtConstant
.
EXPIRATION
,
TimeUnit
.
MILLISECONDS
);
return
ResultBody
.
success
(
AppUserSucVO
.
builder
().
token
(
token
).
uid
(
userAccountVO
.
getUid
()).
phoneNum
(
userAccountVO
.
getPhoneNum
())
.
nickName
(
userAccountVO
.
getNickName
()).
userAccountId
(
userAccountVO
.
getId
()).
build
());
.
nickName
(
userAccountVO
.
getNickName
()).
userAccountId
(
userAccountVO
.
getId
()).
portType
(
100
).
authStatus
(
companyAuthStatus
).
build
());
}
return
ResultBody
.
error
(
ResultEnum
.
APPLET_LOGIN_ERROR
);
}
@Override
public
ResultBody
tempConfirmLogin
(
LoginSuccessDTO
loginSuccessDTO
,
String
randomLoginCode
)
{
stringRedisTemplate
.
opsForValue
().
set
(
randomLoginCode
,
JSONObject
.
toJSONString
(
loginSuccessDTO
),
JwtConstant
.
TEMP_EXPIRATION
,
TimeUnit
.
MILLISECONDS
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
getLoginInfo
(
String
randomLoginCode
)
{
String
json
=
stringRedisTemplate
.
opsForValue
().
get
(
randomLoginCode
);
if
(
StringUtils
.
isBlank
(
json
)){
return
ResultBody
.
error
(
ResultEnum
.
APPLET_LOGIN_ERROR
);
}
LoginSuccessDTO
loginSuccessDTO
=
JSONObject
.
parseObject
(
json
,
LoginSuccessDTO
.
class
);
return
ResultBody
.
success
(
loginSuccessDTO
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/CooperationServiceImpl.java
浏览文件 @
8b5c3556
...
...
@@ -77,4 +77,13 @@ public class CooperationServiceImpl implements CooperationService {
cooperationDao
.
updateUserTag
(
userTagDO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
getTagById
(
Integer
id
)
{
CooperationTagDO
cooperationTagDO
=
cooperationDao
.
getTagById
(
id
);
if
(
cooperationTagDO
==
null
){
return
ResultBody
.
success
();
}
return
ResultBody
.
success
(
cooperationTagDO
.
buildCooperationTagVO
());
}
}
csm-service/cms-service-user/src/main/resources/application-dev.yml
浏览文件 @
8b5c3556
...
...
@@ -3,7 +3,7 @@ spring:
#Database
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://mysql.default:3306/iuav_cms?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
url
:
jdbc:mysql://mysql.default:3306/iuav_cms
_dev
?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
username
:
tmj
password
:
MMC@2022&MYSQL
# Druid数据源配置
...
...
csm-service/cms-service-user/src/main/resources/application-local.yml
浏览文件 @
8b5c3556
...
...
@@ -3,7 +3,7 @@ spring:
#Database
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://rm-wz9dd796t4j1giz6t2o.mysql.rds.aliyuncs.com:3306/iuav_cms?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
url
:
jdbc:mysql://rm-wz9dd796t4j1giz6t2o.mysql.rds.aliyuncs.com:3306/iuav_cms
_dev
?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
username
:
tmj
password
:
MMC@2022&MYSQL
# Druid数据源配置
...
...
csm-service/cms-service-user/src/main/resources/mapper/CooperationDao.xml
浏览文件 @
8b5c3556
...
...
@@ -44,7 +44,7 @@
</update>
<select
id=
"listTags"
resultType=
"com.mmc.iuav.user.entity.CooperationTagDO"
>
select id, tag_name, tag_img, tag_description, create_time from cooperation_tag
select id, tag_name, tag_img, tag_description, create_time from cooperation_tag
where is_deleted = 0
</select>
<select
id=
"getUserApplyTag"
resultType=
"com.mmc.iuav.user.entity.UserApplyTagDO"
>
...
...
@@ -58,4 +58,8 @@
from user_tag
where user_account_id = #{userAccountId} and is_deleted = 0
</select>
<select
id=
"getTagById"
resultType=
"com.mmc.iuav.user.entity.CooperationTagDO"
>
select id, tag_name, tag_img, tag_description, create_time from cooperation_tag where id = #{id} and is_deleted = 0
</select>
</mapper>
\ No newline at end of file
csm-service/cms-service-user/src/main/resources/not-check.yml
浏览文件 @
8b5c3556
...
...
@@ -6,7 +6,11 @@ data-filter:
-
/userapp/doc.html
-
/userapp/swagger-resources/**
-
/userapp/webjars/**
-
/userapp/auth/testAppletLogin
-
/userapp/auth/backEndLogin
-
/userapp/auth/testAppletLogin
-
/userapp/auth/appletLogin
-
/userapp/cooperation/listTag
-
/userapp/cooperation/getTagById
-
/userapp/temp-auth/getLoginInfo
-
/userapp/wx/getAppletQRCode
-
/userapp/wx/wxSendMessage
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
8b5c3556
...
...
@@ -17,4 +17,4 @@ patches:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag
:
13be77b9442adcdd8179b15401887443f494edca
newTag
:
71b20b73cb9c383853e6bede37f83e970e4a0adc
kustomization/overlays/prod/kustomization.yaml
浏览文件 @
8b5c3556
...
...
@@ -9,6 +9,7 @@ commonLabels:
commonAnnotations
:
note
:
This is prod!
patches
:
-
path
:
increase_replicas.yaml
-
path
:
configMap.yaml
-
path
:
service-patch.yaml
target
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论