xin
5 days ago 044a57d2133b2363a6f0d3d167b3eaa587c70b91
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
     */