package com.sf.XWFS.aop;
import java.lang.annotation.*;
/**
* @author cc
* Desc 校验除超管外的角色,都进行拦截
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface CheckUnSysAdmin {
}
package com.sf.XWFS.aop;
import com.sf.XWFS.constant.RoleConst;
import com.sf.XWFS.service.OrderService;
import com.sf.erui.common.response.ResponseHelper;
import com.sf.erui.context.UserContext;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Aspect
@Component
@Slf4j
public class CommonAspect {
@Resource
private OrderService orderService;
@Pointcut("execution(* com.sf.XWFS..*(..)) && @annotation(com.sf.XWFS.aop.CheckUnSysAdmin)")
public void checkUnSysAdmin() {
}
@Around("checkUnSysAdmin()")
public Object checkUnSysAdmin(ProceedingJoinPoint pjp) throws Throwable {
try {
String currentUserName = UserContext.getCurrentUserName();
//越权校验
String roleId = orderService.getRoleId(currentUserName);
if (!RoleConst.SYSADMIN_ROLE_ID.equals(roleId)) {
return ResponseHelper.buildFail("权限不足,请联系管理员");
}
} catch (Throwable throwable) {
throw new SecurityException("用户无权访问!", throwable);
}
return pjp.proceed();
}
}
package com.sf.XWFS.constant;
/**
* @author cc
* 角色常量
*/
public class RoleConst {
/**
* 系统管理员角色ID_106
*/
public static final String SYSADMIN_ROLE_ID = "102";
/**
* 大区管理员角色ID_103
*/
public static final String LRADMIN_ROLE_ID = "103";
/**
* 地区管理员角色ID_104
*/
public static final String RQADMIN_ROLE_ID = "104";
/**
* 普通用户角色ID_105
*/
public static final String PT_ROLE_ID = "105";
/**
* 普通管理员角色ID_106
*/
public static final String PTGLY_ROLE_ID = "106";
}
@CheckUnSysAdmin
@ApiOperation(value = "通过主键查询一条数据(订单脱敏)", notes = "查-单查")
@RequestMapping("getOrderById")
@ResponseBody
public Response getOrderById(@RequestBody OrderDO record) {
logger.info("收件人脱敏接口");
String orderid = record.getOrderid();
Assert.notNull(orderid, "请选择一条数据!");
OrderDO orderDO = orderService.getOrderByOrderId(orderid);
return ResponseHelper.buildOk(orderDO);
}
文章浏览阅读120次。1.薪资丰厚: 基本薪资+绩效+项目奖金+年终奖2.福利: 和正式员工福利基本看齐,共享工位,免费夜宵,班车,一流办公环境,月末周六双倍工资3.技术栈:C/C+当用例很多的时候,每次。不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦。不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦虑不焦。
文章浏览阅读871次,点赞11次,收藏3次。*单片机设计介绍, 基于51单片机冰箱温度控制器设计。_基于51单片机的智能冰箱控制系统设计
文章浏览阅读4.8k次。一、sftp服务器进入root模式(下面的操作默认都是在root用户下)#安装openssh-serverapt-get install -y openssh-server创建sftp的组和用户#创建sftp-users组groupadd sftp-users#创建sftp用户目录alicemkdir /home/alice#创建sftp用户alice,并且绑定其主目..._ubuntu sftp服务器查看用户和密码
文章浏览阅读5.9k次,点赞9次,收藏16次。解决了在simulink中使用s-function遇到的报错:State derivatives returned by S-function 'demo' in 'test/S-Function' during flag=1 call must be a real vector of length 2 _state derivatives returned by s-function 'pmsm' in 'ipmsm/ipmsm/s-function1
文章浏览阅读3.1k次。1. 打开配置文件Mac 如下图2. 在文件内部添加这段文字,就可以了:"update_check":false _mac sublime text 取消更新提示
文章浏览阅读548次,点赞10次,收藏6次。Linux系统下DNS配置指南_linux 服务器修改网络dns
文章浏览阅读2w次,点赞58次,收藏268次。学习通不想好好上课系列_学习通脚本
文章浏览阅读1.6k次。将Total Commander设置为“默认”文件管理器?法一:开始,运行,输入regedit ,回车: 定位到HKEY_LOCAL_MACHINE_total commander默认文件管理器
文章浏览阅读7.7k次。反序列化无法找到程序集提示找不到程序集. 原因是序列化时把序列化类的命名空间等信息保存了,但应用程序和类库的命名空间可能是不一样的,所以提示找不到程序集. 解决方法如下: 方法1.将dll加入强名称,注册到全局程序集缓存中 方法2.在反序列化使用的IFormatter 对象加入Binder 属性,使其获取要反序列化的对象所在的程序集_未能找到程序集“g:\c#%5cc#%20%e4%b8%8a%e4%bd%8d%e6%9c%ba%5c%e7%a9%ba%e5%8e%8
文章浏览阅读234次。Jet-Lube EZY-Turn Kopr-Kote Deacon Moly-Lith 12|34 21 (Oilfield) 21 (Water Well) 21 Arctic (Oilfield) 21 Arctic (Water Well) 550 Extreme 550 Extreme All Weather 713-670-5700 769 Lubricant 930 Whitmore Drive Alco-EP Alco-EP ECF Alco-EP-73 Plus AP-1 AP-1W _dpezy
文章浏览阅读511次。本文从本人简书博客同步过来在上一篇中我们简要地介绍了 mpi4py 中的单边通信概念,下面我们将介绍单边通信的相关操作。创建/释放窗口对象注意:在使用单边通信操作之前,所有进程都须通过共同参与的创建窗口操作公开声明自己可供访问的内存空间。创建和释放窗口对象的方法(MPI.Win 类方法)接口如下:Create(type cls, memory, int disp_unit=..._win.fence() win.free()
文章浏览阅读551次,点赞23次,收藏7次。mit6.824的lab1,实现MapReduce_mitmapreduce实现csdn