修复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 }> {
|
||||
try {
|
||||
const url = `/api/action/jingrow.client.save_single`
|
||||
await axios.post(url, {
|
||||
pagetype: pagetype,
|
||||
data: data
|
||||
}, {
|
||||
const url = `/api/data/${encodeURIComponent(pagetype)}/${encodeURIComponent(pagetype)}`
|
||||
await axios.put(url, data, {
|
||||
headers: get_session_api_headers(),
|
||||
withCredentials: true
|
||||
})
|
||||
@ -90,7 +87,7 @@ export async function saveSinglePageData(pagetype: string, data: any): Promise<{
|
||||
console.error('Failed to save single page data:', error)
|
||||
return {
|
||||
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