diff --git a/.env.development b/.env.development index 4e6b0b9..eebe8aa 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,9 @@ VUE_APP_TITLE = 智能驱鸟系统 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = 'http://192.168.1.70:8082' +VUE_APP_BASE_API = 'http://192.168.1.108:8081' +# 后台管理系统/开发环境摄像头 +VUE_APP_CAMERA_API = 'http://192.168.1.108:9000' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index 7cca620..69fb127 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,7 @@ VUE_APP_TITLE = 智能驱鸟系统 ENV = 'production' # 若依管理系统/生产环境 -VUE_APP_BASE_API = 'http://192.168.1.235:8081' +# VUE_APP_BASE_API = 'http://192.168.1.235:8081' +VUE_APP_BASE_API = 'http://192.168.1.108:8081' +# # 若依管理系统/生产环境摄像头 +VUE_APP_CAMERA_API = 'http://192.168.1.108:9000' diff --git a/package.json b/package.json index 1e028c6..f426b8e 100644 --- a/package.json +++ b/package.json @@ -37,18 +37,21 @@ }, "dependencies": { "@riophae/vue-treeselect": "0.4.0", + "@svgdotjs/svg.js": "^3.2.4", "axios": "0.24.0", "clipboard": "2.0.8", "core-js": "3.25.2", "echarts": "4.9.0", "element-ui": "2.15.10", "file-saver": "2.0.5", + "flv.js": "^1.6.2", "fuse.js": "6.4.3", "highlight.js": "9.18.5", "js-beautify": "1.13.0", "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", "nprogress": "0.2.0", + "panzoom": "^9.4.3", "quill": "1.3.7", "screenfull": "5.0.2", "sortablejs": "1.10.2", diff --git a/public/static/music_list.html b/public/static/music_list.html index 73fe461..c0a85bc 100644 --- a/public/static/music_list.html +++ b/public/static/music_list.html @@ -120,8 +120,8 @@ + + \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 1080f52..d103f7c 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -22,21 +22,36 @@ const service = axios.create({ // request拦截器 service.interceptors.request.use(config => { + if (config.baseUrl == "VUE_APP_CAMERA_API") { + config.baseURL = process.env.VUE_APP_CAMERA_API + } else { + config.baseURL = process.env.VUE_APP_BASE_API + } // 是否需要设置 token const isToken = (config.headers || {}).isToken === false // 是否需要防止数据重复提交 - const isRepeatSubmit = (config.headers || {}).repeatSubmit === false + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false; + // console.log(getToken(), !isToken, '张三') if (getToken() && !isToken) { config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } + // if (config.baseUrl == "VUE_APP_CAMERA_API") { + // config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token + // console.log(getToken(), "张三") + // } // get请求映射params参数 - if (config.method === 'get' && config.params) { + if (config.method == 'get' && config.params) { + console.log(111) let url = config.url + '?' + tansParams(config.params); url = url.slice(0, -1); config.params = {}; + + config.url = url; + } if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + // console.log(config,process.env.VUE_APP_BASE_API,process.env.VUE_APP_CAMERA_API) const requestObj = { url: config.url, data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, @@ -61,28 +76,28 @@ service.interceptors.request.use(config => { } return config }, error => { - console.log(error) - Promise.reject(error) + console.log(error) + Promise.reject(error) }) // 响应拦截器 service.interceptors.response.use(res => { - // 未设置状态码则默认成功状态 - const code = res.data.code || 200; - // 获取错误信息 - const msg = errorCode[code] || res.data.msg || errorCode['default'] - // 二进制数据则直接返回 - if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){ - return res.data - } - if (code === 401) { - if (!isRelogin.show) { - isRelogin.show = true; - MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { - confirmButtonText: '重新登录', - cancelButtonText: '取消', - type: 'warning' - } + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + } ).then(() => { isRelogin.show = false; store.dispatch('LogOut').then(() => { @@ -92,22 +107,22 @@ service.interceptors.response.use(res => { isRelogin.show = false; }); } - return Promise.reject('无效的会话,或者会话已过期,请重新登录。') - } else if (code === 500) { - Message({ - message: msg, - type: 'error' - }) - return Promise.reject(new Error(msg)) - } else if (code !== 200) { - Notification.error({ - title: msg - }) - return Promise.reject('error') - } else { - return res.data - } - }, + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ + message: msg, + type: 'error' + }) + return Promise.reject(new Error(msg)) + } else if (code !== 200) { + Notification.error({ + title: msg + }) + return Promise.reject('error') + } else { + return res.data + } +}, error => { console.log('err' + error) let { message } = error; diff --git a/src/views/login.vue b/src/views/login.vue index c6bce72..4c46e43 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -110,7 +110,8 @@ export default { }, beforeCreate(){ //存入开发地址。 - localStorage.setItem('localHost','http://192.168.1.235:8081') + // localStorage.setItem('localHost','http://192.168.1.235:8081') + localStorage.setItem('localHost','http://192.168.1.108:8081') }, methods: { getCode() { diff --git a/src/views/quniao/device/index.vue b/src/views/quniao/device/index.vue index d49f3e2..2ae24bd 100644 --- a/src/views/quniao/device/index.vue +++ b/src/views/quniao/device/index.vue @@ -1,791 +1,917 @@ \ No newline at end of file diff --git a/src/views/quniao/soundWave/index copy.vue b/src/views/quniao/soundWave/index copy.vue new file mode 100644 index 0000000..edf4666 --- /dev/null +++ b/src/views/quniao/soundWave/index copy.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/src/views/quniao/soundWave/index.vue b/src/views/quniao/soundWave/index.vue index edf4666..e075b39 100644 --- a/src/views/quniao/soundWave/index.vue +++ b/src/views/quniao/soundWave/index.vue @@ -1,84 +1,1346 @@ + + + + + + \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 802121a..819fb41 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,12 +35,21 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://192.168.1.70:8082`, + target: `http://192.168.1.108:8081`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' } - } + }, + // 摄像头 + [process.env.VUE_APP_CAMERA_API]: { + target: `http://192.168.1.108:9000`, + changeOrigin: true, + pathRewrite: { + // [`^${process.env.VUE_APP_CAMERA_API}`]: '' + ['^' + process.env.VUE_APP_CAMERA_API]: '' + } + }, }, disableHostCheck: true }, @@ -97,7 +106,7 @@ module.exports = { .plugin('ScriptExtHtmlWebpackPlugin') .after('html') .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` + // `runtime` must same as runtimeChunk name. default is `runtime` inline: /runtime\..*\.js$/ }]) .end() @@ -127,8 +136,8 @@ module.exports = { }) config.optimization.runtimeChunk('single'), { - from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 - to: './' //到根目录下 + from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 + to: './' //到根目录下 } } )