|
@@ -140,6 +140,7 @@ class FilesController extends Controller {
|
|
|
}
|
|
|
|
|
|
async serverUpload() {
|
|
|
+ console.log('in function:');
|
|
|
const { ctx, app } = this;
|
|
|
const body = ctx.request.body;
|
|
|
const { name, uri, extension, code } = body;
|
|
@@ -178,7 +179,10 @@ class FilesController extends Controller {
|
|
|
throw error;
|
|
|
}
|
|
|
|
|
|
- const returnUri = `${filePath}/${fileName}`;
|
|
|
+ let returnUri = `${filePath}/${fileName}`;
|
|
|
+ while (returnUri.indexOf('//')) {
|
|
|
+ returnUri = returnUri.replace('//', '/');
|
|
|
+ }
|
|
|
this.ctx.body = this.getSuccessReturn({ uri: returnUri, id: fileName });
|
|
|
}
|
|
|
|