Commit a2c980d3 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/first' into first

parents 96ef2956 65bf0df7
......@@ -55,6 +55,7 @@
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
<profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15506</profiles.server.debug>
<profiles.filepath>/mortals/app/data/one</profiles.filepath>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
......
......@@ -21,6 +21,6 @@ fi
echo "stoping application $PROJECT_NAME......"
kill -15 ${pid}
kill -9 ${pid}
echo "Send shutdown request to Server $PROJECT_NAME OK"
......@@ -34,25 +34,26 @@ public class DataPermissionAspect {
public static final String DATA_PERMISSION_SEARCH_SQL = "DATA_PERMISSION_SEARCH_SQL";
@Pointcut("@annotation(com.mortals.xhx.annotation.DataPermission)")
@Pointcut("execution(public * com.mortals..*Controller.*(..))")
public void pointCut() {
}
@Around("pointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
MethodSignature signature = (MethodSignature) point.getSignature();
Method method = signature.getMethod();
DataPermission permissionData = method.getAnnotation(DataPermission.class);
if(ObjectUtils.isEmpty(permissionData)) return point.proceed();
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
String componentRoute = request.getServletPath();
IUser loginUser = authTokenService.getLoginUser(request);
//如果是admin 不做数据权限校验
if(loginUser.isAdmin()) return point.proceed();
MethodSignature signature = (MethodSignature) point.getSignature();
Method method = signature.getMethod();
DataPermission permissionData = method.getAnnotation(DataPermission.class);
//获取授权方式
String permissionType = permissionData.permissionType();
//获取组件路由 通过controller 获取
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment