mirror of
https://gitee.com/dcloud/opendb.git
synced 2024-12-27 06:51:15 +08:00
update: uni-cms-articles.schema.ext.js
This commit is contained in:
parent
39d8db19df
commit
c7be2d951e
@ -174,8 +174,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
// 读取文章后触发
|
// 读取文章后触发
|
||||||
afterRead: async function ({userInfo, clientInfo, result, where, field}) {
|
afterRead: async function ({userInfo, clientInfo, result, where, field}) {
|
||||||
|
const isAdmin = field && field.length && field.includes('is_admin')
|
||||||
// 检查是否配置了clientAppIds字段,如果没有则抛出错误
|
// 检查是否配置了clientAppIds字段,如果没有则抛出错误
|
||||||
if (!config.clientAppIds && clientInfo.uniPlatform !== 'web') {
|
if (!config.clientAppIds && !config.clientAppIds.length && !isAdmin) {
|
||||||
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