feat(W1): 皮肤包管理页-卡片网格+上传/派生/编辑/删除,ThemeApi五方法,路由/入口/mock modId=7,ThemeVo增source/inUseCount/editable/usedBySiteNames,T-W1-21..24 绿56/56
build / build (push) Successful in 2m16s
build / build (push) Successful in 2m16s
This commit is contained in:
@@ -212,6 +212,35 @@ class ThemeApi {
|
||||
list() {
|
||||
return get<ThemeVo[]>(`${THEME}/list`);
|
||||
}
|
||||
|
||||
/** W1:上传合规 zip(multipart,超管;免重启立即注册) */
|
||||
upload(file: File) {
|
||||
const fd = new FormData();
|
||||
fd.append("file", file);
|
||||
return alovaInstance.Post<ThemeVo>(`${THEME}/upload`, fd);
|
||||
}
|
||||
|
||||
/** W1:从现有包派生新皮肤(复制包体+改名) */
|
||||
derive(source: string, name: string) {
|
||||
return postJSON<ThemeVo>(`${THEME}/derive`, { source, name });
|
||||
}
|
||||
|
||||
/** W1:编辑外部包 theme.json 的 title/参数 schema */
|
||||
updateMeta(name: string, data: { title?: string; params?: unknown[] }) {
|
||||
return alovaInstance.Put<ThemeVo>(`${THEME}/${name}/meta`, data, {
|
||||
headers: { "Content-Type": "application/json;charset=UTF-8" },
|
||||
});
|
||||
}
|
||||
|
||||
/** W1:删除外部包(被用站点拒绝;内置不可删) */
|
||||
remove(name: string) {
|
||||
return alovaInstance.Delete<{ ok: boolean }>(`${THEME}/${name}`);
|
||||
}
|
||||
|
||||
/** W1:热重载(运维直放目录后生效) */
|
||||
reload() {
|
||||
return postJSON<ThemeVo[]>(`${THEME}/reload`);
|
||||
}
|
||||
}
|
||||
|
||||
/** 主题预览 iframe URL(方案 §5.5:/api/theme/preview,CAS 会话同源,参数 p_ 前缀)。
|
||||
|
||||
Reference in New Issue
Block a user