feat(admin): v3.5.12 大屏BGM、中文展示、分类删除修复与侧栏顺序
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,12 +20,12 @@ export class AdminStoreCategoriesController {
|
||||
|
||||
@Get()
|
||||
list() {
|
||||
return this.categories.listTree({ includeDisabled: true, ensure: true });
|
||||
return this.categories.listTree({ includeDisabled: true, ensure: false });
|
||||
}
|
||||
|
||||
@Get('flat')
|
||||
listFlat() {
|
||||
return this.categories.listFlat({ includeDisabled: true, ensure: true });
|
||||
return this.categories.listFlat({ includeDisabled: true, ensure: false });
|
||||
}
|
||||
|
||||
@Post('ensure-defaults')
|
||||
|
||||
@@ -20,7 +20,7 @@ export class StoreCategoryService {
|
||||
|
||||
/**
|
||||
* 仅补齐缺失的默认分类,绝不 update 已有行(避免改动线上历史数据)。
|
||||
* 已存在的 HOTPOT/LOCAL 等保持原样;缺的一级/二级才 create。
|
||||
* 只应由「同步默认分类」或 seed 调用;列表接口不得自动补种,否则 HQ 删除会被立刻重建。
|
||||
*/
|
||||
async ensureDefaults() {
|
||||
for (const root of DEFAULT_STORE_CATEGORY_TREE) {
|
||||
@@ -91,7 +91,8 @@ export class StoreCategoryService {
|
||||
}
|
||||
|
||||
async listTree(options?: { includeDisabled?: boolean; ensure?: boolean }) {
|
||||
if (options?.ensure !== false) {
|
||||
/** 列表默认不补种:否则 HQ 刚删的默认分类会被立刻重建,表现为「已处理但没删掉」 */
|
||||
if (options?.ensure === true) {
|
||||
await this.ensureDefaults();
|
||||
}
|
||||
const includeDisabled = options?.includeDisabled === true;
|
||||
@@ -111,7 +112,7 @@ export class StoreCategoryService {
|
||||
}
|
||||
|
||||
async listFlat(options?: { includeDisabled?: boolean; ensure?: boolean }) {
|
||||
if (options?.ensure !== false) {
|
||||
if (options?.ensure === true) {
|
||||
await this.ensureDefaults();
|
||||
}
|
||||
const includeDisabled = options?.includeDisabled === true;
|
||||
|
||||
@@ -68,7 +68,7 @@ export class PublicStoreCategoriesController {
|
||||
|
||||
@Get()
|
||||
list() {
|
||||
return this.categories.listTree({ includeDisabled: false, ensure: true });
|
||||
return this.categories.listTree({ includeDisabled: false, ensure: false });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class PartnerStoreCategoriesController {
|
||||
|
||||
@Get()
|
||||
list() {
|
||||
return this.categories.listTree({ includeDisabled: false, ensure: true });
|
||||
return this.categories.listTree({ includeDisabled: false, ensure: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user