我试过:
user.lastSeen = new Date().toISOString()
user.lastSeen = new Date()
user.lastSeen = new Date().now();
都触发了
{
"ValidationError": {
"lastSeen": [
{
"data": "2014-01-05T10:25:06.184Z",
"message": "Validation error: "2014-01-05T10:25:06.184Z" is not of type "datatime"",
"rule": "datatime"
}
]
}
}
生成
sail 的用户模型时可能存在拼写错误.js
转到$(projectDir)apimodelsuser.js
将lastSeen : "datatime"
更改为lastSeen : "datetime"