fix: improve cache management and sticker deletion
Some checks failed
Frontend CI / ota-android (push) Successful in 4m46s
Frontend CI / ota-ios (push) Successful in 3m24s
Frontend CI / build-and-push-web (push) Failing after 24m8s
Frontend CI / build-android-apk (push) Successful in 34m17s

Update cache directory scanning to use platform-specific paths for iOS and Android.
Add a delay after clearing cache to ensure native deletion completes.
Correct the request body structure for sticker deletion API calls.
This commit is contained in:
2026-06-15 03:58:15 +08:00
parent 97477c3471
commit d8ef51fa13
2 changed files with 19 additions and 10 deletions

View File

@@ -85,9 +85,8 @@ export const addStickerFromUrl = async (
*/
export const deleteSticker = async (stickerId: string): Promise<boolean> => {
try {
await api.delete('/stickers', {
data: { sticker_id: stickerId },
});
// api.delete(path, body) 的第二个参数直接作为请求体,不需要 axios 风格的 { data } 包装
await api.delete('/stickers', { sticker_id: stickerId });
return true;
} catch (error) {
console.error('删除自定义表情失败:', error);
@@ -130,9 +129,7 @@ export const batchDeleteStickers = async (stickerIds: string[]): Promise<{ succe
for (const stickerId of stickerIds) {
try {
await api.delete('/stickers', {
data: { sticker_id: stickerId },
});
await api.delete('/stickers', { sticker_id: stickerId });
success++;
} catch (error) {
console.error(`删除表情 ${stickerId} 失败:`, error);