All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yuweix.kuafu.permission.common.PermissionUtil Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.yuweix.kuafu.permission.common;


import com.yuweix.kuafu.core.SpringContext;
import com.yuweix.kuafu.permission.dto.AdminDto;

import java.lang.reflect.Method;


/**
 * @author yuwei
 */
public class PermissionUtil {
	public static AdminDto getLoginAccount() {
		Properties properties = SpringContext.getBean(Properties.class);
		String actionClass = properties.getActionClass();
		String actionMethod = properties.getActionMethod();

		try {
			Class clz = Class.forName(actionClass);
			Method method = clz.getMethod(actionMethod);
			return (AdminDto) method.invoke(null);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy