深度阅读

"Drupal8 使用views创建接口 获取当前用户信息"

作者
作者
2023年08月22日
更新时间
3.17 分钟
阅读时间
0
阅读量

1) Duplicate the default people view and rename it current_user. 2) Add a rest export route eg. rest/users/current_user. 3) Add a filter for current user. 4) Save all. 5) Retrieve the current user via http get request on example.com/rest/user/current_user?_format=hal_json
Thanks to QueenVictoria for the advice.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。