提交 4b268243 作者: xiaowang

Merge remote-tracking branch 'origin/master'

package com.mmc.iuav.user.auth;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.util.PathUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
......@@ -18,6 +20,7 @@ import java.io.PrintWriter;
* @author: zj
* @Date: 2023/5/28 10:46
*/
@Slf4j
@Component
public class TokenCheckHandleInterceptor implements HandlerInterceptor {
......@@ -34,19 +37,38 @@ public class TokenCheckHandleInterceptor implements HandlerInterceptor {
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;
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;
}
//
// String serverName = request.getServerName();
// String remoteHost = request.getRemoteHost();
// log.info("hostName: {}", hostName);
// log.info("serverName: {}", serverName);
// log.info("remoteHost: {}", remoteHost);
// log.info("forwardedFor: {}", forwardedFor);
// log.info("forwardedHost: {}", forwardedHost);
// if (hostName.equals("iuav.mmcuav.cn") || hostName.equals("test.iuav.mmcuav.cn") || hostName.equals("www.iuav.shop") || hostName.equals("test.iuav.shop")){
// 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;
}
......
......@@ -11,6 +11,7 @@ import com.mmc.iuav.user.util.QccEntAuthUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author: zj
......@@ -27,6 +28,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
private CompanyAuthDao companyAuthDao;
@Override
@Transactional
public ResultBody add(CompanyAuthVO companyAuthVO) {
log.info("用户:"+companyAuthVO.getUserAccountId()+" 企业认证:{}", JSONObject.toJSONString(companyAuthVO));
CompanyAuthDO companyAuthDO = companyAuthDao.getCompanyAuth(companyAuthVO.getUserAccountId());
......@@ -34,9 +36,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
return ResultBody.success("已通过");
}
ResultBody companyCheckRes = this.companyCheck(companyAuthVO);
System.out.println(companyCheckRes);
if (!companyCheckRes.getCode().equals("200")){
return companyCheckRes;
}
companyAuthDO = new CompanyAuthDO(companyAuthVO);
......
......@@ -88,6 +88,9 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
public UserAccountSimpleDTO getUserSimpleInfo(Integer userAccountId) {
UserAccountDO userAccountDO = userServiceDao.getUserAccountById(userAccountId);
if (userAccountDO == null){
return null;
}
UserAccountSimpleDTO userAccountSimpleDTO = userAccountDO.buildUserAccountSimpleDTO();
CompanyAuthVO companyAuthVO = companyAuthService.getCompanyAuthByUId(userAccountId);
if (companyAuthVO != null) {
......
......@@ -50,7 +50,7 @@ wx:
id: wx18b7883acd204278
secret: 28afe74ba373830237a8133a7431ee82
miniprogram-state: formal
env-version: formal
env-version: release
token-path: /userservlet/wechat/getAppletUserAccessToken
port: user
......
......@@ -26,6 +26,6 @@
<select id="getCompanyAuth" resultType="com.mmc.iuav.user.entity.CompanyAuthDO">
select id,user_account_id,company_name,credit_code,license_img,auth_status
from company_auth where user_account_id = #{userAccountId}
from company_auth where user_account_id = #{userAccountId} and is_deleted = 0
</select>
</mapper>
\ No newline at end of file
......@@ -14,3 +14,4 @@ data-filter:
- /userapp/temp-auth/getLoginInfo
- /userapp/wx/getAppletQRCode
- /userapp/wx/wxSendMessage
- /userapp/user-account/feignListUserAccountIds
......@@ -4,6 +4,8 @@ metadata:
name: cms-deployment
namespace: default
spec:
minReadySeconds: 240
revisionHistoryLimit: 2
replicas: 1
selector:
matchLabels:
......@@ -18,7 +20,7 @@ spec:
image: REGISTRY/NAMESPACE/IMAGE:TAG
resources:
limits:
memory: 4096Mi
memory: 1024Mi
cpu: 100m
ports:
- containerPort: 35150
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: cms-deployment
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
\ No newline at end of file
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../../base
#namePrefix: dev-
namespace: dev
commonLabels:
......@@ -9,12 +9,13 @@ commonLabels:
commonAnnotations:
note: This is dev!
patches:
- path: ./configMap.yaml
- path: ./service-patch.yaml
target:
kind: Service
name: cms-svc
- path: ./increase_replicas.yaml
- path: ./configMap.yaml
- path: ./service-patch.yaml
target:
kind: Service
name: cms-svc
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 654ef1259bcb25094f1e2e61a32369080022dbd0
newTag: b90d96ef7a2c68fe49e89e0462cba4d37baf7716
......@@ -3,7 +3,12 @@ kind: Deployment
metadata:
name: cms-deployment
spec:
replicas: 1
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
# template:
# spec:
# nodeName: master
......
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/cms
newTag: f3feaca2b4ecd07343122ef2a7b3bfd8e40a9b19
newTag: a66259b9b10f0a79a0dbee5a83e733d47cb89011
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论