增加解析git仓库url图片的功能

This commit is contained in:
xu_yanfeng 2025-02-01 23:13:32 +08:00
parent 93be854469
commit b9b0ff3b03
2 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,8 @@ export class AdItem {
parse(data: AdItem) { parse(data: AdItem) {
this.name = data.name; this.name = data.name;
this.store = data.store || ""; this.store = data.store || "";
this.parseStore();
this.try = data.try || ""; this.try = data.try || "";
this.tip = data.tip || ""; this.tip = data.tip || "";
this.duration = data.duration || 0; this.duration = data.duration || 0;
@ -40,6 +42,13 @@ export class AdItem {
this.img = githubMirrorMgr.getFileUrl(img); this.img = githubMirrorMgr.getFileUrl(img);
return this; return this;
} }
parseStore() {
const flag = "${git}";
if (this.store.startsWith(flag)) {
const file = this.store.split(flag)[1];
this.store = githubMirrorMgr.getFileUrl(file);
}
}
} }
export class AdData { export class AdData {
desc: string = ""; desc: string = "";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 KiB

After

Width:  |  Height:  |  Size: 53 KiB