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