mirror of
https://gitee.com/dcloud/opendb.git
synced 2024-12-27 15:01:15 +08:00
fix uni-cms-article/schema.ext.js 格式
This commit is contained in:
parent
ee8b5113ef
commit
7411eb590e
@ -84,10 +84,7 @@ function safeRequire(module) {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
trigger: {
|
trigger: {
|
||||||
// 创建文章前触发
|
// 创建文章前触发
|
||||||
beforeCreate: async function ({
|
beforeCreate: async function ({clientInfo, addDataList}) {
|
||||||
clientInfo,
|
|
||||||
addDataList,
|
|
||||||
}) {
|
|
||||||
// addDataList 是一个数组,因为可以一次性创建多条数据
|
// addDataList 是一个数组,因为可以一次性创建多条数据
|
||||||
if (addDataList.length <= 0) return
|
if (addDataList.length <= 0) return
|
||||||
|
|
||||||
@ -119,11 +116,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 更新文章前触发
|
// 更新文章前触发
|
||||||
beforeUpdate: async function ({
|
beforeUpdate: async function ({clientInfo, where, updateData}) {
|
||||||
clientInfo,
|
|
||||||
where,
|
|
||||||
updateData
|
|
||||||
}) {
|
|
||||||
const id = where && where._id
|
const id = where && where._id
|
||||||
|
|
||||||
if (!id) return
|
if (!id) return
|
||||||
@ -156,7 +149,7 @@ module.exports = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
// 读取文章前触发
|
// 读取文章前触发
|
||||||
afterRead: async function ({ userInfo, clientInfo, result, where, field }) {
|
afterRead: async function ({userInfo, clientInfo, result, where, field}) {
|
||||||
// 检查是否配置了clientAppIds字段,如果没有则抛出错误
|
// 检查是否配置了clientAppIds字段,如果没有则抛出错误
|
||||||
if (!config.clientAppIds && clientInfo.uniPlatform !== 'web') {
|
if (!config.clientAppIds && clientInfo.uniPlatform !== 'web') {
|
||||||
throw new Error('请在 uni-cms 配置文件中配置 clientAppIds 字段后访问,详见:https://uniapp.dcloud.net.cn/uniCloud/uni-cms.html#uni-cms-config')
|
throw new Error('请在 uni-cms 配置文件中配置 clientAppIds 字段后访问,详见:https://uniapp.dcloud.net.cn/uniCloud/uni-cms.html#uni-cms-config')
|
||||||
|
Loading…
Reference in New Issue
Block a user