Parcourir la source

解决跨域问题

zaijin il y a 3 ans
Parent
commit
bfb037c76c

+ 5 - 1
common/config.js

@@ -1,4 +1,8 @@
+let baseUrl = 'http://wx.hw.hongweisoft.com/parking/'
+if (process.env.NODE_ENV === 'development') {
+	baseUrl = '/api'
+}
 export const config = {
-	baseUrl: 'https://wx.hw.hongweisoft.com/parking/',
+	baseUrl,
 	version: '0.1.5'
 }

+ 1 - 1
pages/patrolManagement/deviceAbnormalRecords/deviceAbnormalRecords.vue

@@ -41,7 +41,7 @@
 			getRecordList() {
 				uni.$u.api.deviceAbnormalApi.getDeviceAbnormalListApi({
 					pageNum: this.page,
-					pageSize: 10
+					pageSize: 15
 				}).then(res => {
 					if (res.code === 200) {
 						this.recordList = this.recordList.concat(res.data.rows)

+ 1 - 1
vue.config.js

@@ -4,7 +4,7 @@ module.exports = {
 		disableHostCheck:true,
 		proxy:{
 			'/api':{
-				target: 'http://parking.hw.hongweisoft.com/pudprod-api/',
+				target: 'http://wx.hw.hongweisoft.com/parking/',
 				changeOrigin: true,
 				pathRewrite:{
 					'^/api': ''