Skip to content

Commit 8bd31b8

Browse files
committed
fix get
1 parent 59f2421 commit 8bd31b8

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Diff for: src/api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function queryWithBody(method: string) {
101101
});
102102
}
103103

104+
export const get = queryWithoutBody('GET');
104105
export const post = queryWithBody('POST');
105106
export const put = queryWithBody('PUT');
106107
export const doDelete = queryWithBody('DELETE');

Diff for: src/versions.js

+15-9
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ export const commands = {
112112
await this.update({ args: [], options: { versionId: id, platform } });
113113
}
114114
},
115-
versions: async function ({ options }) {
115+
versions: async ({ options }) => {
116116
const platform = checkPlatform(
117117
options.platform || (await question('平台(ios/android/harmony):')),
118118
);
119119
const { appId } = await getSelectedApp(platform);
120120
await listVersions(appId);
121121
},
122-
update: async function ({ args, options }) {
122+
update: async ({ args, options }) => {
123123
const platform = checkPlatform(
124124
options.platform || (await question('平台(ios/android/harmony):')),
125125
);
@@ -138,7 +138,7 @@ export const commands = {
138138
rollout = null;
139139
} else {
140140
try {
141-
rollout = parseInt(rollout);
141+
rollout = Number.parseInt(rollout);
142142
} catch (e) {
143143
throw new Error('rollout 必须是 1-100 的整数');
144144
}
@@ -173,7 +173,9 @@ export const commands = {
173173
await put(`/app/${appId}/package/${pkg.id}`, {
174174
versionId,
175175
});
176-
console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`);
176+
console.log(
177+
`已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`,
178+
);
177179
}
178180
console.log(`操作完成,共已绑定 ${pkgs.length} 个原生版本`);
179181
return;
@@ -205,7 +207,9 @@ export const commands = {
205207
await put(`/app/${appId}/package/${pkg.id}`, {
206208
versionId,
207209
});
208-
console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`);
210+
console.log(
211+
`已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`,
212+
);
209213
}
210214
console.log(`操作完成,共已绑定 ${pkgs.length} 个原生版本`);
211215
return;
@@ -228,14 +232,14 @@ export const commands = {
228232
if (!pkgId) {
229233
throw new Error('请提供 packageId 或 packageVersion 参数');
230234
}
231-
235+
232236
if (!pkgVersion) {
233237
const pkg = data.find((d) => d.id === pkgId);
234238
if (pkg) {
235239
pkgVersion = pkg.name;
236240
}
237241
}
238-
242+
239243
if (rollout) {
240244
await put(`/app/${appId}/version/${versionId}`, {
241245
config: {
@@ -251,9 +255,11 @@ export const commands = {
251255
await put(`/app/${appId}/package/${pkgId}`, {
252256
versionId,
253257
});
254-
console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkgVersion} (id: ${pkgId})`);
258+
console.log(
259+
`已将热更版本 ${versionId} 绑定到原生版本 ${pkgVersion} (id: ${pkgId})`,
260+
);
255261
},
256-
updateVersionInfo: async function ({ args, options }) {
262+
updateVersionInfo: async ({ args, options }) => {
257263
const platform = checkPlatform(
258264
options.platform || (await question('平台(ios/android/harmony):')),
259265
);

0 commit comments

Comments
 (0)