fix(dianziqian): 处理url (#1531)
Co-authored-by: sealday <zhanglin@daoyoucloud.com> Co-authored-by: TomyJan <tomyjan6@gmail.com> Reviewed-on: daoyoucloud/tachybase#1531 Co-authored-by: wanggang <1366376228@qq.com> Co-committed-by: wanggang <1366376228@qq.com>
This commit is contained in:
parent
0aca5ef9a3
commit
db69917a6e
@ -97,11 +97,6 @@ async function request(config, context) {
|
||||
if (key === 'file') {
|
||||
let { url: resourceUrl, params: resourceParams, headers: resourceHeader, body: resourceBody } = data[key];
|
||||
resourceUrl = resourceUrl?.trim() || '';
|
||||
if (!resourceUrl.startsWith('http')) {
|
||||
//如果开头不是http默认该url是内部url,需要加上token
|
||||
resourceUrl = `${origin}${resourceUrl}`;
|
||||
resourceHeader.Authorization = 'Bearer ' + token
|
||||
}
|
||||
|
||||
if (resourceHeader['Content-Type'] === 'multipart/form-data' && resourceBody) {
|
||||
//resource contentType类型
|
||||
|
Loading…
Reference in New Issue
Block a user