diff --git a/src/App.vue b/src/App.vue index c0ea327..332f8d1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@ + + + + 选择站点: + + + + + 获取状态: + {{ get }} + + 设置状态: + {{ set }} + + diff --git a/src/components/refresh.vue b/src/components/refresh.vue new file mode 100644 index 0000000..be91fc9 --- /dev/null +++ b/src/components/refresh.vue @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/src/components/search-bar.vue b/src/components/search-bar.vue index 816731f..eb5c246 100644 --- a/src/components/search-bar.vue +++ b/src/components/search-bar.vue @@ -2,7 +2,7 @@ - + @@ -26,8 +26,7 @@ const store = useStore(); const devices = computed(() => store.state.device.devices); const onSubmit = () => { - searchDeviceForm.value.validate(valid => { - console.log(valid, { ...searchDevice }); + searchDeviceForm.value.validate(() => { const { device } = searchDevice; emit('search', { deviceId: device }); }); diff --git a/src/store/user.js b/src/store/user.js index 47689fe..72e8d3e 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -12,7 +12,7 @@ export default { }, userId({ user }) { if (!user) return null; - return user.userId; + return user.id; }, }, @@ -26,7 +26,7 @@ export default { state.user = user; if (user) { localStorage.setItem('token', user.token); - localStorage.setItem('user', user); + localStorage.setItem('user', JSON.stringify(user)); } else { localStorage.removeItem('token'); localStorage.removeItem('user'); diff --git a/src/views/device-list.vue b/src/views/device-list.vue index 35341ce..4d6c85b 100644 --- a/src/views/device-list.vue +++ b/src/views/device-list.vue @@ -17,23 +17,41 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - 删除 + + - 编辑 + + + @@ -59,11 +77,13 @@ diff --git a/src/views/network-config.vue b/src/views/network-config.vue index ac225a1..651f41e 100644 --- a/src/views/network-config.vue +++ b/src/views/network-config.vue @@ -1,4 +1,7 @@ + + + @@ -79,12 +82,18 @@ + + +