彭雪彬
2025-07-14 c1d20b425b10e8ba59f102dd1ab413055883eed0
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
     */