我继承了模型
body {
width: 400px;
}
p {
margin-top: 0;
margin-bottom: 0.5em;
}
blockquote {
background-color: antiquewhite;
padding-top: 0.5em;
padding-bottom: 0.5em;
margin-top: 0;
margin-bottom: 0.5em;
}
blockquote p:last-child {
margin-bottom: 0;
}
blockquote p:first-child {
margin-top: 0;
}
并创建钩子,用于保存用户的角色
<p>Some text before blockquotes</p>
<blockquote>
<p><strong>1st blockquote</strong>
</p>
<p>1st paragraph. Foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo.</p>
<p>2nd paragraph. Bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar.</p>
</blockquote>
<blockquote>
<p><strong>2nd blockquote</strong>
</p>
<p>1st paragraph. Foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo.</p>
<p>2nd paragraph. Bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar.</p>
</blockquote>
<p>Some text after blockquotes</p>
记录成功添加到db(mongo),但请求GET
{
"name": "user",
"plural": "users",
"base": "User",
"relations": {
"roles": {
"type": "hasMany",
"model": "Role",
"foreignKey": "principalId",
"through": "RoleMapping"
}
},
记录未加入,为什么?
答案 0 :(得分:-1)