diff --git a/src/views/Home.vue b/src/views/Home.vue index 2b81ea8..62caa4c 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -77,11 +77,12 @@ export default { methods: { //查询跳转配置并定时跳转 play() { + let ip=localStorage.getItem("tvIP") let that = this; $.ajax({ url: "/board/getJumpConfig", type: "post", - data: {"boardName": 'home'}, + data: {"boardName": 'home',"ip":ip}, dataType: "json", success: (data) => { if (data.rows2 != "" && data.rows2 != null) { @@ -103,6 +104,21 @@ export default { this.play(); }, 5000 ); }, + getIp(){ + $.ajax({ + url: "/board/getIpFirst", + type: "post", + data: {}, + dataType: "json", + success: (data) => { + localStorage.setItem("tvIP",data.row) + + } + }).fail(() => { + localStorage.setItem("tvIP","1.1.1.1") + + }) + }, jump() { $.ajax({ url: "/board/kanKanYouMeiYouDiaoXian", @@ -123,6 +139,7 @@ export default { // } }, mounted() { + this.getIp(); this.play(); this.toPlay(); }, diff --git a/src/views/orderBoard.vue b/src/views/orderBoard.vue index 1c404dc..06e769e 100644 --- a/src/views/orderBoard.vue +++ b/src/views/orderBoard.vue @@ -66,11 +66,12 @@ export default { }, methods: { load() { + let ip=localStorage.getItem("tvIP") let that = this; $.ajax({ url: "/board/getJumpConfig", type: "post", - data: {"boardName": 'orderBoard'}, + data: {"boardName": 'orderBoard',"ip":ip}, dataType: "json", success: (data) => { if (data.rows2 != "" && data.rows2 != null) { @@ -107,14 +108,13 @@ export default { }) }, getItemNoNumber() { + let ip=localStorage.getItem("tvIP") let that = this; $.ajax({ url: "/board/getOrderBoardData", type: "POST", - contentType: 'application/json;charset=utf-8', async: false, - data: null,// 你的formid - + data:{"ip":ip}, dataType: "JSON", success: (data) => { if (data.success) { @@ -129,12 +129,12 @@ export default { }, getBoardData() { + let ip=localStorage.getItem("tvIP") $.ajax({ url: "/board/getOrderBoardData", type: "POST", - contentType: 'application/json;charset=utf-8', async: false, - data: null,// 你的formid + data:{"ip":ip}, dataType: "JSON", success: (data) => { if (data.success) { diff --git a/src/views/productOutBoard.vue b/src/views/productOutBoard.vue index 9cd9bfe..091ecf8 100644 --- a/src/views/productOutBoard.vue +++ b/src/views/productOutBoard.vue @@ -42,11 +42,12 @@ }, methods: { loadTime() { + let ip=localStorage.getItem("tvIP") let that = this; $.ajax({ url: "/board/getJumpConfig", type: "post", - data: {"boardName": 'productOutBoard'}, + data: {"boardName": 'productOutBoard',"ip":ip}, dataType: "json", success: (data) => { if (data.rows2 != "" && data.rows2 != null) { @@ -111,10 +112,11 @@ }, refresh() { let that = this; + let ip=localStorage.getItem("tvIP") $.ajax({ url: "/board/getProductOutData", type: "post", - data: {}, + data: {"ip":ip}, dataType: "json", success: function (data) { if (data.success) { @@ -274,4 +276,4 @@ .container { height: 100%; } - \ No newline at end of file + diff --git a/src/views/reportAbnormal.vue b/src/views/reportAbnormal.vue index 2749078..44c3f84 100644 --- a/src/views/reportAbnormal.vue +++ b/src/views/reportAbnormal.vue @@ -51,12 +51,13 @@ export default { }, methods: { getDataNumber() { + let ip=localStorage.getItem("tvIP") let that = this; $.ajax({ url: "/board/getReportAbnormalData", type: "POST", - contentType: 'application/json;charset=utf-8', async: false, + data: {"ip":ip}, dataType: "JSON", success: (data) => { if (data.success) { @@ -69,11 +70,12 @@ export default { }); }, loadTime() { + let ip=localStorage.getItem("tvIP") let that = this; $.ajax({ url: "/board/getJumpConfig", type: "post", - data: {"boardName": 'reportAbnormal'}, + data: {"boardName": 'reportAbnormal',"ip":ip}, dataType: "json", success: (data) => { if (data.rows2 != "" && data.rows2 != null) { @@ -131,10 +133,11 @@ export default { }, getData() { let that = this; + let ip=localStorage.getItem("tvIP") $.ajax({ url: "/board/getReportAbnormalData", type: "post", - data: {}, + data: {"ip":ip}, dataType: "json", success: function (data) { if (data.success) { @@ -321,4 +324,4 @@ export default { .container { height: 100%; } - \ No newline at end of file + diff --git a/src/views/scheduledBoard.vue b/src/views/scheduledBoard.vue index ff5dd77..775e850 100644 --- a/src/views/scheduledBoard.vue +++ b/src/views/scheduledBoard.vue @@ -75,11 +75,12 @@ export default { }, methods: { load() { + let ip=localStorage.getItem("tvIP") let that = this; $.ajax({ url: "/board/getJumpConfig", type: "post", - data: {"boardName": 'scheduledBoard'}, + data: {"boardName": 'scheduledBoard',"ip":ip}, dataType: "json", success: (data) => { if (data.rows2 != "" && data.rows2 != null) { @@ -120,12 +121,12 @@ export default { getItemNoNumber() { let that = this; + let ip=localStorage.getItem("tvIP") $.ajax({ url: "/board/getBoardData", type: "POST", - contentType: 'application/json;charset=utf-8', async: false, - data: null,// 你的formid + data: {"ip":ip},// 你的formid dataType: "JSON", success: (data) => { if (data.success) { @@ -169,12 +170,12 @@ export default { getBoardData() { let that=this; + let ip=localStorage.getItem("tvIP") $.ajax({ url: "/board/getBoardData", type: "POST", - contentType: 'application/json;charset=utf-8', async: true, - data: null,// 你的formid + data: {"ip":ip},// 你的formid dataType: "JSON", success: (data) => { if (data.success) { diff --git a/vue.config.js b/vue.config.js index 237fa64..c6df78a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,7 +3,7 @@ module.exports = { lintOnSave: false, devServer: { // proxy: 'http://192.168.1.83:8089' - // proxy: 'http://localhost:8083' - proxy: 'http://172.26.68.16:8091' + proxy: 'http://localhost:8083' + // proxy: 'http://172.26.68.16:8091' } }