Skip to content

Commit 37e8b91

Browse files
committed
feat: 加载时读取之前保存的 ua, 提示传请求的 ua 和 自定义 ua 互斥
1 parent 986021f commit 37e8b91

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.15.80",
3+
"version": "2.15.81",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ export default {
340340
placeholder: "Value or URL(use response content)",
341341
},
342342
passThroughUA: {
343-
label: 'Pass Through Request User-Agent'
343+
label: 'Pass Through Request User-Agent',
344+
warning: 'Pass Through Request User-Agent and Custom UA cannot be enabled at the same time',
344345
},
345346
proxy: {
346347
label: "Proxy/Policy",

src/locales/zh.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ export default {
358358
placeholder: '填写值或链接(使用响应内容)',
359359
},
360360
passThroughUA: {
361-
label: '透传请求的 User-Agent'
361+
label: '透传请求的 User-Agent',
362+
warning: '透传请求的 User-Agent 和 自定义 UA 不可同时启用',
362363
},
363364
proxy: {
364365
label: '代理/策略',

src/views/SubEditor.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ import { useI18n } from "vue-i18n";
532532
import { useRoute, useRouter } from "vue-router";
533533
import cmView from "@/views/editCode/cmView.vue";
534534
import { useCodeStore } from "@/store/codeStore";
535+
import { toast } from "vue3-toastify/index";
535536
const cmStore = useCodeStore();
536537
const isDis = ref(true)
537538
const { t } = useI18n();
@@ -718,6 +719,14 @@ watchEffect(() => {
718719
form.content = sourceData.content;
719720
cmStore.setEditCode('SubEditer', sourceData.content);
720721
form.ua = sourceData.ua;
722+
form._savedUA = sourceData._savedUA;
723+
if(form.passThroughUA && form.ua){
724+
showNotify({
725+
type: "warning",
726+
title: t(`editorPage.subConfig.basic.passThroughUA.warning`),
727+
duration: 65535,
728+
});
729+
}
721730
break;
722731
}
723732

0 commit comments

Comments
 (0)