新增视频资源

This commit is contained in:
zyj
2025-10-22 17:29:40 +08:00
parent 60f4995dc7
commit 81df8f1ad8
4 changed files with 16 additions and 1 deletions

3
app.go
View File

@@ -31,6 +31,9 @@ func (a *App) GetResources(rawURL string) *services.ResourcesList {
if v.Type == proto.NetworkResourceTypeScript { if v.Type == proto.NetworkResourceTypeScript {
resources.Script = append(resources.Script, v.URL) resources.Script = append(resources.Script, v.URL)
} }
if v.Type == proto.NetworkResourceTypeMedia {
resources.Video = append(resources.Video, v.URL)
}
} }
return resources return resources

View File

@@ -65,7 +65,7 @@
<!-- 快速提示 --> <!-- 快速提示 -->
<div class="quick-tips" v-if="!hasSearched && !searchKeyword"> <div class="quick-tips" v-if="!hasSearched && !searchKeyword">
<div class="tips-title">搜索建议</div> <div class="tips-title">搜索历史</div>
<div class="tips-grid"> <div class="tips-grid">
<div <div
v-for="tip in searchTips" v-for="tip in searchTips"

View File

@@ -40,6 +40,13 @@ export class ResourcesList {
*/ */
this["dom"] = []; this["dom"] = [];
} }
if (!("video" in $$source)) {
/**
* @member
* @type {string[]}
*/
this["video"] = [];
}
Object.assign(this, $$source); Object.assign(this, $$source);
} }
@@ -54,6 +61,7 @@ export class ResourcesList {
const $$createField1_0 = $$createType0; const $$createField1_0 = $$createType0;
const $$createField2_0 = $$createType0; const $$createField2_0 = $$createType0;
const $$createField3_0 = $$createType0; const $$createField3_0 = $$createType0;
const $$createField4_0 = $$createType0;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("script" in $$parsedSource) { if ("script" in $$parsedSource) {
$$parsedSource["script"] = $$createField0_0($$parsedSource["script"]); $$parsedSource["script"] = $$createField0_0($$parsedSource["script"]);
@@ -67,6 +75,9 @@ export class ResourcesList {
if ("dom" in $$parsedSource) { if ("dom" in $$parsedSource) {
$$parsedSource["dom"] = $$createField3_0($$parsedSource["dom"]); $$parsedSource["dom"] = $$createField3_0($$parsedSource["dom"]);
} }
if ("video" in $$parsedSource) {
$$parsedSource["video"] = $$createField4_0($$parsedSource["video"]);
}
return new ResourcesList(/** @type {Partial<ResourcesList>} */($$parsedSource)); return new ResourcesList(/** @type {Partial<ResourcesList>} */($$parsedSource));
} }
} }

View File

@@ -26,6 +26,7 @@ type ResourcesList struct {
CSS []string `json:"css"` CSS []string `json:"css"`
Image []string `json:"image"` Image []string `json:"image"`
Dom []string `json:"dom"` Dom []string `json:"dom"`
Video []string `json:"video"`
} }
// 获取当前页面的所有本站资源 js、css、img、链接 // 获取当前页面的所有本站资源 js、css、img、链接