后台:上传资源
This commit is contained in:
@@ -72,4 +72,18 @@ export default class Utils extends Service {
|
||||
log.error(`${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async transmit(env: string, route: string, stream: any) {
|
||||
const { ctx } = this;
|
||||
console.log('****transmit', stream);
|
||||
const result = await ctx.curl(`http://127.0.0.1:7002${route}`, {
|
||||
method: 'POST',
|
||||
files: stream,
|
||||
|
||||
headers: {
|
||||
token: ctx.request.headers.token
|
||||
}
|
||||
});
|
||||
console.log(env, result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user