我正在使用NUXT-PWA缓存我的数据,但是我有一个依赖于要构建的POST请求的页面,我需要缓存JSON响应,但我得到了以下错误:
Uncaught (in promise) attempt-to-cache-non-get-request: Unable to cache '/api/hotel/order/get-voucher' because it is a 'POST' request and only '
我将在privateRuntimeConfig文件的nuxt.config.js选项中保存API凭据。我要这些钥匙在服务器上安全,我不想这些在客户端。现在,我想在用户单击一个按钮后向API发送一个请求,但我需要使用该键,但它们不在客户端。所以,我不知道怎么做。""},
sendRequest() {
// Here I should send the request using the API<
我刚刚在服务器上部署了一个nuxt应用程序,但是它以不好的方式缓存。在任何设备中,无论登录与否,我都会得到一个用户信息,那就是cookie和令牌!甚至这个问题是因为缓存造成的吗?当我试图在nuxt.config.js中设置axios的头时,我会得到以下错误:
Access to XMLHttpRequest at 'url of the backend' from origin我尝试过设置Access-Control-Allow-Headers,但是它没有工作,我的nuxt.c