javascript を使用して、ルート サイトから他のサブ サイトに sharepoint アプリをプログラムでインストールする必要があります。しかし、私のインストール機能は機能しません:
function InstallApp()
{
var context = new SP.ClientContext(appweburl);
var factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
context.set_webRequestExecutorFactory(factory);
var installContext = new SP.AppContextSite(context, hostweburl + '/subSite');
var installWeb = installContext.get_web();
var appFile = installWeb.getFileByServerRelativeUrl('/SiteAssets/myAppFile.app');
installWeb.loadAndInstallApp(appFile);
installWeb.update();
installContext.get_context().load(installWeb);
installContext.get_context().executeQueryAsync(onInstallSuccess, OnFailure);
}