给首页的金额进行权限控制

This commit is contained in:
季圣华
2022-10-23 18:30:32 +08:00
parent fa300cc964
commit b5a2fab979
3 changed files with 19 additions and 19 deletions

View File

@@ -224,18 +224,18 @@ public class RoleService {
* @param type
* @return
*/
public Object parsePriceByLimit(BigDecimal price, String type, HttpServletRequest request) throws Exception {
public Object parsePriceByLimit(BigDecimal price, String type, String emptyInfo, HttpServletRequest request) throws Exception {
Long userId = userService.getUserId(request);
String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit();
if(StringUtil.isNotEmpty(priceLimit)) {
if("buy".equals(type) && priceLimit.contains("1")) {
return "***";
return emptyInfo;
}
if("retail".equals(type) && priceLimit.contains("2")) {
return "***";
return emptyInfo;
}
if("sale".equals(type) && priceLimit.contains("3")) {
return "***";
return emptyInfo;
}
}
return price;