去除权限

This commit is contained in:
liuchengqian 2022-06-21 16:52:18 +08:00
parent e258f92e27
commit 5550177277
4 changed files with 16 additions and 33 deletions

View File

@ -1,8 +1,6 @@
package com.xkrs.controller;
import com.xkrs.service.FireAndRangerService;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -20,40 +18,40 @@ public class FireAndRangerController {
/**
* 将火点分配给某个人
*
* @param map
* @param token
* @return
*/
@PreAuthorize("hasAnyAuthority('auth_general_user')")
@PostMapping("/addFireAndRanger")
public String addFireAndRanger(@RequestBody Map map, @RequestHeader(value="Authorization") String token) throws UnsupportedEncodingException {
public String addFireAndRanger(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) throws UnsupportedEncodingException {
String rangerName = (String) map.get("rangerName");
String fireCode = (String) map.get("fireCode");
String handler = (String) map.get("handler");
String verifier = (String) map.get("verifier");
return fireAndRangerService.addFireAndRanger(rangerName,fireCode,handler,verifier,token);
return fireAndRangerService.addFireAndRanger(rangerName, fireCode, handler, verifier, token);
}
/**
* 护林员查看自己的火点任务
*
* @param token
* @return
*/
@PreAuthorize("hasAnyAuthority('auth_rangers')")
@GetMapping("/selectFireInformation")
public String selectFireInformation(@RequestHeader(value="Authorization") String token){
public String selectFireInformation(@RequestHeader(value = "Authorization") String token) {
return fireAndRangerService.selectFireInformation(token);
}
/**
* 根据火点编码查询核查信息
*
* @param map
* @return
*/
@PreAuthorize("hasAnyAuthority('auth_general_user')")
@PostMapping("/findFireAndRanger")
public String findFireAndRangerByFireCode(@RequestBody Map map, @RequestHeader(value="Authorization") String token) throws Exception {
public String findFireAndRangerByFireCode(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) throws Exception {
String fireCode = (String) map.get("fireCode");
return fireAndRangerService.findFireAndRangerByFireCode(fireCode,token);
return fireAndRangerService.findFireAndRangerByFireCode(fireCode, token);
}
}

View File

@ -19,7 +19,6 @@ import org.apache.hc.core5.util.TextUtils;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -184,7 +183,6 @@ public class FirePointController {
* @return
*/
@GetMapping("/selectUserName")
@PreAuthorize("hasAnyAuthority('auth_general_user')")
public String selectUserName(@RequestHeader(value = "Authorization") String token) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -204,7 +202,6 @@ public class FirePointController {
* @return
*/
@GetMapping("/selectTodayFirePoint")
@PreAuthorize("hasAnyAuthority('auth_general_user')")
public String selectTodayFirePoint(@RequestParam("countyCode") String countyCode, @RequestHeader(value = "Authorization") String token) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -219,7 +216,6 @@ public class FirePointController {
* 动态多条件查询火点信息
*/
@PostMapping("/selectFirePoint")
@PreAuthorize("hasAnyAuthority('auth_general_user')")
public String selectFirePoint(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -304,7 +300,6 @@ public class FirePointController {
* 查询近一个月的火点信息
*/
@GetMapping("/selectFirePointByMonth")
@PreAuthorize("hasAnyAuthority('auth_general_user')")
public String selectFirePointByMonth(@RequestHeader(value = "Authorization") String token) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();

View File

@ -1,7 +1,6 @@
package com.xkrs.controller;
import com.xkrs.service.ForestRangerService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -18,39 +17,39 @@ public class ForestRangerController {
/**
* 根据区县编码查询相关护林员的信息
*
* @param rangerCountyCode
* @return
*/
@GetMapping("/findByRangerCountyCode")
@PreAuthorize("hasAnyAuthority('auth_general_user')")
public String findByRangerCountyCode(@RequestParam("rangerCountyCode") String rangerCountyCode, @RequestHeader(value="Authorization") String token){
public String findByRangerCountyCode(@RequestParam("rangerCountyCode") String rangerCountyCode, @RequestHeader(value = "Authorization") String token) {
return forestRangerService.findByRangerCountyCode(rangerCountyCode);
}
/**
* 根据区县编码查询该区县所有护林员的信息
*
* @param countyCode
* @param token
* @return
*/
@GetMapping("/findAllByRangerCountyCode")
@PreAuthorize("hasAnyAuthority('auth_general_user')")
public String findAllByRangerCountyCode(@RequestParam("countyCode") String countyCode, @RequestHeader(value="Authorization") String token){
return forestRangerService.findAllByRangerCountyCode(countyCode,token);
public String findAllByRangerCountyCode(@RequestParam("countyCode") String countyCode, @RequestHeader(value = "Authorization") String token) {
return forestRangerService.findAllByRangerCountyCode(countyCode, token);
}
/**
* 根据手机号修改护林员的位置
*
* @param map
* @return
*/
@PostMapping("/updateLatAndLonByPhone")
@PreAuthorize("hasAnyAuthority('auth_general_user')")
public String updateLatAndLonByPhone(@RequestBody Map map, @RequestHeader(value="Authorization") String token){
public String updateLatAndLonByPhone(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
String rangerLatitude = (String) map.get("rangerLatitude");
String rangerLongitude = (String) map.get("rangerLongitude");
String rangerPhone = (String) map.get("rangerPhone");
return forestRangerService.updateLatAndLonByPhone(rangerLatitude,rangerLongitude,rangerPhone);
return forestRangerService.updateLatAndLonByPhone(rangerLatitude, rangerLongitude, rangerPhone);
}
}

View File

@ -17,7 +17,6 @@ import com.xkrs.service.RedisService;
import com.xkrs.service.SysUserService;
import com.xkrs.utils.RandomUtil;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
@ -179,7 +178,6 @@ public class SysUserController {
* @return
*/
@RequestMapping(value = "/general/delete", method = RequestMethod.DELETE)
@PreAuthorize("hasAnyAuthority('auth_system_manager','auth_general_user')")
public String deleteCustomUser(@RequestParam(value = "userId", required = false) int id) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -193,7 +191,6 @@ public class SysUserController {
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
@PreAuthorize("hasAnyAuthority('auth_system_manager','auth_administor')")
public String updateUser(@Validated({SysUserQoUpdate.class}) @RequestBody SysUserQo userQo, BindingResult bindingResult) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -233,7 +230,6 @@ public class SysUserController {
* @return
*/
@GetMapping("/selectAllUser")
@PreAuthorize("hasAnyAuthority('auth_administor')")
public String selectAllUser(@RequestHeader(value = "Authorization") String token) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -258,7 +254,6 @@ public class SysUserController {
* @return
*/
@PostMapping("/operateActiveFlag")
@PreAuthorize("hasAnyAuthority('auth_administor')")
public String operateActiveFlag(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
Integer userId = (Integer) map.get("userId");
String keepType = (String) map.get("keepType");
@ -288,7 +283,6 @@ public class SysUserController {
* @return
*/
@PostMapping("/updatePassword")
@PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')")
public String updatePassword(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -312,7 +306,6 @@ public class SysUserController {
* @return
*/
@PostMapping("/adminUpdatePassword")
@PreAuthorize("hasAnyAuthority('auth_administor')")
public String adminUpdatePassword(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
@ -420,7 +413,6 @@ public class SysUserController {
* @return
*/
@PostMapping("/updateExpireDate")
@PreAuthorize("hasAnyAuthority('auth_administor')")
public String updateExpireDate(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
Integer userId = (Integer) map.get("userId");
Integer timeNum = (Integer) map.get("timeNum");
@ -444,7 +436,6 @@ public class SysUserController {
* @return
*/
@PostMapping("/updateOverTime")
@PreAuthorize("hasAnyAuthority('auth_administor')")
public String updateOverTime(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
Integer userId = (Integer) map.get("userId");
String overTime = (String) map.get("overTime");