根据企业id查询企业信息时——用户未登录,报错问题
This commit is contained in:
@@ -71,12 +71,19 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
userId = loginUser.getUserId();
|
||||
}catch (Exception ignored){
|
||||
LoginSiteUser siteUser = SiteSecurityUtils.getLoginSiteUser();
|
||||
userId = siteUser.getUserId();
|
||||
try {
|
||||
LoginSiteUser siteUser = SiteSecurityUtils.getLoginSiteUser();
|
||||
userId = siteUser.getUserId();
|
||||
} catch (Exception ignored2) {
|
||||
}
|
||||
}
|
||||
//收藏
|
||||
Long l = companyCollectionMapper.selectCount(Wrappers.<CompanyCollection>lambdaQuery().eq(CompanyCollection::getCompanyId, companyId).eq(CompanyCollection::getUserId, userId));
|
||||
company.setIsCollection(l>0?1:0);
|
||||
if (userId == null) {
|
||||
company.setIsCollection(0);
|
||||
} else {
|
||||
Long l = companyCollectionMapper.selectCount(Wrappers.<CompanyCollection>lambdaQuery().eq(CompanyCollection::getCompanyId, companyId).eq(CompanyCollection::getUserId, userId));
|
||||
company.setIsCollection(l>0?1:0);
|
||||
}
|
||||
//联系人
|
||||
CompanyContact contact=new CompanyContact();
|
||||
contact.setCompanyId(company.getCompanyId());
|
||||
|
||||
Reference in New Issue
Block a user