getUserRoles() {
- return StpUtil.getRoleList();
- }
-
- public static boolean isAdmin() {
- return AuthUtil.getUserRoles().contains(Constants.ROLE_ADMIN);
- }
-
- public static boolean isClientUser() {
- return AuthUtil.getUserRoles().contains(Constants.ROLE_CLIENT);
- }
-
- public static boolean hasWriteRole() {
- return AuthUtil.getUserRoles().contains(Constants.ROLE_WRITE);
- }
-
- public static String enCryptPwd(String pwd) throws Exception {
- return CodecUtil.aesEncrypt(CodecUtil.md5Str(pwd) + ":"
- + RandomUtils.nextInt(1000, 9999), Constants.ACCOUNT_SECRET);
- }
-
- public static boolean checkPwd(String pwd, String secret) throws Exception {
- String code = CodecUtil.aesDecrypt(secret, Constants.ACCOUNT_SECRET);
- String[] arr = code.split(":");
- return arr.length > 0 && CodecUtil.md5Str(pwd).equals(arr[0]);
- }
-}
diff --git a/iot-auth-server/src/main/java/cc/iotkit/utils/SoMap.java b/iot-auth-server/src/main/java/cc/iotkit/utils/SoMap.java
deleted file mode 100755
index e37d480c..00000000
--- a/iot-auth-server/src/main/java/cc/iotkit/utils/SoMap.java
+++ /dev/null
@@ -1,837 +0,0 @@
-/*
- * +----------------------------------------------------------------------
- * | Copyright (c) 奇特物联 2021-2022 All rights reserved.
- * +----------------------------------------------------------------------
- * | Licensed 未经许可不能去掉「奇特物联」相关版权
- * +----------------------------------------------------------------------
- * | Author: xw2sy@163.com
- * +----------------------------------------------------------------------
- */
-package cc.iotkit.utils;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import javax.servlet.http.HttpServletRequest;
-
-import cc.iotkit.common.utils.JsonUtil;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-/**
- * Map< String, Object> 是最常用的一种Map类型,但是它写着麻烦
- * 所以特封装此类,继承Map,进行一些扩展,可以让Map更灵活使用
- *
最新:2020-12-10 新增部分构造方法
- *
- * @author kong
- */
-public class SoMap extends LinkedHashMap {
-
- private static final long serialVersionUID = 1L;
-
- public SoMap() {
- }
-
- /**
- * 以下元素会在isNull函数中被判定为Null,
- */
- public static final Object[] NULL_ELEMENT_ARRAY = {null, ""};
- public static final List