Skip to content

Commit cd15ce4

Browse files
committed
feat: 格式化请求格式
1 parent 6e6ea62 commit cd15ce4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/context/request/request-context.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,16 @@ class RequestContext {
137137
msgs.push(`${indentSpace}hostname: ${this.hostname}`);
138138
msgs.push(`${indentSpace}path: ${this.path}`);
139139

140-
msgs.push(`${indentSpace}params: `);
140+
let paramTitle = `${indentSpace}params(${this.params.length}): `;
141+
if (!this.params.length) {
142+
paramTitle += " do not have param.";
143+
}
144+
msgs.push(paramTitle);
141145
for (let param of this.params) {
142146
msgs.push(param.toHumanReadable(indent + 4));
143147
}
144148

149+
145150
if (this.hash) {
146151
msgs.push(`${indentSpace}hash: ${this.hash}`)
147152
}

0 commit comments

Comments
 (0)