mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: create/edit/del fav folder
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'package:PiliPalaX/http/constants.dart';
|
||||
import 'package:PiliPalaX/pages/dynamics/view.dart' show ReplyOption;
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import '../models/msg/account.dart';
|
||||
@@ -205,6 +206,33 @@ class MsgHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future uploadImage({
|
||||
required dynamic path,
|
||||
required String bucket,
|
||||
required String dir,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.uploadImage,
|
||||
data: FormData.fromMap({
|
||||
'bucket': bucket,
|
||||
'file': await MultipartFile.fromFile(path),
|
||||
'dir': dir,
|
||||
'csrf': await Request.getCsrf(),
|
||||
}),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data'],
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static Future uploadBfs(
|
||||
dynamic path,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user