use of com.qlangtech.tis.manage.common.IUser in project tis by qlangtech.
the class AuthorityCheckAdvice method doIntercept.
@Override
protected String doIntercept(ActionInvocation invocation) throws Exception {
BasicModule action = (BasicModule) invocation.getAction();
ActionProxy proxy = invocation.getProxy();
String namespace = proxy.getNamespace();
final Method method = action.getExecuteMethod();
Func func = method.getAnnotation(Func.class);
final Rundata rundata = BasicModule.getRundataInstance();
// }
final IUser user = UserUtils.getUser(ServletActionContext.getRequest(), daoContextGetter.get());
if (!user.hasLogin() && !(action instanceof LoginAction || StringUtils.startsWith(namespace, "/config"))) {
rundata.redirectTo("/runtime/login.htm");
return Action.NONE;
}
action.setAuthtoken(user);
if (func == null) {
log.debug("target:" + proxy.getActionName() + ",method:" + method.getName() + " has not set FUNC");
return invocation.invoke();
}
// }
return invocation.invoke();
}
Aggregations