更新路径拼接

This commit is contained in:
mojin 2023-03-02 16:58:58 +08:00
parent 0c5891e44c
commit a5938ea653
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@
from requests import Session from requests import Session
import requests import requests
from urllib.parse import urljoin
from common.logger import Logger from common.logger import Logger
from common.exchange_data import ExchangeData from common.exchange_data import ExchangeData
import allure,json,re import allure,json,re
@ -99,7 +100,8 @@ class Api_Request():
pattern = re.compile(r'^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+') pattern = re.compile(r'^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+')
if (pattern.search(path)) == None: # 判断读取的地址是否有前缀地址http://192.168.1.153:8562 if (pattern.search(path)) == None: # 判断读取的地址是否有前缀地址http://192.168.1.153:8562
urls ="%s/%s"%(url,path) # 无前缀读取配置文件添加前缀 #urls ="%s/%s"%(url,path) # 无前缀读取配置文件添加前缀
urls =urljoin(url, path)
else: else:
urls = path # 有前缀使用读取的完整地址 urls = path # 有前缀使用读取的完整地址