控制平台导入权限问题解决

This commit is contained in:
liyj 2025-12-31 20:45:15 +08:00
parent 599a64a9f6
commit 1c11e6d23e
2 changed files with 3 additions and 4 deletions

View File

@ -27,4 +27,6 @@ public interface ShopSyncImportService{
// 导入商品Excel数据
void importShopsData(MultipartFile file,String storeId);
boolean checkIsPlate();
}

View File

@ -165,9 +165,6 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService {
@Override
@Async
public void importShopsData(MultipartFile file,String storeId) {
if(!checkIsPlate()){
throw new ApiException("用户无权限");
}
String fileName = storeUploadedFile(file);
readAndImportShopsExcelData(fileName,storeId);
}
@ -260,7 +257,7 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService {
* 判断是否平台
* @return
*/
private boolean checkIsPlate(){
public boolean checkIsPlate(){
UserDto userDto= ContextUtil.getCurrentUser();
assert userDto != null;
return 9 == userDto.getRole_id();