vue-api-request-builder 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.es.js +427 -302
- package/dist/index.umd.js +5 -5
- package/package.json +4 -4
- package/dist/vue-api-request-builder.css +0 -1
- package/lib/components/KeyValueInput.vue +0 -144
- package/lib/components/RequestForm.vue +0 -388
- package/lib/components/ResponseSection.vue +0 -144
- package/lib/index.ts +0 -17
- package/lib/types/request.ts +0 -55
- package/lib/utils/request.ts +0 -194
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as w, watch as C, resolveComponent as c, createElementBlock as $, openBlock as _, createElementVNode as p, createCommentVNode as R, createBlock as O, createVNode as s, withCtx as r, createTextVNode as b, toDisplayString as z, Fragment as F, renderList as K, computed as J } from "vue";
|
|
2
|
+
const le = { class: "key-value-input flex flex-col gap-1" }, se = { class: "flex gap-2" }, ne = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "flex flex-col gap-1"
|
|
5
|
-
}, ue = { class: "flex w-full gap-1 items-center" }, re = /* @__PURE__ */
|
|
5
|
+
}, ue = { class: "flex w-full gap-1 items-center" }, re = /* @__PURE__ */ H({
|
|
6
6
|
__name: "KeyValueInput",
|
|
7
7
|
props: {
|
|
8
8
|
modelValue: {},
|
|
@@ -11,59 +11,59 @@ const oe = { class: "key-value-input flex flex-col gap-1" }, se = { class: "flex
|
|
|
11
11
|
previewText: { default: "" }
|
|
12
12
|
},
|
|
13
13
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
() =>
|
|
18
|
-
(
|
|
19
|
-
n.value =
|
|
14
|
+
setup(a, { emit: g }) {
|
|
15
|
+
const d = a, o = g, n = w(d.modelValue);
|
|
16
|
+
C(
|
|
17
|
+
() => d.modelValue,
|
|
18
|
+
(u) => {
|
|
19
|
+
n.value = u;
|
|
20
20
|
}
|
|
21
|
-
),
|
|
21
|
+
), C(
|
|
22
22
|
n,
|
|
23
|
-
(
|
|
24
|
-
|
|
23
|
+
(u) => {
|
|
24
|
+
o("update:modelValue", u);
|
|
25
25
|
},
|
|
26
26
|
{ deep: !0 }
|
|
27
27
|
);
|
|
28
|
-
const
|
|
28
|
+
const y = () => {
|
|
29
29
|
n.value.push({ key: "", value: "" });
|
|
30
|
-
},
|
|
31
|
-
n.value.splice(
|
|
32
|
-
},
|
|
30
|
+
}, l = (u) => {
|
|
31
|
+
n.value.splice(u, 1);
|
|
32
|
+
}, f = () => {
|
|
33
33
|
n.value = [];
|
|
34
34
|
};
|
|
35
|
-
return (
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
return (u, t) => {
|
|
36
|
+
const v = c("a-button"), x = c("a-popconfirm"), j = c("a-input"), B = c("a-typography-paragraph"), U = c("a-typography");
|
|
37
|
+
return _(), $("div", le, [
|
|
38
|
+
p("div", se, [
|
|
39
|
+
s(v, {
|
|
40
40
|
type: "primary",
|
|
41
|
-
onClick:
|
|
41
|
+
onClick: y,
|
|
42
42
|
class: "w-40 max-w-full",
|
|
43
43
|
size: "small"
|
|
44
44
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
|
|
45
|
+
default: r(() => [
|
|
46
|
+
b(z(u.addButtonText), 1)
|
|
47
47
|
]),
|
|
48
48
|
_: 1
|
|
49
49
|
}),
|
|
50
|
-
|
|
50
|
+
s(x, {
|
|
51
51
|
title: "确认清空",
|
|
52
52
|
description: "确定要清空所有参数吗?",
|
|
53
53
|
"ok-text": "确认",
|
|
54
54
|
"cancel-text": "取消",
|
|
55
|
-
onConfirm:
|
|
55
|
+
onConfirm: f
|
|
56
56
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
|
|
57
|
+
default: r(() => [
|
|
58
|
+
s(v, {
|
|
59
59
|
type: "primary",
|
|
60
60
|
danger: "",
|
|
61
61
|
class: "w-40 max-w-full",
|
|
62
62
|
size: "small",
|
|
63
63
|
disabled: n.value.length === 0
|
|
64
64
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
|
|
65
|
+
default: r(() => t[0] || (t[0] = [
|
|
66
|
+
b(" 清空 ")
|
|
67
67
|
])),
|
|
68
68
|
_: 1
|
|
69
69
|
}, 8, ["disabled"])
|
|
@@ -71,64 +71,64 @@ const oe = { class: "key-value-input flex flex-col gap-1" }, se = { class: "flex
|
|
|
71
71
|
_: 1
|
|
72
72
|
})
|
|
73
73
|
]),
|
|
74
|
-
n.value.length > 0 ? (
|
|
75
|
-
(
|
|
74
|
+
n.value.length > 0 ? (_(), $("div", ne, [
|
|
75
|
+
(_(!0), $(F, null, K(n.value, (k, S) => (_(), $("div", {
|
|
76
76
|
key: S,
|
|
77
77
|
class: "flex"
|
|
78
78
|
}, [
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
p("div", ue, [
|
|
80
|
+
s(v, {
|
|
81
81
|
type: "primary",
|
|
82
82
|
danger: "",
|
|
83
|
-
onClick: (
|
|
83
|
+
onClick: (h) => l(S),
|
|
84
84
|
class: "w-16",
|
|
85
85
|
size: "small"
|
|
86
86
|
}, {
|
|
87
|
-
default:
|
|
88
|
-
|
|
87
|
+
default: r(() => t[1] || (t[1] = [
|
|
88
|
+
b(" 删除 ")
|
|
89
89
|
])),
|
|
90
90
|
_: 2
|
|
91
91
|
}, 1032, ["onClick"]),
|
|
92
|
-
|
|
92
|
+
s(j, {
|
|
93
93
|
value: k.key,
|
|
94
|
-
"onUpdate:value": (
|
|
94
|
+
"onUpdate:value": (h) => k.key = h,
|
|
95
95
|
placeholder: "键",
|
|
96
96
|
style: { width: "60%" },
|
|
97
97
|
size: "small"
|
|
98
98
|
}, null, 8, ["value", "onUpdate:value"]),
|
|
99
|
-
|
|
99
|
+
s(j, {
|
|
100
100
|
value: k.value,
|
|
101
|
-
"onUpdate:value": (
|
|
101
|
+
"onUpdate:value": (h) => k.value = h,
|
|
102
102
|
placeholder: "值",
|
|
103
103
|
style: { width: "100%" },
|
|
104
104
|
size: "small"
|
|
105
105
|
}, null, 8, ["value", "onUpdate:value"])
|
|
106
106
|
])
|
|
107
107
|
]))), 128))
|
|
108
|
-
])) :
|
|
109
|
-
|
|
108
|
+
])) : R("", !0),
|
|
109
|
+
u.showPreview ? (_(), O(U, {
|
|
110
110
|
key: 1,
|
|
111
111
|
class: "m-0"
|
|
112
112
|
}, {
|
|
113
|
-
default:
|
|
114
|
-
|
|
115
|
-
default:
|
|
116
|
-
|
|
113
|
+
default: r(() => [
|
|
114
|
+
s(B, { class: "!m-0" }, {
|
|
115
|
+
default: r(() => [
|
|
116
|
+
p("pre", null, z(u.previewText), 1)
|
|
117
117
|
]),
|
|
118
118
|
_: 1
|
|
119
119
|
})
|
|
120
120
|
]),
|
|
121
121
|
_: 1
|
|
122
|
-
})) :
|
|
122
|
+
})) : R("", !0)
|
|
123
123
|
]);
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
}),
|
|
127
|
-
const
|
|
128
|
-
for (const [
|
|
129
|
-
|
|
130
|
-
return
|
|
131
|
-
},
|
|
126
|
+
}), M = (a, g) => {
|
|
127
|
+
const d = a.__vccOpts || a;
|
|
128
|
+
for (const [o, n] of g)
|
|
129
|
+
d[o] = n;
|
|
130
|
+
return d;
|
|
131
|
+
}, L = /* @__PURE__ */ M(re, [["__scopeId", "data-v-1e5ef051"]]), de = {
|
|
132
132
|
method: "GET",
|
|
133
133
|
url: "https://yesno.wtf",
|
|
134
134
|
path: "/api",
|
|
@@ -140,61 +140,61 @@ const oe = { class: "key-value-input flex flex-col gap-1" }, se = { class: "flex
|
|
|
140
140
|
body: {
|
|
141
141
|
type: "application/json"
|
|
142
142
|
}
|
|
143
|
-
},
|
|
143
|
+
}, ie = { class: "request-form" }, pe = { class: "flex flex-col gap-1" }, ve = { class: "flex flex-row gap-1" }, me = { class: "flex flex-row gap-1" }, fe = { class: "mt-1" }, ce = {
|
|
144
144
|
key: 0,
|
|
145
145
|
class: "flex flex-col gap-1 mt-2"
|
|
146
|
-
}, ye = { class: "flex flex-row gap-1 h-6" },
|
|
146
|
+
}, ye = { class: "flex flex-row gap-1 h-6" }, _e = { class: "flex flex-row gap-1" }, be = {
|
|
147
147
|
key: 1,
|
|
148
148
|
class: "flex flex-col gap-1 mt-1"
|
|
149
|
-
}, xe = { class: "flex flex-row gap-1 items-center" },
|
|
149
|
+
}, xe = { class: "flex flex-row gap-1 items-center" }, we = /* @__PURE__ */ H({
|
|
150
150
|
__name: "RequestForm",
|
|
151
151
|
props: {
|
|
152
152
|
modelValue: { default: () => de }
|
|
153
153
|
},
|
|
154
154
|
emits: ["update:modelValue"],
|
|
155
|
-
setup(
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
let
|
|
159
|
-
return function(...
|
|
160
|
-
clearTimeout(
|
|
155
|
+
setup(a, { emit: g }) {
|
|
156
|
+
const d = a, o = g, n = w(d.modelValue.method), y = w(d.modelValue.url), l = w(d.modelValue.auth.type), f = w(d.modelValue.path), u = w(d.modelValue.auth.username || ""), t = w(d.modelValue.auth.password || ""), v = w(d.modelValue.auth.token || ""), x = w(d.modelValue.params), j = w(d.modelValue.headers), B = w(d.modelValue.body.formData || []), U = w(d.modelValue.body.type), k = w(d.modelValue.body.json || ""), S = w(d.modelValue.body.raw || ""), h = w("");
|
|
157
|
+
function N(i, e) {
|
|
158
|
+
let T;
|
|
159
|
+
return function(...E) {
|
|
160
|
+
clearTimeout(T), T = setTimeout(() => i.apply(this, E), e);
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const A = () => ({
|
|
164
164
|
method: n.value,
|
|
165
|
-
url:
|
|
166
|
-
path:
|
|
165
|
+
url: y.value,
|
|
166
|
+
path: f.value,
|
|
167
167
|
auth: {
|
|
168
|
-
type:
|
|
169
|
-
...
|
|
170
|
-
username:
|
|
171
|
-
password:
|
|
172
|
-
} :
|
|
173
|
-
token:
|
|
168
|
+
type: l.value,
|
|
169
|
+
...l.value === "Basic" ? {
|
|
170
|
+
username: u.value,
|
|
171
|
+
password: t.value
|
|
172
|
+
} : l.value === "Bearer" ? {
|
|
173
|
+
token: v.value
|
|
174
174
|
} : {}
|
|
175
175
|
},
|
|
176
|
-
params:
|
|
177
|
-
headers:
|
|
176
|
+
params: x.value,
|
|
177
|
+
headers: j.value,
|
|
178
178
|
body: {
|
|
179
179
|
type: U.value,
|
|
180
|
-
...U.value === "application/json" ? { json: k.value } : U.value === "multipart/form-data" ? { formData:
|
|
180
|
+
...U.value === "application/json" ? { json: k.value } : U.value === "multipart/form-data" ? { formData: B.value } : { raw: S.value }
|
|
181
181
|
}
|
|
182
|
-
}), W =
|
|
183
|
-
|
|
182
|
+
}), W = N(() => {
|
|
183
|
+
o("update:modelValue", A());
|
|
184
184
|
}, 100);
|
|
185
|
-
|
|
185
|
+
C(
|
|
186
186
|
[
|
|
187
187
|
n,
|
|
188
|
+
y,
|
|
188
189
|
f,
|
|
189
|
-
|
|
190
|
-
a,
|
|
191
|
-
i,
|
|
190
|
+
l,
|
|
192
191
|
u,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
t,
|
|
193
|
+
v,
|
|
194
|
+
x,
|
|
195
|
+
j,
|
|
196
196
|
U,
|
|
197
|
-
|
|
197
|
+
B,
|
|
198
198
|
k,
|
|
199
199
|
S
|
|
200
200
|
],
|
|
@@ -202,18 +202,18 @@ const oe = { class: "key-value-input flex flex-col gap-1" }, se = { class: "flex
|
|
|
202
202
|
W();
|
|
203
203
|
},
|
|
204
204
|
{ deep: !0 }
|
|
205
|
-
),
|
|
206
|
-
() =>
|
|
207
|
-
(
|
|
208
|
-
const e =
|
|
209
|
-
JSON.stringify(
|
|
205
|
+
), C(
|
|
206
|
+
() => d.modelValue,
|
|
207
|
+
(i) => {
|
|
208
|
+
const e = A();
|
|
209
|
+
JSON.stringify(i) !== JSON.stringify(e) && (n.value = i.method, y.value = i.url, f.value = i.path, l.value = i.auth.type, u.value = i.auth.username || "", t.value = i.auth.password || "", v.value = i.auth.token || "", x.value = i.params, j.value = i.headers, U.value = i.body.type, B.value = i.body.formData || [], k.value = i.body.json || "", S.value = i.body.raw || "");
|
|
210
210
|
},
|
|
211
211
|
{ deep: !0 }
|
|
212
212
|
);
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
}),
|
|
213
|
+
const X = J(() => {
|
|
214
|
+
const i = x.value.filter((e) => !!e.key).map((e) => e.key + "=" + encodeURIComponent(e.value)).join("&");
|
|
215
|
+
return i === "" ? "" : "?" + i;
|
|
216
|
+
}), Q = J(() => {
|
|
217
217
|
switch (U.value) {
|
|
218
218
|
case "application/json":
|
|
219
219
|
try {
|
|
@@ -222,412 +222,537 @@ const oe = { class: "key-value-input flex flex-col gap-1" }, se = { class: "flex
|
|
|
222
222
|
return "Invalid JSON";
|
|
223
223
|
}
|
|
224
224
|
case "multipart/form-data":
|
|
225
|
-
const
|
|
226
|
-
return
|
|
227
|
-
(
|
|
228
|
-
Content-Disposition: form-data; name="${
|
|
225
|
+
const i = "----WebKitFormBoundaryPreview";
|
|
226
|
+
return B.value.filter((T) => !!T.key).map(
|
|
227
|
+
(T) => `--${i}\r
|
|
228
|
+
Content-Disposition: form-data; name="${T.key}"\r
|
|
229
229
|
\r
|
|
230
|
-
${
|
|
230
|
+
${T.value}\r
|
|
231
231
|
`
|
|
232
|
-
).join("") + `--${
|
|
232
|
+
).join("") + `--${i}--\r
|
|
233
233
|
`;
|
|
234
234
|
case "text/plain":
|
|
235
235
|
return S.value || "-空-";
|
|
236
236
|
default:
|
|
237
237
|
return "-空-";
|
|
238
238
|
}
|
|
239
|
-
}),
|
|
239
|
+
}), Y = () => {
|
|
240
240
|
try {
|
|
241
|
-
k.value && (JSON.parse(k.value),
|
|
241
|
+
k.value && (JSON.parse(k.value), h.value = "");
|
|
242
242
|
} catch {
|
|
243
|
-
|
|
243
|
+
h.value = "Invalid JSON format";
|
|
244
244
|
}
|
|
245
|
-
},
|
|
245
|
+
}, Z = () => {
|
|
246
246
|
try {
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}),
|
|
253
|
-
} catch (
|
|
254
|
-
console.error("URL解析失败:",
|
|
247
|
+
const i = y.value, e = new URL(i);
|
|
248
|
+
y.value = `${e.protocol}//${e.host}`, f.value = e.pathname;
|
|
249
|
+
const T = new URLSearchParams(e.search), E = [];
|
|
250
|
+
T.forEach((V, D) => {
|
|
251
|
+
E.push({ key: D, value: V });
|
|
252
|
+
}), x.value = E;
|
|
253
|
+
} catch (i) {
|
|
254
|
+
console.error("URL解析失败:", i);
|
|
255
255
|
}
|
|
256
|
-
},
|
|
257
|
-
if (!
|
|
256
|
+
}, ee = J(() => {
|
|
257
|
+
if (!y.value) return !1;
|
|
258
258
|
try {
|
|
259
|
-
const
|
|
259
|
+
const i = y.value, e = new URL(i);
|
|
260
260
|
return e.search !== "" || e.pathname !== "/";
|
|
261
261
|
} catch {
|
|
262
262
|
return !1;
|
|
263
263
|
}
|
|
264
264
|
});
|
|
265
|
-
return (
|
|
266
|
-
const
|
|
267
|
-
return
|
|
268
|
-
|
|
269
|
-
default:
|
|
270
|
-
|
|
265
|
+
return (i, e) => {
|
|
266
|
+
const T = c("a-input"), E = c("a-button"), V = c("a-select-option"), D = c("a-select"), P = c("a-card"), q = c("a-radio-button"), G = c("a-radio-group"), te = c("a-input-password"), I = c("a-textarea"), ae = c("a-alert"), oe = c("a-form");
|
|
267
|
+
return _(), $("div", ie, [
|
|
268
|
+
s(oe, { layout: "vertical" }, {
|
|
269
|
+
default: r(() => [
|
|
270
|
+
s(P, {
|
|
271
271
|
title: "URL配置",
|
|
272
272
|
class: "form-section",
|
|
273
273
|
size: "small"
|
|
274
274
|
}, {
|
|
275
|
-
default:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
value:
|
|
280
|
-
"onUpdate:value": e[0] || (e[0] = (
|
|
275
|
+
default: r(() => [
|
|
276
|
+
p("div", pe, [
|
|
277
|
+
p("div", ve, [
|
|
278
|
+
s(T, {
|
|
279
|
+
value: y.value,
|
|
280
|
+
"onUpdate:value": e[0] || (e[0] = (m) => y.value = m),
|
|
281
281
|
placeholder: "基础URL",
|
|
282
282
|
size: "small"
|
|
283
283
|
}, null, 8, ["value"]),
|
|
284
|
-
|
|
284
|
+
ee.value ? (_(), O(E, {
|
|
285
285
|
key: 0,
|
|
286
286
|
type: "primary",
|
|
287
287
|
size: "small",
|
|
288
|
-
onClick:
|
|
288
|
+
onClick: Z
|
|
289
289
|
}, {
|
|
290
|
-
default:
|
|
291
|
-
|
|
290
|
+
default: r(() => e[13] || (e[13] = [
|
|
291
|
+
b("拆解")
|
|
292
292
|
])),
|
|
293
293
|
_: 1
|
|
294
|
-
})) :
|
|
294
|
+
})) : R("", !0)
|
|
295
295
|
]),
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
p("div", me, [
|
|
297
|
+
s(D, {
|
|
298
298
|
value: n.value,
|
|
299
|
-
"onUpdate:value": e[1] || (e[1] = (
|
|
299
|
+
"onUpdate:value": e[1] || (e[1] = (m) => n.value = m),
|
|
300
300
|
class: "w-40",
|
|
301
301
|
size: "small"
|
|
302
302
|
}, {
|
|
303
|
-
default:
|
|
304
|
-
|
|
305
|
-
default:
|
|
306
|
-
|
|
303
|
+
default: r(() => [
|
|
304
|
+
s(V, { value: "GET" }, {
|
|
305
|
+
default: r(() => e[14] || (e[14] = [
|
|
306
|
+
b("GET")
|
|
307
307
|
])),
|
|
308
308
|
_: 1
|
|
309
309
|
}),
|
|
310
|
-
|
|
311
|
-
default:
|
|
312
|
-
|
|
310
|
+
s(V, { value: "POST" }, {
|
|
311
|
+
default: r(() => e[15] || (e[15] = [
|
|
312
|
+
b("POST")
|
|
313
313
|
])),
|
|
314
314
|
_: 1
|
|
315
315
|
}),
|
|
316
|
-
|
|
317
|
-
default:
|
|
318
|
-
|
|
316
|
+
s(V, { value: "PUT" }, {
|
|
317
|
+
default: r(() => e[16] || (e[16] = [
|
|
318
|
+
b("PUT")
|
|
319
319
|
])),
|
|
320
320
|
_: 1
|
|
321
321
|
}),
|
|
322
|
-
|
|
323
|
-
default:
|
|
324
|
-
|
|
322
|
+
s(V, { value: "DELETE" }, {
|
|
323
|
+
default: r(() => e[17] || (e[17] = [
|
|
324
|
+
b("DELETE")
|
|
325
325
|
])),
|
|
326
326
|
_: 1
|
|
327
327
|
}),
|
|
328
|
-
|
|
329
|
-
default:
|
|
330
|
-
|
|
328
|
+
s(V, { value: "OPTIONS" }, {
|
|
329
|
+
default: r(() => e[18] || (e[18] = [
|
|
330
|
+
b("OPTIONS")
|
|
331
331
|
])),
|
|
332
332
|
_: 1
|
|
333
333
|
})
|
|
334
334
|
]),
|
|
335
335
|
_: 1
|
|
336
336
|
}, 8, ["value"]),
|
|
337
|
-
|
|
338
|
-
value:
|
|
339
|
-
"onUpdate:value": e[2] || (e[2] = (
|
|
337
|
+
s(T, {
|
|
338
|
+
value: f.value,
|
|
339
|
+
"onUpdate:value": e[2] || (e[2] = (m) => f.value = m),
|
|
340
340
|
placeholder: "路径",
|
|
341
341
|
size: "small"
|
|
342
342
|
}, null, 8, ["value"])
|
|
343
343
|
])
|
|
344
344
|
]),
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
modelValue:
|
|
348
|
-
"onUpdate:modelValue": e[3] || (e[3] = (
|
|
345
|
+
p("div", fe, [
|
|
346
|
+
s(L, {
|
|
347
|
+
modelValue: x.value,
|
|
348
|
+
"onUpdate:modelValue": e[3] || (e[3] = (m) => x.value = m),
|
|
349
349
|
"add-button-text": "添加参数",
|
|
350
350
|
"show-preview": !0,
|
|
351
|
-
"preview-text":
|
|
351
|
+
"preview-text": y.value + f.value + X.value
|
|
352
352
|
}, null, 8, ["modelValue", "preview-text"])
|
|
353
353
|
])
|
|
354
354
|
]),
|
|
355
355
|
_: 1
|
|
356
356
|
}),
|
|
357
|
-
|
|
357
|
+
s(P, {
|
|
358
358
|
title: "认证方案",
|
|
359
359
|
class: "form-section",
|
|
360
360
|
size: "small"
|
|
361
361
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
|
|
364
|
-
value:
|
|
365
|
-
"onUpdate:value": e[4] || (e[4] = (
|
|
362
|
+
default: r(() => [
|
|
363
|
+
s(G, {
|
|
364
|
+
value: l.value,
|
|
365
|
+
"onUpdate:value": e[4] || (e[4] = (m) => l.value = m),
|
|
366
366
|
"button-style": "solid",
|
|
367
367
|
size: "small"
|
|
368
368
|
}, {
|
|
369
|
-
default:
|
|
370
|
-
|
|
371
|
-
default:
|
|
372
|
-
|
|
369
|
+
default: r(() => [
|
|
370
|
+
s(q, { value: "none" }, {
|
|
371
|
+
default: r(() => e[19] || (e[19] = [
|
|
372
|
+
b("无认证")
|
|
373
373
|
])),
|
|
374
374
|
_: 1
|
|
375
375
|
}),
|
|
376
|
-
|
|
377
|
-
default:
|
|
378
|
-
|
|
376
|
+
s(q, { value: "Basic" }, {
|
|
377
|
+
default: r(() => e[20] || (e[20] = [
|
|
378
|
+
b("Basic认证")
|
|
379
379
|
])),
|
|
380
380
|
_: 1
|
|
381
381
|
}),
|
|
382
|
-
|
|
383
|
-
default:
|
|
384
|
-
|
|
382
|
+
s(q, { value: "Bearer" }, {
|
|
383
|
+
default: r(() => e[21] || (e[21] = [
|
|
384
|
+
b("Bearer认证")
|
|
385
385
|
])),
|
|
386
386
|
_: 1
|
|
387
387
|
})
|
|
388
388
|
]),
|
|
389
389
|
_: 1
|
|
390
390
|
}, 8, ["value"]),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
e[22] || (e[22] =
|
|
394
|
-
|
|
395
|
-
value:
|
|
396
|
-
"onUpdate:value": e[5] || (e[5] = (
|
|
391
|
+
l.value === "Basic" ? (_(), $("div", ce, [
|
|
392
|
+
p("div", ye, [
|
|
393
|
+
e[22] || (e[22] = p("p", { class: "m-0 w-16" }, "用户名", -1)),
|
|
394
|
+
s(T, {
|
|
395
|
+
value: u.value,
|
|
396
|
+
"onUpdate:value": e[5] || (e[5] = (m) => u.value = m),
|
|
397
397
|
size: "small"
|
|
398
398
|
}, null, 8, ["value"])
|
|
399
399
|
]),
|
|
400
|
-
|
|
401
|
-
e[23] || (e[23] =
|
|
402
|
-
|
|
403
|
-
value:
|
|
404
|
-
"onUpdate:value": e[6] || (e[6] = (
|
|
400
|
+
p("div", _e, [
|
|
401
|
+
e[23] || (e[23] = p("p", { class: "m-0 w-16" }, "密码", -1)),
|
|
402
|
+
s(te, {
|
|
403
|
+
value: t.value,
|
|
404
|
+
"onUpdate:value": e[6] || (e[6] = (m) => t.value = m),
|
|
405
405
|
size: "small"
|
|
406
406
|
}, null, 8, ["value"])
|
|
407
407
|
])
|
|
408
|
-
])) :
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
e[24] || (e[24] =
|
|
412
|
-
|
|
413
|
-
value:
|
|
414
|
-
"onUpdate:value": e[7] || (e[7] = (
|
|
408
|
+
])) : R("", !0),
|
|
409
|
+
l.value === "Bearer" ? (_(), $("div", be, [
|
|
410
|
+
p("div", xe, [
|
|
411
|
+
e[24] || (e[24] = p("p", { class: "m-0 w-16 h-full" }, "Token", -1)),
|
|
412
|
+
s(I, {
|
|
413
|
+
value: v.value,
|
|
414
|
+
"onUpdate:value": e[7] || (e[7] = (m) => v.value = m),
|
|
415
415
|
size: "small",
|
|
416
416
|
class: "mt-1",
|
|
417
417
|
rows: "4",
|
|
418
418
|
placeholder: "请输入Token"
|
|
419
419
|
}, null, 8, ["value"])
|
|
420
420
|
])
|
|
421
|
-
])) :
|
|
421
|
+
])) : R("", !0)
|
|
422
422
|
]),
|
|
423
423
|
_: 1
|
|
424
424
|
}),
|
|
425
|
-
|
|
425
|
+
s(P, {
|
|
426
426
|
title: "请求头",
|
|
427
427
|
class: "form-section",
|
|
428
428
|
size: "small"
|
|
429
429
|
}, {
|
|
430
|
-
default:
|
|
431
|
-
|
|
432
|
-
modelValue:
|
|
433
|
-
"onUpdate:modelValue": e[8] || (e[8] = (
|
|
430
|
+
default: r(() => [
|
|
431
|
+
s(L, {
|
|
432
|
+
modelValue: j.value,
|
|
433
|
+
"onUpdate:modelValue": e[8] || (e[8] = (m) => j.value = m),
|
|
434
434
|
"add-button-text": "添加请求头",
|
|
435
435
|
"show-preview": !1
|
|
436
436
|
}, null, 8, ["modelValue"])
|
|
437
437
|
]),
|
|
438
438
|
_: 1
|
|
439
439
|
}),
|
|
440
|
-
n.value === "POST" || n.value === "PUT" ? (
|
|
440
|
+
n.value === "POST" || n.value === "PUT" ? (_(), O(P, {
|
|
441
441
|
key: 0,
|
|
442
442
|
title: "请求体",
|
|
443
443
|
class: "form-section",
|
|
444
444
|
size: "small"
|
|
445
445
|
}, {
|
|
446
|
-
default:
|
|
447
|
-
|
|
446
|
+
default: r(() => [
|
|
447
|
+
s(G, {
|
|
448
448
|
value: U.value,
|
|
449
|
-
"onUpdate:value": e[9] || (e[9] = (
|
|
449
|
+
"onUpdate:value": e[9] || (e[9] = (m) => U.value = m),
|
|
450
450
|
"button-style": "solid",
|
|
451
451
|
size: "small",
|
|
452
452
|
class: "mb-1"
|
|
453
453
|
}, {
|
|
454
|
-
default:
|
|
455
|
-
|
|
456
|
-
default:
|
|
457
|
-
|
|
454
|
+
default: r(() => [
|
|
455
|
+
s(q, { value: "application/json" }, {
|
|
456
|
+
default: r(() => e[25] || (e[25] = [
|
|
457
|
+
b("JSON")
|
|
458
458
|
])),
|
|
459
459
|
_: 1
|
|
460
460
|
}),
|
|
461
|
-
|
|
462
|
-
default:
|
|
463
|
-
|
|
461
|
+
s(q, { value: "multipart/form-data" }, {
|
|
462
|
+
default: r(() => e[26] || (e[26] = [
|
|
463
|
+
b("Form Data")
|
|
464
464
|
])),
|
|
465
465
|
_: 1
|
|
466
466
|
}),
|
|
467
|
-
|
|
468
|
-
default:
|
|
469
|
-
|
|
467
|
+
s(q, { value: "text/plain" }, {
|
|
468
|
+
default: r(() => e[27] || (e[27] = [
|
|
469
|
+
b("Raw")
|
|
470
470
|
])),
|
|
471
471
|
_: 1
|
|
472
472
|
})
|
|
473
473
|
]),
|
|
474
474
|
_: 1
|
|
475
475
|
}, 8, ["value"]),
|
|
476
|
-
U.value === "application/json" ? (
|
|
477
|
-
|
|
476
|
+
U.value === "application/json" ? (_(), $(F, { key: 0 }, [
|
|
477
|
+
s(I, {
|
|
478
478
|
value: k.value,
|
|
479
|
-
"onUpdate:value": e[10] || (e[10] = (
|
|
479
|
+
"onUpdate:value": e[10] || (e[10] = (m) => k.value = m),
|
|
480
480
|
rows: 6,
|
|
481
481
|
placeholder: "请输入 JSON 数据",
|
|
482
|
-
onInput:
|
|
482
|
+
onInput: Y
|
|
483
483
|
}, null, 8, ["value"]),
|
|
484
|
-
|
|
484
|
+
h.value ? (_(), O(ae, {
|
|
485
485
|
key: 0,
|
|
486
486
|
type: "error",
|
|
487
|
-
message:
|
|
487
|
+
message: h.value,
|
|
488
488
|
banner: "",
|
|
489
489
|
style: { "margin-bottom": "8px" }
|
|
490
|
-
}, null, 8, ["message"])) :
|
|
491
|
-
], 64)) :
|
|
492
|
-
U.value === "multipart/form-data" ? (
|
|
490
|
+
}, null, 8, ["message"])) : R("", !0)
|
|
491
|
+
], 64)) : R("", !0),
|
|
492
|
+
U.value === "multipart/form-data" ? (_(), O(L, {
|
|
493
493
|
key: 1,
|
|
494
|
-
modelValue:
|
|
495
|
-
"onUpdate:modelValue": e[11] || (e[11] = (
|
|
494
|
+
modelValue: B.value,
|
|
495
|
+
"onUpdate:modelValue": e[11] || (e[11] = (m) => B.value = m),
|
|
496
496
|
"add-button-text": "添加表单字段",
|
|
497
497
|
"show-preview": !1
|
|
498
|
-
}, null, 8, ["modelValue"])) :
|
|
499
|
-
U.value === "text/plain" ? (
|
|
498
|
+
}, null, 8, ["modelValue"])) : R("", !0),
|
|
499
|
+
U.value === "text/plain" ? (_(), O(I, {
|
|
500
500
|
key: 2,
|
|
501
501
|
value: S.value,
|
|
502
|
-
"onUpdate:value": e[12] || (e[12] = (
|
|
502
|
+
"onUpdate:value": e[12] || (e[12] = (m) => S.value = m),
|
|
503
503
|
rows: 6,
|
|
504
504
|
placeholder: "请输入原始数据"
|
|
505
|
-
}, null, 8, ["value"])) :
|
|
506
|
-
|
|
505
|
+
}, null, 8, ["value"])) : R("", !0),
|
|
506
|
+
p("pre", null, z(Q.value), 1)
|
|
507
507
|
]),
|
|
508
508
|
_: 1
|
|
509
|
-
})) :
|
|
509
|
+
})) : R("", !0)
|
|
510
510
|
]),
|
|
511
511
|
_: 1
|
|
512
512
|
})
|
|
513
513
|
]);
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
|
-
}),
|
|
517
|
-
async function
|
|
518
|
-
return
|
|
516
|
+
}), Ee = /* @__PURE__ */ M(we, [["__scopeId", "data-v-c9f65487"]]);
|
|
517
|
+
async function ge(a, g = "xhr") {
|
|
518
|
+
return g === "fetch" ? ke(a) : he(a);
|
|
519
519
|
}
|
|
520
|
-
async function
|
|
521
|
-
var
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
520
|
+
async function ke(a) {
|
|
521
|
+
var y;
|
|
522
|
+
const g = a.params.filter((l) => !!l.key).map((l) => `${l.key}=${encodeURIComponent(l.value)}`).join("&"), d = `${a.url}${a.path}${g ? "?" + g : ""}`, o = new Headers();
|
|
523
|
+
a.headers.forEach((l) => {
|
|
524
|
+
l.key && o.append(l.key, l.value);
|
|
525
525
|
});
|
|
526
526
|
const n = {
|
|
527
|
-
method:
|
|
528
|
-
headers:
|
|
527
|
+
method: a.method,
|
|
528
|
+
headers: o,
|
|
529
529
|
credentials: "omit"
|
|
530
530
|
};
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
} else
|
|
535
|
-
if (
|
|
536
|
-
switch (
|
|
531
|
+
if (a.auth.type === "Basic" && a.auth.username && a.auth.password) {
|
|
532
|
+
const l = btoa(`${a.auth.username}:${a.auth.password}`);
|
|
533
|
+
o.append("Authorization", `Basic ${l}`);
|
|
534
|
+
} else a.auth.type === "Bearer" && a.auth.token && o.append("Authorization", `Bearer ${a.auth.token}`);
|
|
535
|
+
if (a.method === "POST" || a.method === "PUT")
|
|
536
|
+
switch (a.body.type) {
|
|
537
537
|
case "application/json":
|
|
538
|
-
n.body =
|
|
538
|
+
n.body = a.body.json || "", o.set("Content-Type", "application/json; charset=utf-8");
|
|
539
539
|
break;
|
|
540
540
|
case "multipart/form-data":
|
|
541
|
-
const
|
|
542
|
-
(
|
|
543
|
-
|
|
544
|
-
}), n.body =
|
|
541
|
+
const l = new FormData();
|
|
542
|
+
(y = a.body.formData) == null || y.forEach((f) => {
|
|
543
|
+
f.key && l.append(f.key, f.value);
|
|
544
|
+
}), n.body = l;
|
|
545
545
|
break;
|
|
546
546
|
case "text/plain":
|
|
547
|
-
n.body =
|
|
547
|
+
n.body = a.body.raw || "", o.set("Content-Type", "text/plain; charset=utf-8");
|
|
548
548
|
break;
|
|
549
549
|
}
|
|
550
550
|
try {
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
551
|
+
const l = await fetch(d, n), f = {};
|
|
552
|
+
l.headers.forEach((v, x) => {
|
|
553
|
+
f[x.toLowerCase()] = v;
|
|
554
554
|
});
|
|
555
|
-
let
|
|
556
|
-
if ((
|
|
555
|
+
let u = "";
|
|
556
|
+
if ((f["content-type"] || "").startsWith("application/json"))
|
|
557
557
|
try {
|
|
558
|
-
const
|
|
559
|
-
|
|
558
|
+
const v = await l.json();
|
|
559
|
+
u = JSON.stringify(v, null, 2);
|
|
560
560
|
} catch {
|
|
561
|
-
|
|
561
|
+
u = await l.text();
|
|
562
562
|
}
|
|
563
563
|
else
|
|
564
|
-
|
|
564
|
+
u = await l.text();
|
|
565
565
|
return {
|
|
566
|
-
status:
|
|
567
|
-
headers:
|
|
568
|
-
body:
|
|
566
|
+
status: l.status.toString(),
|
|
567
|
+
headers: f,
|
|
568
|
+
body: u
|
|
569
569
|
};
|
|
570
570
|
} catch {
|
|
571
571
|
throw new Error("Request failed");
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
async function he(
|
|
575
|
-
return new Promise((
|
|
576
|
-
var
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
579
|
-
|
|
580
|
-
}),
|
|
581
|
-
let
|
|
582
|
-
switch (
|
|
574
|
+
async function he(a) {
|
|
575
|
+
return new Promise((g, d) => {
|
|
576
|
+
var u;
|
|
577
|
+
const o = new XMLHttpRequest(), n = a.auth.type === "Basic" ? a.auth.username : null, y = a.auth.type === "Basic" ? a.auth.password : null, l = a.params.filter((t) => !!t.key).map((t) => `${t.key}=${encodeURIComponent(t.value)}`).join("&"), f = `${a.url}${a.path}${l ? "?" + l : ""}`;
|
|
578
|
+
if (o.open(a.method, f, !0, n, y), a.headers.forEach((t) => {
|
|
579
|
+
t.key && o.setRequestHeader(t.key, t.value);
|
|
580
|
+
}), a.auth.type === "Bearer" && a.auth.token && o.setRequestHeader("Authorization", `Bearer ${a.auth.token}`), a.method === "POST" || a.method === "PUT") {
|
|
581
|
+
let t = "";
|
|
582
|
+
switch (a.body.type) {
|
|
583
583
|
case "application/json":
|
|
584
|
-
|
|
584
|
+
t = a.body.json || "", o.setRequestHeader("Content-Type", "application/json; charset=utf-8");
|
|
585
585
|
break;
|
|
586
586
|
case "multipart/form-data":
|
|
587
|
-
const
|
|
588
|
-
(
|
|
589
|
-
|
|
590
|
-
}),
|
|
587
|
+
const v = new FormData();
|
|
588
|
+
(u = a.body.formData) == null || u.forEach((x) => {
|
|
589
|
+
x.key && v.append(x.key, x.value);
|
|
590
|
+
}), t = v;
|
|
591
591
|
break;
|
|
592
592
|
case "text/plain":
|
|
593
|
-
|
|
593
|
+
t = a.body.raw || "", o.setRequestHeader("Content-Type", "text/plain; charset=utf-8");
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
|
-
|
|
596
|
+
o.send(t);
|
|
597
597
|
} else
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
status:
|
|
602
|
-
headers:
|
|
598
|
+
o.send();
|
|
599
|
+
o.onload = () => {
|
|
600
|
+
const t = Ue(o), v = {
|
|
601
|
+
status: o.status.toString(),
|
|
602
|
+
headers: t,
|
|
603
603
|
body: ""
|
|
604
604
|
};
|
|
605
|
-
if ((
|
|
605
|
+
if ((t["content-type"] || "").startsWith("application/json"))
|
|
606
606
|
try {
|
|
607
|
-
|
|
607
|
+
v.body = JSON.stringify(JSON.parse(o.responseText), null, 2);
|
|
608
608
|
} catch {
|
|
609
|
-
|
|
609
|
+
v.body = o.responseText;
|
|
610
610
|
}
|
|
611
611
|
else
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
|
|
612
|
+
v.body = o.responseText;
|
|
613
|
+
g(v);
|
|
614
|
+
}, o.onerror = () => {
|
|
615
|
+
d(new Error("Request failed"));
|
|
616
616
|
};
|
|
617
617
|
});
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
const
|
|
621
|
-
return
|
|
622
|
-
var
|
|
623
|
-
const n =
|
|
624
|
-
|
|
625
|
-
}),
|
|
619
|
+
function Ue(a) {
|
|
620
|
+
const g = a.getAllResponseHeaders().trim().split(/[\r\n]+/), d = {};
|
|
621
|
+
return g.forEach(function(o) {
|
|
622
|
+
var f;
|
|
623
|
+
const n = o.split(": "), y = ((f = n.shift()) == null ? void 0 : f.toLowerCase()) || "", l = n.join(": ");
|
|
624
|
+
d[y] = l;
|
|
625
|
+
}), d;
|
|
626
626
|
}
|
|
627
|
+
const Te = { style: { display: "flex", "align-items": "center", gap: "8px", "margin-bottom": "8px" } }, $e = { class: "flex flex-col gap-2" }, Se = { class: "flex flex-col gap-1" }, Re = {
|
|
628
|
+
key: 0,
|
|
629
|
+
class: "border border-solid border-gray-300 w-full"
|
|
630
|
+
}, je = { class: "border border-gray-300" }, Be = { class: "border border-gray-300" }, Oe = { key: 1 }, Ve = /* @__PURE__ */ H({
|
|
631
|
+
__name: "ResponseSection",
|
|
632
|
+
props: {
|
|
633
|
+
modelValue: {}
|
|
634
|
+
},
|
|
635
|
+
setup(a) {
|
|
636
|
+
const g = a, d = w("xhr"), o = w({
|
|
637
|
+
status: "",
|
|
638
|
+
headers: {},
|
|
639
|
+
body: "",
|
|
640
|
+
timing: 0
|
|
641
|
+
}), n = w(""), y = (u) => {
|
|
642
|
+
const t = Number(u);
|
|
643
|
+
return t >= 200 && t < 300 ? "success" : t >= 300 && t < 400 ? "warning" : t >= 400 && t < 500 || t >= 500 ? "error" : "default";
|
|
644
|
+
}, l = (u) => u instanceof Error ? u.message : "请求失败", f = async () => {
|
|
645
|
+
n.value = "";
|
|
646
|
+
const u = Date.now();
|
|
647
|
+
try {
|
|
648
|
+
o.value = await ge(g.modelValue, d.value), o.value.timing = Date.now() - u;
|
|
649
|
+
} catch (t) {
|
|
650
|
+
n.value = l(t), o.value = {
|
|
651
|
+
status: "Error",
|
|
652
|
+
headers: {},
|
|
653
|
+
body: t instanceof Error ? t.message : "Request failed",
|
|
654
|
+
timing: Date.now() - u
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
return (u, t) => {
|
|
659
|
+
const v = c("a-radio-button"), x = c("a-radio-group"), j = c("a-button"), B = c("a-alert"), U = c("a-tag"), k = c("a-textarea"), S = c("a-card");
|
|
660
|
+
return _(), O(S, {
|
|
661
|
+
title: "响应",
|
|
662
|
+
class: "form-section",
|
|
663
|
+
size: "small"
|
|
664
|
+
}, {
|
|
665
|
+
default: r(() => [
|
|
666
|
+
p("div", Te, [
|
|
667
|
+
s(x, {
|
|
668
|
+
value: d.value,
|
|
669
|
+
"onUpdate:value": t[0] || (t[0] = (h) => d.value = h),
|
|
670
|
+
"button-style": "solid",
|
|
671
|
+
size: "small"
|
|
672
|
+
}, {
|
|
673
|
+
default: r(() => [
|
|
674
|
+
s(v, { value: "xhr" }, {
|
|
675
|
+
default: r(() => t[2] || (t[2] = [
|
|
676
|
+
b("XMLHttpRequest")
|
|
677
|
+
])),
|
|
678
|
+
_: 1
|
|
679
|
+
}),
|
|
680
|
+
s(v, { value: "fetch" }, {
|
|
681
|
+
default: r(() => t[3] || (t[3] = [
|
|
682
|
+
b("Fetch")
|
|
683
|
+
])),
|
|
684
|
+
_: 1
|
|
685
|
+
})
|
|
686
|
+
]),
|
|
687
|
+
_: 1
|
|
688
|
+
}, 8, ["value"]),
|
|
689
|
+
s(j, {
|
|
690
|
+
type: "primary",
|
|
691
|
+
onClick: f,
|
|
692
|
+
size: "small"
|
|
693
|
+
}, {
|
|
694
|
+
default: r(() => t[4] || (t[4] = [
|
|
695
|
+
b("发送")
|
|
696
|
+
])),
|
|
697
|
+
_: 1
|
|
698
|
+
})
|
|
699
|
+
]),
|
|
700
|
+
n.value ? (_(), O(B, {
|
|
701
|
+
key: 0,
|
|
702
|
+
message: n.value,
|
|
703
|
+
type: "error",
|
|
704
|
+
"show-icon": "",
|
|
705
|
+
style: { "margin-bottom": "8px" }
|
|
706
|
+
}, null, 8, ["message"])) : R("", !0),
|
|
707
|
+
p("div", $e, [
|
|
708
|
+
t[7] || (t[7] = p("div", { class: "text-sm font-bold" }, "基本信息", -1)),
|
|
709
|
+
p("div", Se, [
|
|
710
|
+
p("div", null, [
|
|
711
|
+
t[5] || (t[5] = p("span", null, "状态码:", -1)),
|
|
712
|
+
s(U, {
|
|
713
|
+
color: y(o.value.status)
|
|
714
|
+
}, {
|
|
715
|
+
default: r(() => [
|
|
716
|
+
b(z(o.value.status), 1)
|
|
717
|
+
]),
|
|
718
|
+
_: 1
|
|
719
|
+
}, 8, ["color"])
|
|
720
|
+
]),
|
|
721
|
+
p("div", null, [
|
|
722
|
+
t[6] || (t[6] = p("span", null, "耗时:", -1)),
|
|
723
|
+
p("span", null, z(o.value.timing ? `${o.value.timing}ms` : "-"), 1)
|
|
724
|
+
])
|
|
725
|
+
]),
|
|
726
|
+
t[8] || (t[8] = p("div", { class: "text-sm font-bold" }, "响应头", -1)),
|
|
727
|
+
Object.keys(o.value.headers).length > 0 ? (_(), $("table", Re, [
|
|
728
|
+
p("tbody", null, [
|
|
729
|
+
(_(!0), $(F, null, K(Object.entries(o.value.headers), ([h, N]) => (_(), $("tr", { key: h }, [
|
|
730
|
+
p("td", je, z(h), 1),
|
|
731
|
+
p("td", Be, z(N), 1)
|
|
732
|
+
]))), 128))
|
|
733
|
+
])
|
|
734
|
+
])) : (_(), $("p", Oe, "无响应头")),
|
|
735
|
+
t[9] || (t[9] = p("div", { class: "text-sm font-bold" }, "响应体", -1)),
|
|
736
|
+
s(k, {
|
|
737
|
+
value: o.value.body,
|
|
738
|
+
"onUpdate:value": t[1] || (t[1] = (h) => o.value.body = h),
|
|
739
|
+
rows: 5,
|
|
740
|
+
readonly: "",
|
|
741
|
+
style: { width: "100%" },
|
|
742
|
+
size: "small"
|
|
743
|
+
}, null, 8, ["value"])
|
|
744
|
+
])
|
|
745
|
+
]),
|
|
746
|
+
_: 1
|
|
747
|
+
});
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
}), qe = /* @__PURE__ */ M(Ve, [["__scopeId", "data-v-1dd2b288"]]);
|
|
627
751
|
export {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
752
|
+
L as KeyValueInput,
|
|
753
|
+
Ee as RequestForm,
|
|
754
|
+
qe as ResponseSection,
|
|
755
|
+
Ee as default,
|
|
631
756
|
de as defaultRequestSchema,
|
|
632
|
-
|
|
757
|
+
ge as executeRequest
|
|
633
758
|
};
|