修复single类型的pagetype无法保存修改的问题
This commit is contained in:
parent
1edea21b2e
commit
a511f57a59
@ -74,11 +74,8 @@ export async function getSinglePageData(pagetype: string): Promise<{ success: bo
|
|||||||
*/
|
*/
|
||||||
export async function saveSinglePageData(pagetype: string, data: any): Promise<{ success: boolean; message?: string }> {
|
export async function saveSinglePageData(pagetype: string, data: any): Promise<{ success: boolean; message?: string }> {
|
||||||
try {
|
try {
|
||||||
const url = `/api/action/jingrow.client.save_single`
|
const url = `/api/data/${encodeURIComponent(pagetype)}/${encodeURIComponent(pagetype)}`
|
||||||
await axios.post(url, {
|
await axios.put(url, data, {
|
||||||
pagetype: pagetype,
|
|
||||||
data: data
|
|
||||||
}, {
|
|
||||||
headers: get_session_api_headers(),
|
headers: get_session_api_headers(),
|
||||||
withCredentials: true
|
withCredentials: true
|
||||||
})
|
})
|
||||||
@ -90,7 +87,7 @@ export async function saveSinglePageData(pagetype: string, data: any): Promise<{
|
|||||||
console.error('Failed to save single page data:', error)
|
console.error('Failed to save single page data:', error)
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: error.response?.data?.message || error.message || '保存单页数据失败'
|
message: error.response?.data?.detail || error.message || '保存单页数据失败'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user