彭雪彬
2025-07-23 ef684096ece7f699447bf567c4d89eecd9b3d200
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
     */