Procházet zdrojové kódy

fix: 设备列表仅超管才展示抹掉数据按钮;

liujia před 2 dny
rodič
revize
39870406f9
1 změnil soubory, kde provedl 8 přidání a 1 odebrání
  1. 8 1
      src/views/device/list/index.vue

+ 8 - 1
src/views/device/list/index.vue

@@ -102,7 +102,12 @@
             <a-button type="link" @click="detailHandler(record.devId, record.clientId)"
               >查看详情</a-button
             >
-            <a-button type="link" @click="unbindDeviceHandler(record)">抹掉配置</a-button>
+            <a-button
+              v-if="userStore.userInfo?.userType === 'admin'"
+              type="link"
+              @click="unbindDeviceHandler(record)"
+              >抹掉配置</a-button
+            >
           </template>
         </template>
       </a-table>
@@ -179,9 +184,11 @@ import * as tenantAPI from '@/api/tenant'
 import type { TenantItem } from '@/api/tenant/types'
 import * as adminAPI from '@/api/admin'
 import * as deviceApi from '@/api/device'
+import { useUserStore } from '@/stores/user'
 
 const router = useRouter()
 const route = useRoute()
+const userStore = useUserStore()
 
 interface SearchData {
   deviceId: string // 设备ID