Skip to content

Commit

Permalink
fix: 校验域名空值问题 & 重定向table展示method
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ngjie committed Sep 25, 2023
1 parent 1202922 commit 8afbe9d
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ajax-proxy",
"private": true,
"description": "Modify your Ajax response to test",
"version": "2.2.7",
"version": "2.2.8",
"scripts": {
"dev": "pnpm -C ./packages/vue-panels serve",
"watch": "run-p watch:lib watch:chrome",
Expand Down
2 changes: 1 addition & 1 deletion packages/shell-chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Ajax Proxy",
"version": "2.2.7",
"version": "2.2.8",
"description": "Modify your Ajax response to test",
"author": "Gj",
"icons": {
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default {
dataErr: 'Data exception',
formatErr: 'Format error',
importEmpty: 'You imported an empty list',
existsEmptyString: 'Empty string exists',
},
placeholder: {
select: 'Please select',
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
dataErr: 'Données anormales',
formatErr: 'Mauvais format',
importEmpty: 'Vous avez importé une liste vide',
existsEmptyString: 'Présence d\'une chaîne vide',
},
placeholder: {
select: 'Veuillez sélectionner',
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/ireland.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
dataErr: 'Eisceachta sonraí',
formatErr: 'Earráid fhormáide',
importEmpty: 'Iompórtáil tú liosta folamh',
existsEmptyString: 'Tá teaghrán folamh ann',
},
placeholder: {
select: 'Roghnaigh le do thoil',
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
dataErr: 'データ異常',
formatErr: 'フォーマットエラー',
importEmpty: '空のリストをインポートしました',
existsEmptyString: '空の文字列が存在します',
},
placeholder: {
select: '選択してください',
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
dataErr: '데이터 예외',
formatErr: '형식 오류',
importEmpty: '빈 목록을 가져왔습니다',
existsEmptyString: '빈 문자열 있음',
},
placeholder: {
select: '선택하십시오.',
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
dataErr: 'аномалия данных',
formatErr: 'ошибка формата',
importEmpty: 'вы импортировали пустой список',
existsEmptyString: 'Наличие пустых строк',
},
placeholder: {
select: 'Выберите',
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/zh_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default {
dataErr: '数据异常',
formatErr: '格式错误',
importEmpty: '你导入了一个空列表',
existsEmptyString: '存在空字符串',
},
placeholder: {
select: '请选择',
Expand Down
1 change: 1 addition & 0 deletions packages/vue-panels/src/lang/zh_TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
dataErr: '數據异常',
formatErr: '格式錯誤',
importEmpty: '你導入了一個空清單',
existsEmptyString: '存在空字符串',
},
placeholder: {
select: '請選擇',
Expand Down
14 changes: 14 additions & 0 deletions packages/vue-panels/src/views/interceptor/modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
trigger: 'blur',
message: $t('msg.pathNotEmpty'),
},
{
validator: validUrl,
trigger: 'change',
message: $t('msg.existsEmptyString'),
},
]"
prop="match_url"
>
Expand Down Expand Up @@ -162,6 +167,15 @@ export default {
};
},
methods: {
validUrl(rule, value, callback) {
if (value) {
const trimStr = value.trim();
if (value.length != trimStr.length) {
callback(new Error());
}
}
callback();
},
// 打开编辑器
handleOpenJsonEditor(jsonStr) {
try {
Expand Down
19 changes: 19 additions & 0 deletions packages/vue-panels/src/views/redirector/modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
trigger: 'blur',
message: $t('msg.domainNotEmpty'),
},
{
validator: validUrl,
trigger: 'change',
message: $t('msg.existsEmptyString'),
},
]"
prop="domain"
>
Expand Down Expand Up @@ -57,6 +62,11 @@
trigger: 'change',
message: $t('msg.redirectNotEmpty'),
},
{
validator: validUrl,
trigger: 'change',
message: $t('msg.existsEmptyString'),
},
]"
prop="redirect_url"
>
Expand Down Expand Up @@ -249,6 +259,15 @@ export default {
};
},
methods: {
validUrl(rule, value, callback) {
if (value) {
const trimStr = value.trim();
if (value.length != trimStr.length) {
callback(new Error());
}
}
callback();
},
// 白名单添加
handleIgnoresAdd() {
this.form.ignores.push("");
Expand Down
5 changes: 5 additions & 0 deletions packages/vue-panels/src/views/redirector/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
}}
</template>
</el-table-column>
<el-table-column label="Method" width="90">
<template slot-scope="{ row }">
{{ row.method || "ANY" }}
</template>
</el-table-column>
<el-table-column
prop="domain"
:label="$t('domain')"
Expand Down

0 comments on commit 8afbe9d

Please sign in to comment.