feat: 服务地址动态获取
This commit is contained in:
@@ -16,7 +16,7 @@ function request(url, args = {}, method = "POST", customConfig = {}) {
|
||||
const appStore = useAppStore();
|
||||
// 判断 url 是否以 http 开头
|
||||
if (!/^http/.test(url)) {
|
||||
url = appStore.serverConfig.baseUrl + url;
|
||||
url = appStore.serverConfig?.baseUrl + url;
|
||||
}
|
||||
// 动态获取 token
|
||||
const token = uni.getStorageSync("token");
|
||||
|
||||
Reference in New Issue
Block a user