diff --git a/src/config/axios.js b/src/config/axios.js index e2cdb28..bc89e00 100644 --- a/src/config/axios.js +++ b/src/config/axios.js @@ -5,7 +5,6 @@ import NProgress from 'nprogress' import 'nprogress/nprogress.css' import {failMessage} from '@/util/util' import {getStore} from "@/util/store"; -import {getTokenCookies} from '@/util/auth' NProgress.configure({ showSpinner: false @@ -23,8 +22,8 @@ axios.defaults.validateStatus = function (status) { axios.interceptors.request.use(config => { NProgress.start(); config.headers['Content-Type'] = 'application/json'; - config.headers['Auth-User'] = getStore({name: 'user'}) || ''; - config.headers['Auth-Token'] = getTokenCookies() || ''; + config.headers['X-Auth-User'] = getStore({name: 'user'}) || ''; + config.headers['X-Auth-Token'] = getStore({name: 'token'}) || ''; return config; }, error => { console.error('Request interceptors:', error); diff --git a/src/router/router.js b/src/router/router.js index 3df642d..6c4251f 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -6,7 +6,6 @@ import NProgress from "nprogress"; import {checkTokenValid} from "@/api/user"; import store from "@/store/store"; import {getStore} from '@/util/store' -import {getTokenCookies} from "@/util/auth"; Vue.use(VueRouter); @@ -36,7 +35,7 @@ router.beforeEach((to, from, next) => { if (meta.isAuth !== true || from.name === 'login') { next(); } else { - const token = getTokenCookies(), user = getStore({name: 'user'}); + const token = getStore({name: 'token'}), user = getStore({name: 'user'}); if ('' === token || undefined === token || '' === user || undefined === user) { next({path: '/login'}); return; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 389b721..bf9be8b 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,12 +1,11 @@ import md5 from 'js-md5'; -import {getStore, removeStore, setStore} from '@/util/store' -import {getTokenCookies, removeTokenCookies, setTokenCookies} from '@/util/auth' +import {getStore, setStore} from '@/util/store' import {cancelToken, generateSalt, generateToken} from '@/api/user' const user = { state: { user: getStore({name: 'user'}) || '', - token: getTokenCookies() || '', + token: getStore({name: 'token'}) || '', }, actions: { GenerateSalt({commit}, name) { @@ -53,15 +52,15 @@ const user = { }, REMOVE_USER: (state) => { state.user = ''; - removeStore({name: 'user'}); + setStore({name: 'user'}); }, SET_TOKEN: (state, token) => { state.token = token; - setTokenCookies(token); + setStore({name: 'token', content: state.token}); }, REMOVE_TOKEN: (state) => { state.token = ''; - removeTokenCookies(); + setStore({name: 'token'}); } } }; diff --git a/src/views/device/Device.vue b/src/views/device/Device.vue index 716fd23..20953da 100644 --- a/src/views/device/Device.vue +++ b/src/views/device/Device.vue @@ -101,13 +101,47 @@ trigger: 'click' } ] + }, { + label: '数据存储类型', + prop: 'multi', + width: 100, + span: 8, + type: 'select', + value: false, + dicData: [ + { + label: '单点数据', + value: false + }, { + label: '结构数据', + value: true + } + ] }, { label: '状态', prop: 'status', width: 100, span: 8, disabled: true, - slot: true + display: false, + slot: true, + type: 'select', + value: 'OFFLINE', + dicData: [ + { + label: '在线', + value: 'ONLINE' + }, { + label: '离线', + value: 'OFFLINE' + }, { + label: '维护', + value: 'MAINTAIN' + }, { + label: '故障', + value: 'FAULT' + } + ] }, { label: '备注', prop: 'description', diff --git a/src/views/driver/DriverAttribute.vue b/src/views/driver/DriverAttribute.vue index 7d60cc4..6beee41 100644 --- a/src/views/driver/DriverAttribute.vue +++ b/src/views/driver/DriverAttribute.vue @@ -115,22 +115,28 @@ value: 'string', dicData: [ { - label: '字符串', + label: '字符串(string)', value: 'string' }, { - label: '布尔量', + label: '布尔量(boolean)', value: 'boolean' }, { - label: '整数', + label: '字节(byte)', + value: 'byte' + }, { + label: '短整数(short)', + value: 'short' + }, { + label: '整数(int)', value: 'int' }, { - label: '长整数', + label: '长整数(long)', value: 'long' }, { - label: '浮点数', + label: '浮点数(float)', value: 'float' }, { - label: '双精度浮点数', + label: '双精度浮点数(double)', value: 'double' } ], diff --git a/src/views/point/Point.vue b/src/views/point/Point.vue index a89586e..fcd77b7 100644 --- a/src/views/point/Point.vue +++ b/src/views/point/Point.vue @@ -92,22 +92,28 @@ value: 'string', dicData: [ { - label: '字符串', + label: '字符串(string)', value: 'string' }, { - label: '布尔量', + label: '布尔量(boolean)', value: 'boolean' }, { - label: '整数', + label: '字节(byte)', + value: 'byte' + }, { + label: '短整数(short)', + value: 'short' + }, { + label: '整数(int)', value: 'int' }, { - label: '长整数', + label: '长整数(long)', value: 'long' }, { - label: '浮点数', + label: '浮点数(float)', value: 'float' }, { - label: '双精度浮点数', + label: '双精度浮点数(double)', value: 'double' } ], diff --git a/src/views/point/PointAttribute.vue b/src/views/point/PointAttribute.vue index 9130f2d..4dada52 100644 --- a/src/views/point/PointAttribute.vue +++ b/src/views/point/PointAttribute.vue @@ -115,22 +115,28 @@ value: 'string', dicData: [ { - label: '字符串', + label: '字符串(string)', value: 'string' }, { - label: '布尔量', + label: '布尔量(boolean)', value: 'boolean' }, { - label: '整数', + label: '字节(byte)', + value: 'byte' + }, { + label: '短整数(short)', + value: 'short' + }, { + label: '整数(int)', value: 'int' }, { - label: '长整数', + label: '长整数(long)', value: 'long' }, { - label: '浮点数', + label: '浮点数(float)', value: 'float' }, { - label: '双精度浮点数', + label: '双精度浮点数(double)', value: 'double' } ], diff --git a/src/views/point/PointValue.vue b/src/views/point/PointValue.vue index c487a24..8b76eec 100644 --- a/src/views/point/PointValue.vue +++ b/src/views/point/PointValue.vue @@ -16,7 +16,7 @@ @current-change="currentChange" > @@ -41,10 +41,11 @@ dateBtn: true, menu: false, addBtn: false, - editBtn: false, delBtn: false, + editBtn: false, height: 664, align: 'center', + defaultExpandAll: true, column: [ { label: '所属设备', diff --git a/src/views/profile/Profile.vue b/src/views/profile/Profile.vue index 67c214a..7e86bf4 100644 --- a/src/views/profile/Profile.vue +++ b/src/views/profile/Profile.vue @@ -72,7 +72,7 @@ value: true, dicData: [ { - label: '公有', + label: '公有(web暂不支持,该模式请使用批量导入)', value: true }, { label: '私有', @@ -168,7 +168,7 @@ }, driver() { dictionaryApi.driverDictionary().then(res => { - this.findObject(this.listOption.column,'driverId').dicData = res.data; + this.findObject(this.listOption.column, 'driverId').dicData = res.data; }).catch(() => { }); },