我正在尝试使用 Google Firestore 规则防止重复条目,但是它不起作用。我正在尝试的规则是:
service cloud.firestore {
// Prevent duplicate messages
match /databases/{database}/documents {
match /messages/{message} {
allow read;
allow write: if request.resource.data.m != resource.data.m;
}
}
}
Run Code Online (Sandbox Code Playgroud)
从我读到的,这应该有效。
我究竟做错了什么?
firebase-security google-cloud-platform google-cloud-firestore
我正在使用 Nuxt 和 Nuxt-Fire ( https://github.com/lupas/nuxt-fire )
当我启动测试时出现此错误 [Vue warn]: Error in config.errorHandler: "TypeError: Cannot read property 'ref' of undefined"
这是因为我的应用程序中的这一部分
mounted() {
this.initiate(window.instaroomId)
let connected = this.$fireDb.ref(".info/connected")
this.getConnection(connected)
},
Run Code Online (Sandbox Code Playgroud)
看起来 this.$fireDb 没有被调用。该模块通常加载在 nuxt.config.js 中。我怎样才能使这项工作?
我正在使用webpack-dev-server进行热重新加载.然而,在我的控制台,它一直在说Invalid Host/Origin header
我在webpack配置中的设置如下:
'use strict'
const webpack = require('webpack')
const { VueLoaderPlugin } = require('vue-loader')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
mode: 'development',
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
},
hot: true,
watchOptions: {
poll: true
}
},
module: {
rules: [
...
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
...
]
}
Run Code Online (Sandbox Code Playgroud)
如何解决此问题以使其在我的开发环境中运行?希望听到这个,因为我不得不不断刷新页面.
我在表单请求旁边传递一个对象,如下所示:
public function updateTrade(SendTradeRequest $request, Trade $trade)
Run Code Online (Sandbox Code Playgroud)
如何在规则()部分的 SendTradeRequest 中访问随此请求发送的 Trade $trade 对象?