提交 4b268243 作者: xiaowang

Merge remote-tracking branch 'origin/master'

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