q-koa 8.5.3 → 8.5.4
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.
|
@@ -182,23 +182,25 @@ exports.qr_code = async ({
|
|
|
182
182
|
return null
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
185
|
+
|
|
186
|
+
return client
|
|
187
|
+
.put(fileName, buffer)
|
|
188
|
+
|
|
189
|
+
.then((result) => {
|
|
190
|
+
if (result && result.res && result.res.status === 200) {
|
|
191
|
+
if (oss_host && cdn_host) {
|
|
192
|
+
const url = result.url.replace(oss_host, cdn_host)
|
|
193
|
+
return Promise.resolve(url)
|
|
194
|
+
} else {
|
|
195
|
+
return Promise.resolve(result.url)
|
|
196
|
+
}
|
|
197
|
+
} else {
|
|
198
|
+
return Promise.reject(new Error('小程序码生成错误,请重试'))
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
.catch((e) => {
|
|
202
|
+
return Promise.reject(new Error(e.message))
|
|
203
|
+
})
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
|