用户工具类

2.1.0开始支持

需要和wueasy-gateway结合使用,在bus接口中获取用户的信息。

使用场景:

  • 获取用户访问的ip地址
  • 获取用户登录后的userId
  • 获取用户的昵称
  • 获取用户数据权限
  • 获取是否管理员

接口说明

接口类com.wueasy.base.util.UserHelper

/**
 * 获取用户id
 * @author: fallsea
 * @return
 */
public static String getUserId();

/**
* 获取用户id
* @author: fallsea
* @return
*/
public static Long getUserIdLong();

/**
 * 获取用户姓名
 * @author: fallsea
 * @return
 */
public static String getUserName();

/**
 * 获取用户登录账号
 * @author: fallsea
 * @return
 */
public static String getLoginNo();

/**
 * 获取用户访问ip
 * @author: fallsea
 * @return
 */
public static String getIp();

/**
* 获取请求的唯一标识
* @author: fallsea
* @return
*/
public static String getRequestId();

/**
* 获取数据权限字符串
* @author: fallsea
* @return
*/
public static String getAuthDataStr();

/**
* 获取数据权限集合字符串
* @author: fallsea
* @return
*/
public static List<String> getAuthDataList();

/**
* 获取数据权限集合字符串
* @author: fallsea
* @return
*/
public static Set<String> getAuthDataSet();

/**
* 获取数据权限集合
* @author: fallsea
* @return
*/
public static List<Long> getAuthDataLongList();

/**
* 获取数据权限集合
* @author: fallsea
* @return
*/
public static Set<Long> getAuthDataLongSet();

/**
* 获取是否管理员
* @author: fallsea
* @return true 是
*/
public static boolean getIsSystem();

/**
* 获取自定义参数对象
* @author: fallsea
* @return
*/
public static DataMap getCustomParameterMap();

/**
* 获取语言代码
* @author: fallsea
* @return
*/
public static String getLanguage();

/**
* 获取系统参数
* @author: fallsea
* @return
*/
public static SystemParameterEntity getSystemParameter();
Copyright © wueasy.com 2017-2022 all right reserved,powered by Gitbook未经允许,禁止以任何形式传播 修订时间: 2021-12-01

results matching ""

    No results matching ""