我在我的 webpart 中使用此代码插入到带有列表名称的共享点列表中,但是将此代码移动到生产环境中会产生一个问题,因为它形成了用于插入列表的错误 url,生产中的 url 是 https:// abcportal.sharepoint.com/sites/SolutionBook/SitePages/_api/web/lists/getByTitle('Smart%20City%20IAQ%20Demo%20Requests')?$select=ListItemEntityTypeFullName
但是在本地环境中工作正常,它形成了这个 url https://abcportal.sharepoint.com/sites/solutionbooktest/_api/web/lists/getByTitle('Smart City IAQ Demo Requests')/items
生产环境中URL SitePages 自动来了,怎么去掉?
--------代码--------- public insertEmailToList() {
pnp.sp.web.lists.getByTitle("Smart City IAQ Demo Requests").items.add({
Title: this.state.Email
}).then(r => {
this.setState({ ButtonActive: false });
});
}
或者有没有办法使用列表的 URL 插入共享点列表?