【发布时间】:2019-02-08 13:49:20
【问题描述】:
我是 Shopify 的初学者,但在使用 Shopify 代理时遇到了麻烦
前店:https://bhavin.myshopify.com
应用商店: https://myapp.ngrok.io (Laravel)
我想在前台添加两个文件(自定义 js 和 manifest.json)。
安装和身份验证工作正常
我正在添加 manifest.json 类似的内容
var link = document.createElement('link');
link.rel = 'manifest';
link.href = 'https://myapp.ngrok.io/manifest.json';
document.head.appendChild(link);
1.没有代理
manifest.json 文件已正确添加,但会抛出类似的错误
Access to resource at 'https://myapp.ngrok.io/manifest.json' from origin 'https://bhavin.myshopify.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
2。使用代理
Subpath prefix: apps
Subpath: cnv
Proxy URL: https://myapp.ngrok.io/proxy
现在我的manifest.json 文件路径是https://bhavincb.myshopify.io/apps/cnv/manifest.json
如果我已登录管理面板,则 URL 工作正常
如果我在未登录时打开该 URL,则它会返回
This page isn’t working with HTTP ERROR 401
在加载清单文件时在我的前台商店中显示类似的内容(登录时)
Manifest: Line: 1, column: 1, Unexpected token.
manifest.json没有任何错误
我正在使用Laravel Shopify 包
据我所知,我猜我的代理配置有问题。
有人有解决办法吗?
任何帮助将不胜感激
【问题讨论】: