Explorar el Código

【进度】完成,并成功部署到服务器

程志平 hace 4 años
padre
commit
56c048929f

+ 7 - 5
config/index.js

@@ -8,15 +8,15 @@ module.exports = {
 	dev: {
 		// Paths
 		assetsSubDirectory: 'static',
-		assetsPublicPath: '/',
+		assetsPublicPath: '/jxch-smartmp/',
 		// 后端请求地址代理,配置后testIp再之后的页面调用时就直接指代 http://197.82.15.15:8088
 		proxyTable: {
-			'/api': {
-				target: 'https://jtishfw.ncjti.edu.cn/jxch-smartmp', // 你请求的第三方接口
+			'/jxch-smartmp-api': {
+				target: 'https://jtishfw.ncjti.edu.cn/jxch-smartmp/', // 你请求的第三方接口
 				// target: 'http://baibai.natapp1.cc', // 你请求的第三方接口
 				changeOrigin: true, // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
 				pathRewrite: { // 路径重写,
-					'^/api/': '' // 替换target中的请求地址,也就是说以后你在请求http://api.douban.com/v2/XXXXX这个地址的时候直接写成/api即可。
+					'^/jxch-smartmp-api': '/' // 替换target中的请求地址,也就是说以后你在请求http://api.douban.com/v2/XXXXX这个地址的时候直接写成/api即可。
 				}
 			}
 		},
@@ -55,11 +55,13 @@ module.exports = {
 	build: {
 		// Template for index.html
 		index: path.resolve(__dirname, '../dist/index.html'),
+		// index: path.resolve('C:/Users/38304/Desktop/dist/index.html'),
 
 		// Paths
 		assetsRoot: path.resolve(__dirname, '../dist'),
+		// assetsRoot: path.resolve('C:/Users/38304/Desktop/dist'),
 		assetsSubDirectory: 'static',
-		assetsPublicPath: '/',
+		assetsPublicPath: '/jxch-smartmp/',
 
 		/**
 		 * Source Maps

+ 1 - 1
config/prod.env.js

@@ -1,4 +1,4 @@
 'use strict'
 module.exports = {
-  NODE_ENV: '"production"'
+	NODE_ENV: '"production"'
 }

+ 4 - 4
src/components/balance/Balance.vue

@@ -140,7 +140,7 @@
 				var _this = this
 				_this.tableData = []
 				// _this.rows_total = 0
-				this.$axios.get('/api/HotWaters/waterMoney.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterMoney.action', {
 						params: params
 					})
 					.then(res => {
@@ -164,7 +164,7 @@
 			 */
 			get_total_amount() {
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterfindMoneyTotal.action')
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindMoneyTotal.action')
 					.then(res => {
 						// console.log(res.data);
 						if (typeof(res.data.money) != 'undefined' && res.data.money != '' && JSON.stringify(res
@@ -244,7 +244,7 @@
 			get_view_total_amount() {
 				var _this = this
 				_this.view_total_amount = 0.0.toFixed(2)
-				this.$axios.get('/api/HotWaters/waterrechargeTotal.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterrechargeTotal.action', {
 						params: {
 							re_time: this.select_month,
 							stu_number: this.stu_number
@@ -293,7 +293,7 @@
 				var _this = this
 				_this.view_tableData = []
 				// _this.view_rows_total = 0
-				this.$axios.get('/api/HotWaters/waterfindRecharge.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindRecharge.action', {
 						params: params
 					})
 					.then(res => {

+ 18 - 18
src/components/dev_mgr/DevMgr.vue

@@ -8,7 +8,7 @@
 						:show-file-list="false">
 						<el-button type="primary" size="small">表格导入</el-button>
 					</el-upload>
-					<el-link type="primary" href="https://jtishfw.ncjti.edu.cn/jxch-smartmp/HotWaters/download/模板.xls">
+					<el-link type="primary" href="https://jtishfw.ncjti.edu.cn/jxch-smartmp/jxch-smartmp-api/HotWaters/download/模板.xls">
 						模板下载</el-link>
 				</span>
 			</el-col>
@@ -171,7 +171,7 @@
 				rows: this.pageRows
 			}
 			// 更新表格
-			this.updateTable('/HotWaters/waterlist.action', params)
+			this.updateTable('/jxch-smartmp-api/HotWaters/waterlist.action', params)
 			// 取得楼栋号,填充下拉列表
 			this.getBuildsFillSelect()
 		},
@@ -181,7 +181,7 @@
 			 */
 			getBuildsFillSelect() {
 				// 获取楼栋号,填充下拉列表
-				this.getBuilds('/HotWaters/watergetBuilds.action')
+				this.getBuilds()
 			},
 			/**
 			 * 导入设备xls文件
@@ -193,7 +193,7 @@
 				form.append('file', param.file);
 				this.$axios({
 						method: "post",
-						url: "/api/HotWaters/upload",
+						url: "/jxch-smartmp-api/HotWaters/upload",
 						headers: {
 							'Content-type': 'multipart/form-data'
 						},
@@ -211,7 +211,7 @@
 			 */
 			getBuilds(url) {
 				var _this = this
-				this.$axios.get('/api' + url)
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watergetBuilds.action')
 					.then(res => {
 						// console.log(res.data);
 						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '' && JSON.stringify(res
@@ -243,7 +243,7 @@
 				var _this = this
 				_this.tableData = []
 				// _this.rows_total = 0
-				this.$axios.get('/api' + url, {
+				this.$axios.get(url, {
 						params: params
 					})
 					.then(res => {
@@ -289,7 +289,7 @@
 					}
 				}
 				// 查询该栋的信息
-				this.updateTable('/HotWaters/waterquerylist.action', params)
+				this.updateTable('/jxch-smartmp-api/HotWaters/waterquerylist.action', params)
 			},
 			/**
 			 * 改变页码
@@ -311,7 +311,7 @@
 					}
 				}
 				// 查询该栋的信息
-				this.updateTable('/HotWaters/waterquerylist.action', params)
+				this.updateTable('/jxch-smartmp-api/HotWaters/waterquerylist.action', params)
 			},
 			/**
 			 * 导出表格
@@ -328,7 +328,7 @@
 				} else {
 					params = ''
 				}
-				this.$axios.post('/api/HotWaters/watertoExcel.action', params)
+				this.$axios.post('/jxch-smartmp-api/HotWaters/watertoExcel.action', params)
 					.then(res => {
 						console.log(res.data.downurl);
 						if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '' && JSON.stringify(res
@@ -358,7 +358,7 @@
 			 */
 			handleDelRow() {
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterdelBuild.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterdelBuild.action', {
 						params: {
 							id: this.delRowId
 						}
@@ -372,7 +372,7 @@
 								page: this.currentPage,
 								rows: this.pageRows
 							}
-							this.updateTable('/HotWaters/waterlist.action', params)
+							this.updateTable('/jxch-smartmp-api/HotWaters/waterlist.action', params)
 							// 取得楼栋号,填充下拉列表
 							this.getBuildsFillSelect()
 						} else {
@@ -422,7 +422,7 @@
 					return
 				}
 				var _this = this
-				this.$axios.get('/api/HotWaters/wateraddBuild.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/wateraddBuild.action', {
 						params: {
 							user_id: String(this.addform.user_id).trim(),
 							dom: String(this.addform.dom).trim(),
@@ -443,7 +443,7 @@
 								page: this.currentPage,
 								rows: this.pageRows
 							}
-							this.updateTable('/HotWaters/waterlist.action', params)
+							this.updateTable('/jxch-smartmp-api/HotWaters/waterlist.action', params)
 							// 取得楼栋号,填充下拉列表
 							this.getBuildsFillSelect()
 						} else {
@@ -473,7 +473,7 @@
 					return
 				}
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterupdateBuild.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterupdateBuild.action', {
 						params: {
 							id: this.form.id,
 							user_id: String(this.form.user_id).trim(),
@@ -490,7 +490,7 @@
 								page: this.currentPage,
 								rows: this.pageRows
 							}
-							this.updateTable('/HotWaters/waterlist.action', params)
+							this.updateTable('/jxch-smartmp-api/HotWaters/waterlist.action', params)
 							// 取得楼栋号,填充下拉列表
 							this.getBuildsFillSelect()
 						} else {
@@ -536,7 +536,7 @@
 							rows: this.pageRows
 						}
 					}
-					this.updateTable('/HotWaters/waterquerylist.action', params)
+					this.updateTable('/jxch-smartmp-api/HotWaters/waterquerylist.action', params)
 					this.$message.success('水表id包含:' + this.query_shuibiaoId + ' 查询完成!')
 				} else {
 					if (this.form_select.value == 0) {
@@ -544,14 +544,14 @@
 							page: 1,
 							rows: this.pageRows
 						}
-						this.updateTable('/HotWaters/waterquerylist.action', params)
+						this.updateTable('/jxch-smartmp-api/HotWaters/waterquerylist.action', params)
 					} else {
 						params = {
 							build: this.form_select.label,
 							page: 1,
 							rows: this.pageRows
 						}
-						this.updateTable('/HotWaters/waterquerylist.action', params)
+						this.updateTable('/jxch-smartmp-api/HotWaters/waterquerylist.action', params)
 					}
 					// this.$message.error('请输入水表id 或 选择 楼栋号')
 				}

+ 3 - 3
src/components/feilvset/feilvset.vue

@@ -78,7 +78,7 @@
 			 * 获取当前费率
 			 */
 			get_current_feilv() {
-				this.$axios.get('/api/HotWaters/watercurrentRate.action')
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watercurrentRate.action')
 					.then(res => {
 						// console.log(res.data);
 						if (typeof(res.data.rate) != 'undefined' && res.data.rate != '' && JSON.stringify(res
@@ -99,7 +99,7 @@
 			get_history_feilv() {
 				this.tableData = []
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterqueryPrice.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterqueryPrice.action', {
 						params: {
 							page: this.current_page,
 							rows: this.page_rows
@@ -159,7 +159,7 @@
 			handle_modify_feilv() {
 				var _this = this
 				if (this.input_feilv) {
-					this.$axios.get('/api/HotWaters/waterupdatePrice.action', {
+					this.$axios.get('/jxch-smartmp-api/HotWaters/waterupdatePrice.action', {
 							params: {
 								rate: this.input_feilv
 							}

+ 1 - 1
src/components/login/Login.vue

@@ -84,7 +84,7 @@
 					params.number = username
 				}
 				_this.$refs[formName].validate((valid) => {
-					_this.$axios.get('/api/HotWaters/waterqueryAdmin.action', {
+					_this.$axios.get('/jxch-smartmp-api/HotWaters/waterqueryAdmin.action', {
 							params: params
 						})
 						.then(res => {

+ 7 - 7
src/components/shangjiaduizhang/shangjiaduizhang.vue

@@ -173,7 +173,7 @@
 				if (JSON.stringify(params.data) == '{}') {
 					params = ''
 				}
-				this.$axios.post('/api/HotWaters/watertoComExcel.action', params)
+				this.$axios.post('/jxch-smartmp-api/HotWaters/watertoComExcel.action', params)
 					.then(res => {
 						console.log(res.data.downurl);
 						if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '' && JSON.stringify(res
@@ -254,7 +254,7 @@
 						build: this.drom_options.label
 					}
 				}
-				this.$axios.get('/api/HotWaters/watergetdoms.action', params)
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watergetdoms.action', params)
 					.then(res => {
 						// console.log(res.data);
 						if (typeof(res.data.doms) != 'undefined' && res.data.doms != '' && JSON.stringify(res.data) !=
@@ -348,7 +348,7 @@
 			 */
 			getTodayXiaofei(params) {
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterfindConsume.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindConsume.action', {
 						params: params
 					})
 					.then(res => {
@@ -374,7 +374,7 @@
 			getBuildsFillSelect() {
 				// 获取楼栋号,填充下拉列表
 				var _this = this
-				this.$axios.get('/api/HotWaters/watergetBuilds.action')
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watergetBuilds.action')
 					.then(res => {
 						// console.log(res.data);
 						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '' && JSON.stringify(res
@@ -410,7 +410,7 @@
 				this.xiaofei.day_balance = 0.0.toFixed(2)
 				this.today_xiaofei = 0.0.toFixed(2)
 				// 年消费记录
-				this.$axios.get('/api/HotWaters/watertotalFeel.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watertotalFeel.action', {
 						params: {
 							year: this.select_riqi.select_year
 						}
@@ -430,7 +430,7 @@
 					})
 
 				// 月消费记录
-				this.$axios.get('/api/HotWaters/watertotalFeel.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watertotalFeel.action', {
 						params: {
 							month: this.select_riqi.select_month
 						}
@@ -450,7 +450,7 @@
 					})
 
 				// 日消费记录
-				this.$axios.get('/api/HotWaters/watertotalFeel.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watertotalFeel.action', {
 						params: {
 							day: this.select_riqi.select_day
 						}

+ 6 - 6
src/components/yongshuifenxi/yongshuifenxi.vue

@@ -203,7 +203,7 @@
 					dom: this.room_value
 				}
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterwaterTotal.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterwaterTotal.action', {
 						params: params
 					})
 					.then(res => {
@@ -234,7 +234,7 @@
 			getBuildsFillSelect() {
 				// 获取楼栋号,填充下拉列表
 				var _this = this
-				this.$axios.get('/api/HotWaters/watergetBuilds.action')
+				this.$axios.get('/jxch-smartmp-api/HotWaters/watergetBuilds.action')
 					.then(res => {
 						// console.log(res.data);
 						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '' && JSON.stringify(res
@@ -277,7 +277,7 @@
 				// 日用水量
 				if (riqi == '日') {
 					// 查询日的数据
-					this.$axios.get('/api/HotWaters/waterdayTong.action', {
+					this.$axios.get('/jxch-smartmp-api/HotWaters/waterdayTong.action', {
 							params: params
 						})
 						.then(res => {
@@ -296,7 +296,7 @@
 						})
 				} else if (riqi == '月') { // 月用水量
 					// 查询月的数据
-					this.$axios.get('/api/HotWaters/watermonthTong.action', {
+					this.$axios.get('/jxch-smartmp-api/HotWaters/watermonthTong.action', {
 							params: params
 						})
 						.then(res => {
@@ -315,7 +315,7 @@
 						})
 				} else if (riqi == '年') { // 年用水量
 					// 查询年的数据
-					this.$axios.get('/api/HotWaters/wateryearTong.action', {
+					this.$axios.get('/jxch-smartmp-api/HotWaters/wateryearTong.action', {
 							params: params
 						})
 						.then(res => {
@@ -404,7 +404,7 @@
 					params.username = this.detail_userName
 				}
 				// 显示详细列表
-				this.$axios.get('/api/HotWaters/waterdetailWater.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterdetailWater.action', {
 						params: params
 					})
 					.then(res => {

+ 4 - 4
src/components/zhuanghaoguanli/zhuanghaoguanli.vue

@@ -178,7 +178,7 @@
 					params.number = this.account
 				}
 				// _this.rows_total = 0
-				this.$axios.get('/api/HotWaters/waterqueryAdmin.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterqueryAdmin.action', {
 						params: params
 					})
 					.then(res => {
@@ -237,7 +237,7 @@
 					return
 				}
 				var _this = this
-				this.$axios.get('/api/HotWaters/wateraddAdmin.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/wateraddAdmin.action', {
 						params: {
 							name: String(this.addform.name).trim(),
 							number: String(this.addform.number).trim(),
@@ -298,7 +298,7 @@
 					return
 				}
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterupdateAdmin.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterupdateAdmin.action', {
 						params: {
 							id: this.form.id,
 							name: String(this.form.name).trim(),
@@ -345,7 +345,7 @@
 			 */
 			handleDelRow() {
 				var _this = this
-				this.$axios.get('/api/HotWaters/waterdelAdmin.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterdelAdmin.action', {
 						params: {
 							id: this.del_id
 						}

+ 13 - 12
src/main.js

@@ -5,22 +5,23 @@ import App from './App'
 import router from './router'
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
-import echarts from 'echarts'
-import axios from "axios"
-// import qs from "qs"
+import Echarts from 'echarts'
+import Axios from "axios"
+// import Api from '../static/interface'
+// import Qs from "qs"
 
-// axios.defaults.timeout = 3000 //响应时间
-// axios.defaults.headers.post['Content-Type'] = 'multipart/form-data'; //配置请求头
-// axios.defaults.baseURL = process.env.NODE_HOST; // 配置接口地址
-// axios.defaults.baseURL='https://jtishfw.ncjti.edu.cn/jxch-smartmp'
-console.log(process.env.NODE_ENV)
-// alert('环境:' + process.env.NODE_ENV)
+// Axios.defaults.timeout = 3000 //响应时间
+// Axios.defaults.headers.post['Content-Type'] = 'multipart/form-data'; //配置请求头
+// Axios.defaults.baseURL = process.env.NODE_HOST; // 配置接口地址
+// Axios.defaults.baseURL='https://jtishfw.ncjti.edu.cn/jxch-smartmp'
+// console.log('环境:' + process.env.NODE_ENV)
 
 Vue.use(ElementUI);
 
-// Vue.prototype.$qs = qs;
-Vue.prototype.$axios = axios;
-Vue.prototype.$echarts = echarts
+// Vue.prototype.$qs = Qs;
+// Vue.prototype.$api = Api;
+Vue.prototype.$axios = Axios;
+Vue.prototype.$echarts = Echarts
 
 Vue.config.productionTip = false
 

+ 1 - 0
src/router/index.js

@@ -12,6 +12,7 @@ import ZHGL from '@/components/zhuanghaoguanli/zhuanghaoguanli'
 Vue.use(Router)
 
 export default new Router({
+	base: '/jxch-smartmp/',
 	mode: 'history',
 	routes: [{
 		path: '/',

BIN
static/images/bg.png


+ 13 - 0
static/interface/index.js

@@ -0,0 +1,13 @@
+// 配置主机地址和端口号(可以有多个,需要测试那个环境字节打开那个base即可)
+let base = "https://jtishfw.ncjti.edu.cn/jxch-smartmp"
+
+// 在线api接口路径,需要和项目后台确认
+let online_url = {
+
+	//管理员登录
+	login: base + "/jxch-smartmp-api/HotWaters/waterqueryAdmin.action",
+
+}
+
+//导出online_url对象
+export default online_url