Sharepoint列表获取在localhost上返回403

Sharepoint列表获取在localhost上返回403

本文介绍了Sharepoint列表获取在localhost上返回403(禁止)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好,我正在尝试使用 @ pnp / sp 在我的webpart中获取列表。 不幸的是我收到403错误,但只有在localhost上运行时,它才能在xxx.sharepoint.com/sites/xxx/_layouts/15/workbench.aspx import {sp} from ; @ PNP / SP英寸; ... const data = await sp.web.lists.getByTitle(" xxx")。items.select(" *")。get( ); ... 我收到以下错误消息: Uncaught(in promise)错误:在查询中发出HttpClient请求时出错:[403] at new ProcessHttpClientResponseException 解决方案 嗨 我认为您访问SharePoint在线列表,并且在在线上下文中它没有权限问题,但在您的本地环境中它确实存在。 Hello, I am trying to fetch a list in my webpart using @pnp/sp.Unfortunately I am getting a 403 error, but only when running on localhost, it works fine on xxx.sharepoint.com/sites/xxx/_layouts/15/workbench.aspximport { sp } from "@pnp/sp";...const data = await sp.web.lists.getByTitle("xxx").items.select("*").get();...I am getting the following error message:Uncaught (in promise) Error: Error making HttpClient request in queryable: [403] at new ProcessHttpClientResponseException 解决方案 HiI think you access the SharePoint online list and in online context it has no permission issue but in your local environment it does. 这篇关于Sharepoint列表获取在localhost上返回403(禁止)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-05 10:02