兼容 node 12
This commit is contained in:
@@ -45,7 +45,14 @@ async function getRedirectUrl(url) {
|
||||
reject(err);
|
||||
}
|
||||
// console.log(res.headers.location);
|
||||
resolve(res?.headers?.location);
|
||||
|
||||
// 兼容 node 12
|
||||
// resolve(res?.headers?.location);
|
||||
if (res && res.headers) {
|
||||
resolve(res.headers.location);
|
||||
} else {
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user