q-koa 9.5.2 → 9.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -502,7 +502,11 @@ exports.urlToOss = async (ctx) => {
|
|
|
502
502
|
oss_host,
|
|
503
503
|
} = await appConfig.getObject('oss')
|
|
504
504
|
|
|
505
|
-
if (
|
|
505
|
+
if (
|
|
506
|
+
!url ||
|
|
507
|
+
(!url.includes('://lanhu') &&
|
|
508
|
+
['aliyun', cdn_host, oss_host].some((i) => url.includes(i)))
|
|
509
|
+
)
|
|
506
510
|
return ctx.SUCCESS(url)
|
|
507
511
|
|
|
508
512
|
if (!(accessKeyId && accessKeySecret && bucket && region)) {
|
|
@@ -255,6 +255,14 @@ exports.initData = async ({ includes, excludes, app, ctx }) => {
|
|
|
255
255
|
return {
|
|
256
256
|
...obj,
|
|
257
257
|
setting: obj.setting.map((i) => {
|
|
258
|
+
let reset = true
|
|
259
|
+
if (i.parent_id) {
|
|
260
|
+
const parent = obj.setting.find((s) => s.id === i.parent_id)
|
|
261
|
+
const same = obj.setting.filter((s) => s.code === i.code)
|
|
262
|
+
if (parent && parent.code !== config && same.length > 1) {
|
|
263
|
+
reset = false
|
|
264
|
+
}
|
|
265
|
+
}
|
|
258
266
|
if (i.code === 'is_check' && i.value === false) {
|
|
259
267
|
return {
|
|
260
268
|
...(i.toJSON ? i.toJSON() : i),
|
|
@@ -269,7 +277,7 @@ exports.initData = async ({ includes, excludes, app, ctx }) => {
|
|
|
269
277
|
) {
|
|
270
278
|
return {
|
|
271
279
|
...(i.toJSON ? i.toJSON() : i),
|
|
272
|
-
value: target[i.code],
|
|
280
|
+
...(reset ? { value: target[i.code] } : {}),
|
|
273
281
|
}
|
|
274
282
|
}
|
|
275
283
|
return i
|