From a6b07348a6df90ae55703224a3b548eeff0b1508 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Mon, 14 Jul 2025 15:34:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E7=94=A8=E6=88=B7=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=EF=BC=8C=E8=A7=A3=E7=BB=91=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/userApp/index.ts | 20 +++++++++++--- src/router/index.ts | 23 ---------------- src/views/appUser/index.vue | 4 +-- src/views/appUser/user-info-dialog.vue | 37 +++++++++++++++----------- 4 files changed, 40 insertions(+), 44 deletions(-) diff --git a/src/api/userApp/index.ts b/src/api/userApp/index.ts index 31453a7..a8a37e1 100644 --- a/src/api/userApp/index.ts +++ b/src/api/userApp/index.ts @@ -4,7 +4,7 @@ import { AxiosPromise } from 'axios'; * 查询设备列表 * @param query */ -export const userList = (params): AxiosPromise => { +export const userList = (params: any): AxiosPromise => { return request({ url: '/app/user/list', method: 'get', @@ -12,7 +12,7 @@ export const userList = (params): AxiosPromise => { }); }; // 绑定设备列表 -export const deviceList = (params): AxiosPromise => { +export const deviceList = (params: any): AxiosPromise => { return request({ url: '/api/app/device', method: 'get', @@ -20,12 +20,24 @@ export const deviceList = (params): AxiosPromise => { }); }; // 账号状态 -export const userStatus = (data): AxiosPromise => { +export const userStatus = (data: any): AxiosPromise => { return request({ url: '/api/app/device', method: 'put', data }); }; +// 解绑设备 +export const deviceUnBind = (data: any): AxiosPromise => { + return request({ + url: '/api/app/device/unBind', + method: 'delete', + data, + headers: { + 'Content-Type': 'multipart/form-data', //设置正确的 Content-Type + }, + }); +}; -export default { userList,deviceList,userStatus } \ No newline at end of file + +export default { userList, deviceList, userStatus, deviceUnBind } \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 8d9eb88..0ba6e62 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,29 +1,6 @@ import { createWebHistory, createRouter, RouteRecordRaw } from 'vue-router'; /* Layout */ import Layout from '@/layout/index.vue'; - -/** - * Note: 路由配置项 - * - * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 - * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 - * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 - * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 - * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 - * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 - * name:'router-name' // 设定路由的名字,一定要填写不然使用时会出现各种问题 - * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 - * roles: ['admin', 'common'] // 访问路由的角色权限 - * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 - * meta : { - noCache: true // 如果设置为true,则不会被 缓存(默认 false) - title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 - icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg - breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 - activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 - } - */ - // 公共路由 export const constantRoutes: RouteRecordRaw[] = [ { diff --git a/src/views/appUser/index.vue b/src/views/appUser/index.vue index e6e2985..cdda244 100644 --- a/src/views/appUser/index.vue +++ b/src/views/appUser/index.vue @@ -34,9 +34,9 @@ - + diff --git a/src/views/appUser/user-info-dialog.vue b/src/views/appUser/user-info-dialog.vue index caa70b7..7d4eb49 100644 --- a/src/views/appUser/user-info-dialog.vue +++ b/src/views/appUser/user-info-dialog.vue @@ -16,18 +16,18 @@ - - - - +