diff --git a/index.html b/index.html index 99f583a..5935a10 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Vite App + VP
diff --git a/public/favicon.ico b/public/favicon.ico index df36fcf..1c83525 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/api/device.js b/src/api/device.js new file mode 100644 index 0000000..d6cd7a6 --- /dev/null +++ b/src/api/device.js @@ -0,0 +1,40 @@ +import request from '@/utils/request.js' + +export const restartDeviceService = (data) => { + const params = new URLSearchParams(); + for (let key in data) { + params.append(key, data[key]) + } + return request.post('/camera/restart', params, Headers = {Authorization: data.Authorization }); +} + +export const updateDeviceService = (data) => { + const params = new URLSearchParams(); + for (let key in data) { + params.append(key, data[key]) + } + return request.post('/device/update', params, Headers = {Authorization: data.Authorization }); +} + +export const addDeviceService = (data) => { + const params = new URLSearchParams(); + for (let key in data) { + params.append(key, data[key]) + } + return request.post('/device/add', params, Headers = {Authorization: data.Authorization }); +} + +export const getDeviceListService = (data) => { + const params = new URLSearchParams(); + for(let d in data) { + params.append(d, data[d]); + } + // request.headers["Content-Type"] = "application/json"; + request.defaults.headers["token"] = data.token.value; + return request.post('/camera/list', params, { + headers: { + 'token': data.token, // 将 token 替换为您的令牌值 + } + } + ); +} \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index aeb904a..461ae51 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,6 +3,7 @@ import {createWebHistory, createRouter} from "vue-router"; import LoginVue from "@/views/Login.vue"; import VideoVue from "@/views/Video.vue"; import VideoListVue from "@/views/VideoList.vue"; +import DeviceListVue from "@/views/DeviceList.vue"; const routes = [ { @@ -20,6 +21,11 @@ const routes = [ name: 'VideoList', component: VideoListVue }, + { + path: '/device', + name: 'Device', + component: DeviceListVue + }, { path: '/', redirect: '/login' diff --git a/src/utils/request.js b/src/utils/request.js index 5249918..3774c35 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,6 +1,7 @@ import axios from "axios"; import router from "@/router/index.js"; const baseURL = "https://jp.ljsea.top/"; +//const baseURL= "http://localhost:8082"; const request = axios.create({ baseURL: baseURL, }); diff --git a/src/views/DeviceList.vue b/src/views/DeviceList.vue new file mode 100644 index 0000000..409f49c --- /dev/null +++ b/src/views/DeviceList.vue @@ -0,0 +1,228 @@ + + + + \ No newline at end of file diff --git a/src/views/Login.vue b/src/views/Login.vue index 65a74e5..35e8ad6 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -169,6 +169,8 @@ const getIpClient= async() => { try { const response = await axios.get("https://ipinfo.io/json"); loginData.value.ip =response.data.ip; + localStorage.setItem("ip", response.data.ip); + localStorage.setItem("city", response.data.city); // console.log("ip:",response.data.ip); // console.log("login ip:",loginData.ip); // console.log(response.data); diff --git a/src/views/VideoList.vue b/src/views/VideoList.vue index d55531f..948ba17 100644 --- a/src/views/VideoList.vue +++ b/src/views/VideoList.vue @@ -55,6 +55,11 @@ export default { console.log("file_size", this.file_sum_size, "len=", len); this.tableData = data; }, + logout(){ + //退出登录 + localStorage.clear(); + router.push("/login"); + }, onSubmit() { getVideoList({ token: token }); }, @@ -120,9 +125,31 @@ export default { }, async delayVideo(index) { var id = this.tableData[index].id; - var days = 10; + var days = 15; var delay_data = { id: id, + option:"one", + ip:this.ip, + delay: days, + userId: this.tokenData.userId, + token: this.tokenData.token, + }; + try { + var d_re = await delayVideoService(delay_data); + if (d_re.code == 0) { + alert("延迟成功"); + } else { + alert("操作失败"); + } + } catch (e) { + console.log(e); + } + }, + async delayAllVideo() { + var days = 15; + var delay_data = { + id: -1, + option:"all", ip:this.ip, delay: days, userId: this.tokenData.userId, @@ -149,7 +176,9 @@ export default { console.error(error); } }, - + toDeviceM(){ + router.push("/device"); + }, // 修改条纹颜色 tableRowClassName({ row, rowIndex }) { if (row.human === 1) { @@ -228,6 +257,15 @@ export default { 查询 + + 退出登录 + + + 全部延迟删除 + + + 设备信息 +