Skip to content

Commit 7d9e973

Browse files
authored
增加配置判断 (#311)
新增配置项判断,避免出现undefined导致的无效url
1 parent 4d74a2c commit 7d9e973

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils/request/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const transform: AxiosTransform = {
5757
const { apiUrl, isJoinPrefix, urlPrefix, joinParamsToUrl, formatDate, joinTime = true } = options;
5858

5959
// 添加接口前缀
60-
if (isJoinPrefix) {
60+
if (isJoinPrefix && urlPrefix && isString(urlPrefix)) {
6161
config.url = `${urlPrefix}${config.url}`;
6262
}
6363

0 commit comments

Comments
 (0)