fix: 修复前端API响应数据解构错误
移除对响应数据中.data属性的错误引用,直接使用API返回的响应对象
This commit is contained in:
1 parent
2488c2646f
commit
17a9408c9d
4 files changed
+7
-5
No files matched your search
@@ -20,7 +20,9 @@
|
||||
"Bash(git add:*)",
|
||||
"Bash(git commit:*)",
|
||||
"Bash(git push:*)",
|
||||
"Bash(ls \"C:/Users/admin/Desktop/rct_vue/frontend/.env\"*)"
|
||||
"Bash(ls \"C:/Users/admin/Desktop/rct_vue/frontend/.env\"*)",
|
||||
"Bash(ls -la \"C:\\\\Users\\\\admin\\\\Desktop\\\\rct_vue\\\\backend\\\\app\\\\core\"*)",
|
||||
"Bash(ls -la \"C:\\\\Users\\\\admin\\\\Desktop\\\\rct_vue\\\\backend\\\\app\\\\core/\"*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ const fetchModels = async () => {
|
||||
const fetchTaskTypes = async () => {
|
||||
try {
|
||||
const res = await api.get('/admin/models/task-types')
|
||||
taskTypes.value = res.data || []
|
||||
taskTypes.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取任务类型失败', error)
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ const checkMobile = () => {
|
||||
|
||||
const fetchPerms = async () => {
|
||||
const res = await api.get('/admin/permissions')
|
||||
perms.value = res.data || []
|
||||
perms.value = res || []
|
||||
|
||||
// 重置所有分类的权限
|
||||
categories.value.forEach(cat => {
|
||||
|
||||
@@ -79,12 +79,12 @@ const form = ref({ name: '', description: '', parent_id: 0, permission_ids: [] }
|
||||
|
||||
const fetchRoles = async () => {
|
||||
const res = await api.get('/admin/roles')
|
||||
roles.value = res.data || []
|
||||
roles.value = res || []
|
||||
}
|
||||
|
||||
const fetchPerms = async () => {
|
||||
const res = await api.get('/admin/permissions')
|
||||
allPerms.value = res.data || []
|
||||
allPerms.value = res || []
|
||||
}
|
||||
|
||||
const create = () => {
|
||||
|
||||
Reference in new issue
Block a user