Explorar o código

新增测试环境
根据测试环境筛选是否显示现金道具

lyb %!s(int64=4) %!d(string=hai) anos
pai
achega
cfb9696e0b
Modificáronse 2 ficheiros con 17 adicións e 3 borrados
  1. 3 2
      assets/http/config.js
  2. 14 1
      components/alert/votePopup.vue

+ 3 - 2
assets/http/config.js

@@ -1,8 +1,9 @@
 let config = {}
 
-// config.baseURL = 'http://192.168.1.91:2888'
+// config.baseURL = 'http://192.168.1.35:2888' //本地
 // config.baseURL = 'http://123.60.225.130:2888'
-config.baseURL = 'https://vote.guosen-fumao.cn/api'
+// config.baseURL = 'http://vote-back.guosen-fumao.cn/api' //测试服务器
+config.baseURL = 'https://vote.guosen-fumao.cn/api' //正式服务器
 //是否需要获取手机号
 config.isAuthPhone = true
 config.transformDomains = 'https://m.changyoyo.com'

+ 14 - 1
components/alert/votePopup.vue

@@ -50,6 +50,7 @@
 
 <script>
 	import pointAuth from '../../components/alert/pointAuth.vue'
+	import config from "@/assets/http/config.js"
 	export default {
 		name: "votePopup",
 		components: {
@@ -155,7 +156,19 @@
 					userId: this.vuex_userId,
 				}
 				const res = await this.$api.activity.getGiftList(data);
-				this.gitfs = res.data.data;
+				console.log("config.baseURL",config.baseURL)
+				if(config.baseURL === 'http://vote-back.guosen-fumao.cn/api'){
+					this.gitfs = [];
+					//测试环境,过滤掉现金道具
+					for(let i = 0; i < res.data.data.length; i++){
+						if(res.data.data[i].payType === 'POINT_EXCHANGE_GOODS'){
+							this.gitfs.push(res.data.data[i])
+						}
+					}
+				}else{
+					//正式环境,返回所有道具(包括现金道具)
+					this.gitfs = res.data.data;
+				}
 			},
 			hideVote() {
 				this.show = false;