bill 5 سال پیش
والد
کامیت
4c65237722
6فایلهای تغییر یافته به همراه14 افزوده شده و 6 حذف شده
  1. 2 1
      build/utils.js
  2. 1 1
      config/index.js
  3. 1 1
      src/main.js
  4. 4 1
      src/page/device/index.vue
  5. 3 1
      src/page/statistics/index.vue
  6. 3 1
      src/util/http.js

+ 2 - 1
build/utils.js

@@ -47,7 +47,8 @@ exports.cssLoaders = function (options) {
     if (options.extract) {
       return ExtractTextPlugin.extract({
         use: loaders,
-        fallback: 'vue-style-loader'
+        fallback: 'vue-style-loader',
+        publicPath: '../../'
       })
     } else {
       return ['vue-style-loader'].concat(loaders)

+ 1 - 1
config/index.js

@@ -50,7 +50,7 @@ module.exports = {
     // Paths
     assetsRoot: path.resolve(__dirname, '../dist'),
     assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
+    assetsPublicPath: './',
 
     /**
      * Source Maps

+ 1 - 1
src/main.js

@@ -1,12 +1,12 @@
 // The Vue build version to load with the `import` command
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
+import '@/util/dateHandle'
 import Vue from 'vue'
 import App from './App'
 import router from './router'
 import ElementUI from 'element-ui'
 import '@/assets/css/theme/index.css'
 import http, {setHandle} from '@/util/http'
-import '@/util/dateHandle'
 
 Vue.use(ElementUI)
 Vue.config.productionTip = false

+ 4 - 1
src/page/device/index.vue

@@ -202,6 +202,7 @@ export default {
   methods: {
     async _getCameraData () {
       this.fullscreenLoading = true
+      if (!Number(this.currentPage)) this.currentPage = 1
       let res = await this.$http.post('/manager/camera/list', {
         pageNum: this.currentPage,
         pageSize: this.pagesize,
@@ -234,6 +235,7 @@ export default {
       }
     },
     handleCurrentChange (val) {
+      console.log('----', val)
       this.currentPage = val
     },
     showDialog (row) {
@@ -290,6 +292,7 @@ export default {
       }
     },
     async _modifyPoints () {
+      console.log('------'+this.currentPage+'-----')
       let body = this.form.region
       let points = this.form.point
       let cameraId = this.currentDeviceId
@@ -313,6 +316,7 @@ export default {
             type: 'success',
             message: '充值成功!'
           })
+          console.log('------'+this.currentPage+'-----')
           this._getCameraData()
           this.dialogFormVisible = false
         } else {
@@ -332,7 +336,6 @@ export default {
         type,
         orderNum: orderSn
       } = this.ruleForm
-      console.log(wifiName, childName, balance, own, orderSn)
       if (wifiName === '' || childName === '' || balance === '' || own === '' || type === '') {
         return
       }

+ 3 - 1
src/page/statistics/index.vue

@@ -220,7 +220,9 @@ export default {
   methods: {
     async referData() {
       this.loadding = true
-      this.result = (await this.$http.post('https://api.baidu.com/json/tongji/v1/ReportService/getData', JSON.stringify(this.body))).body.data[0].result
+      let ret = (await this.$http.post('/manager/statistics', JSON.stringify(this.body))).data
+      this.result =  JSON.parse(ret).body.data[0].result
+      // this.result = (await this.$http.post('https://api.baidu.com/json/tongji/v1/ReportService/getData', JSON.stringify(this.body))).body.data[0].result
       this.loadding = false
     }
   },

+ 3 - 1
src/util/http.js

@@ -1,7 +1,9 @@
 import axios from 'axios'
 
 // 配置请求域名
-axios.defaults.baseURL = 'http://192.168.0.10:8080/api'
+axios.defaults.baseURL = 'https://test.4dkankan.com/api'
+// axios.defaults.baseURL = 'http://192.168.0.10:8080/api'
+
 
 axios.interceptors.request.use(function (config) {
   config.headers['Content-Type'] = 'application/json;charset=UTF-8'