This commit is contained in:
c
2025-03-12 20:11:03 +08:00
commit 70b7c82c97
1178 changed files with 148185 additions and 0 deletions
@@ -0,0 +1,15 @@
exports.safeRequire = function (module) {
try {
return require(module)
} catch (e) {
if (e.code === 'MODULE_NOT_FOUND') {
console.log(e);
throw new Error(`${module} 公共模块不存在,请在 uni-ai-chat 目录右击"管理公共模块或扩展依赖"添加 ${module} 模块`)
}
}
}
exports.checkContentSecurityEnable = function (config, field) {
// 1. 从配置中心获取配置
return config && config.allowCheckType && config.allowCheckType.includes(field)
}