xin
2025-07-10 09ac251a089f5bb79d59a12bf2f932dda12c4ca2
oying-common/src/main/java/com/oying/utils/SecurityUtils.java
@@ -75,6 +75,18 @@
    }
    /**
     * 获取当前用户openid
     *
     * @return /
     */
    public static String getCurrentOpenid() {
        UserDetails userDetails = getCurrentUser();
        // 将 Java 对象转换为 JSONObject 对象
        JSONObject jsonObject = (JSONObject) JSON.toJSON(userDetails);
        return jsonObject.getJSONObject("user").getString("openid");
    }
    /**
     * 获取用户ID
     * @return 系统用户ID
     */