update: uni-cms-articles.schema.ext.js

This commit is contained in:
chenruilong 2024-06-12 15:27:26 +08:00
parent c7be2d951e
commit c8755e461c

View File

@ -176,7 +176,7 @@ module.exports = {
afterRead: async function ({userInfo, clientInfo, result, where, field}) {
const isAdmin = field && field.length && field.includes('is_admin')
// 检查是否配置了clientAppIds字段如果没有则抛出错误
if (!config.clientAppIds && !config.clientAppIds.length && !isAdmin) {
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')
}