feat: 更新正式环境API地址并默认选用
This commit is contained in:
+6
-6
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||
*/
|
||||
import config, { getTestApiUrl } from '@/common/config.js';
|
||||
import config, { getDefaultApiUrl } from '@/common/config.js';
|
||||
import util from '@/common/util.js';
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
@@ -19,15 +19,15 @@ try{
|
||||
|
||||
}
|
||||
|
||||
// 初始化API URL
|
||||
// 初始化API URL(默认正式环境)
|
||||
function initApiUrl() {
|
||||
const testUrl = getTestApiUrl();
|
||||
const defaultUrl = getDefaultApiUrl();
|
||||
try {
|
||||
uni.setStorageSync('ApiUrl', testUrl);
|
||||
uni.setStorageSync('ApiUrl', defaultUrl);
|
||||
} catch (e) {
|
||||
console.log('写入测试环境地址失败', e);
|
||||
console.log('写入正式环境地址失败', e);
|
||||
}
|
||||
return testUrl;
|
||||
return defaultUrl;
|
||||
}
|
||||
|
||||
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
|
||||
|
||||
Reference in New Issue
Block a user