mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: query data
fix: webdav backup Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:PiliPlus/common/widgets/pair.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -60,10 +59,9 @@ class WebDav {
|
||||
try {
|
||||
String data = await GStorage.exportAllSettings();
|
||||
final path = '$_webdavDirectory/piliplus_settings.json';
|
||||
final file = File(path);
|
||||
if (await file.exists()) {
|
||||
await file.delete();
|
||||
}
|
||||
try {
|
||||
await _client!.remove(path);
|
||||
} catch (_) {}
|
||||
await _client!.write(path, utf8.encode(data));
|
||||
SmartDialog.showToast('备份成功');
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user