Skip to content

Commit 579ef90

Browse files
add diyua support
1 parent 2d53140 commit 579ef90

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/views/Subconverter.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
</el-button>
8888
</el-form-item>
8989
</template>
90+
<el-form-item label="自定义UA:">
91+
<el-input v-model="form.diyua" placeholder="设置获取订阅链接时所用的自定义User-Agent"/>
92+
</el-form-item>
9093
<el-form-item label="包含节点:">
9194
<el-input v-model="form.includeRemarks" placeholder="要保留的节点,支持正则"/>
9295
</el-form-item>
@@ -1129,7 +1132,7 @@ export default {
11291132
"&scv=" +
11301133
this.form.scv.toString() +
11311134
"&fdn=" +
1132-
this.form.fdn.toString();
1135+
this.form.fdn.toString();
11331136
if (this.form.clientType.includes("surge")) {
11341137
if (this.form.tpl.surge.doh === true) {
11351138
this.customSubUrl += "&surge.doh=true";
@@ -1146,6 +1149,10 @@ export default {
11461149
this.customSubUrl += "&singbox.ipv6=1";
11471150
}
11481151
}
1152+
if (this.form.diyua.trim() !== "") {
1153+
this.customSubUrl +=
1154+
"&diyua=" + encodeURIComponent(this.form.diyua);
1155+
}
11491156
this.$copyText(this.customSubUrl);
11501157
this.$message.success("定制订阅已复制到剪贴板");
11511158
},
@@ -1331,6 +1338,9 @@ export default {
13311338
if (param.get("singbox.ipv6")) {
13321339
this.form.tpl.singbox.ipv6 = param.get("singbox.ipv6") === '1';
13331340
}
1341+
if (param.get("diyua")) {
1342+
this.form.diyua = param.get("diyua");
1343+
}
13341344
this.dialogLoadConfigVisible = false;
13351345
this.$message.success("长/短链接已成功解析为订阅信息");
13361346
})();
@@ -1355,6 +1365,7 @@ export default {
13551365
data.append("sdoh", encodeURIComponent(this.form.tpl.surge.doh.toString()));
13561366
data.append("cdoh", encodeURIComponent(this.form.tpl.clash.doh.toString()));
13571367
data.append("newname", encodeURIComponent(this.form.new_name.toString()));
1368+
data.append("diyua", encodeURIComponent(this.form.diyua.toString()));
13581369
return data;
13591370
},
13601371
confirmUploadScript() {

0 commit comments

Comments
 (0)