彭雪彬
2025-07-15 002dad83de409449f2c356f33f54f13dbed28527
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
     */