Commit a1e28642 by Sxy

fix: 回传材料 打包路径

parent 75e599f4
......@@ -102,8 +102,16 @@ class OSSClient {
*/
async getFile(url) {
let me = this;
let str = 'aliyuncs.com//';
let key = url.substring(url.lastIndexOf(str) + str.length, url.length);
let key;
if (url.includes('aliyuncs.com//')) {
let str = 'aliyuncs.com//';
key = url.substring(url.lastIndexOf(str) + str.length, url.length);
} else if (url.includes('aliyuncs.com/')) {
let str = 'aliyuncs.com/';
key = url.substring(url.lastIndexOf(str) + str.length, url.length);
} else {
throw new Error(`文件路径错误${url}`)
}
const content = await co(function* () {
var result = yield me.client.get(key);
return result.content;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment