1***@qq.com
1***@qq.com
  • 发布:2021-10-04 16:44
  • 更新:2021-10-08 10:21
  • 阅读:979

设置了foreceDefaultValue{ "$env":"uid"},为何创建记录的时候不生成

分类:uniCloud

首先在schema里设置了

"reserve_userID": {  
            "forceDefaultValue": {  
                "$env": "uid"  
            },  
            "foreignKey": "uni-id-users._id",  
            "permission": {  
                "read": true,  
                "create": true,  
                "update": false,  
                "delete": false  
            },  
            "description": "用户ID"  
        },

我在前端提交相应表单数据的时候发现并没有生成该字段以及默认uid,如果我在前端主动提交reserve_userID,还会报错:

Uncaught (in promise)P: [router]: ValidationFailed:errCode: ValidationFailed | errMsg: 参数校验错误: doc field should not contain illegal character
at Function.complete (http://localhost:8081/static/js/chunk-vendors.js:13065:6053)
at http://localhost:8081/static/js/chunk-vendors.js:708:86381
at Object.I [as callback] (http://localhost:8081/static/js/chunk-vendors.js:708:89543)
at b (http://localhost:8081/static/js/chunk-vendors.js:708:90065)
at XMLHttpRequest.k.onload (http://localhost:8081/static/js/chunk-vendors.js:708:56285)

2021-10-04 16:44 负责人:无 分享
已邀请:
DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

看一下你的网络请求里面这个请求对应的请求体

该问题目前已经被锁定, 无法添加新回复