cmy 3 hónapja
szülő
commit
482c5a8dc5
4 módosított fájl, 39 hozzáadás és 3 törlés
  1. 2 0
      App.vue
  2. 2 2
      manifest.json
  3. 7 1
      store/index.js
  4. 28 0
      utils/httparr.js

+ 2 - 0
App.vue

@@ -8,6 +8,7 @@
 	// #endif
 	// #ifdef APP-PLUS
 	import { getUpApp } from "./utils/upApp.js";
+	import httpList from "./utils/httparr.js";
 	// #endif
 	export default {
 		data() {
@@ -63,6 +64,7 @@
 			}
 			// #endif
 			// #ifdef APP-PLUS
+			httpList();
 			// 判断是否升级
 			getUpApp();
 			// 获取当前运行系统

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "STAR",
     "appid" : "__UNI__0A11003",
     "description" : "",
-    "versionName" : "1.2.2",
-    "versionCode" : 122,
+    "versionName" : "1.2.4",
+    "versionCode" : 124,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */

+ 7 - 1
store/index.js

@@ -10,7 +10,7 @@ const store = new Vuex.Store({
 		baseURL:window.location.protocol + "//" + window.location.host,//请求地址配置 
 		// #endif
 		// #ifndef H5
-		baseURL: 'https://xk.oliug.cn', //正式地址配置
+		baseURL: 'https://xinkong.vwetdd.cn', //正式地址配置
 		// #endif
 		urlFile: '/index', //项目部署所在文件夹
 		loginInterceptor: false, //是否打开强制登录
@@ -40,6 +40,12 @@ const store = new Vuex.Store({
 
 	},
 	mutations: {
+		// #ifdef APP
+		// 设置http
+		setHttp(state, provider){
+			state.baseURL = provider
+		},
+		// #endif
 		//保存微信信息
 		setWeiChatInfo(state, provider) {
 			state.weichatInfo = provider;

+ 28 - 0
utils/httparr.js

@@ -0,0 +1,28 @@
+import store from '../store'
+let  list  = [
+	"https://judg.oliug.cn",
+	"https://ftcfg.oliug.cn",
+	"https://dfrdc.oliug.cn",
+	"https://djk.vwetdd.cn",
+	"https://xk.vwetdd.cn",
+	"https://xinkong.vwetdd.cn ",
+];
+let httpIndex = uni.getStorageSync("httpIndex") || 0;
+export default function getIndexHttp () {
+	console.log(httpIndex,'httpIndex')
+	const http = list[httpIndex];
+	uni.request({
+		url:http +"/api/index",
+		success() {
+			console.log(http,'http')
+			store.commit('setHttp',http);
+			uni.setStorageSync("httpIndex",httpIndex);
+		},
+		fail() {
+			console.log(res,'失败')
+			httpIndex++;
+			getIndexHttp();
+		}
+	})
+	
+}