From 8e9a7c81a81ab01a13024396e0297e2c11c38116 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 25 八月 2023 09:12:13 +0800
Subject: [PATCH] 修复bug
---
server/src/main/java/doumeemes/service/system/impl/WxLoginServiceImpl.java | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/server/src/main/java/doumeemes/service/system/impl/WxLoginServiceImpl.java b/server/src/main/java/doumeemes/service/system/impl/WxLoginServiceImpl.java
index 83c9733..d406e58 100644
--- a/server/src/main/java/doumeemes/service/system/impl/WxLoginServiceImpl.java
+++ b/server/src/main/java/doumeemes/service/system/impl/WxLoginServiceImpl.java
@@ -11,6 +11,7 @@
import doumeemes.core.utils.Constants;
import doumeemes.core.utils.HttpsUtil;
import doumeemes.core.utils.Utils;
+import doumeemes.dao.business.model.Company;
import doumeemes.dao.business.model.CompanyUser;
import doumeemes.dao.business.model.Department;
import doumeemes.dao.ext.CompanyExtMapper;
@@ -18,6 +19,7 @@
import doumeemes.dao.ext.DepartmentExtMapper;
import doumeemes.dao.ext.dto.QueryCompanyUserExtDTO;
import doumeemes.dao.ext.dto.WxLoginDTO;
+import doumeemes.dao.ext.dto.WxLoginOutDTO;
import doumeemes.dao.ext.vo.CompanyUserExtListVO;
import doumeemes.dao.ext.vo.WxLoginVO;
import doumeemes.dao.system.SystemUserMapper;
@@ -69,6 +71,8 @@
@Autowired
private SystemLoginLogService systemLoginLogService;
+ @Autowired
+ private CompanyExtMapper companyExtMapper;
/**
@@ -107,6 +111,11 @@
if(Objects.isNull(department)){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌缁戝畾閮ㄩ棬淇℃伅");
}
+ Company company = companyExtMapper.selectById(department.getCompanyId());
+ if(Objects.isNull(company)||company.getStatus().equals(Constants.ZERO)){
+ wxLoginVO.setLoginStatus(Constants.ONE);
+ return wxLoginVO;
+ }
SystemUser systemUser = systemUserMapper.selectById(companyUser.getUserId());
//鏌ヨ鐢ㄦ埛鏁版嵁
LoginDTO dto = new LoginDTO();
@@ -136,6 +145,9 @@
String session = (String)subject.getSession().getId();
wxLoginVO.setLoginStatus(Constants.ZERO);
wxLoginVO.setSession(session);
+ return wxLoginVO;
+ }catch (BusinessException e) {
+ wxLoginVO.setLoginStatus(Constants.ONE);
return wxLoginVO;
}catch (AuthenticationException e) {
BusinessException ee = null;
@@ -212,4 +224,14 @@
}
}
+ @Override
+ public void wxLoginOut(WxLoginOutDTO wxLoginOutDTO) {
+ if(!Objects.isNull(wxLoginOutDTO)&&!Objects.isNull(wxLoginOutDTO.getCompanyUserId())){
+ companyUserExtMapper.update(null,new UpdateWrapper<CompanyUser>()
+ .set("UNIONID","").set("OPENID","")
+ .eq("id",wxLoginOutDTO.getCompanyUserId())
+ );
+ }
+ }
+
}
--
Gitblit v1.9.3