我有一个带有Firebase数据库的移动应用程序。在应用程序中,客户通过移动应用程序订购产品,目前我还没有添加到订单注册的需要。商店在web面板中接收订单并回答客户。我创建了一些默认规则,但谷歌已经告诉我,我的规则是不安全的,我必须改变它们。
// In this way the orders arrive from the mobile App to the database, but it is not secure
service cloud.firestore {
match / databases / {database} / documents {
match / {
我使用useContext和useReducer来管理应用程序状态。
下面是代码片段:
//ReducerProvider.tsx
type ContextProviderType = {
state: StateInterface,
dispatch: React.Dispatch<ActionInterface>
}
type CreateContextType = ContextProviderType | string; // i am passing to the createContext either the ContextProvide