add chart code

This commit is contained in:
2026-01-13 23:11:25 +08:00
parent 0a9f0b8583
commit 6b4d98f5ce
14 changed files with 938 additions and 41 deletions
+3 -2
View File
@@ -37,13 +37,14 @@ class ExpenseApiService {
Future<String?> uploadImage(File file) async {
try {
// 使用 GenericApiService 內定義的 BASE_IP
final String db = AuthManager().currentCompany ?? "demo";
var request = http.MultipartRequest(
'POST',
Uri.parse("${GenericApiService.BASE_IP}/upload/EIS_demo/images")
Uri.parse("${GenericApiService.BASE_IP}/upload/eis_$db/images")
);
// 取得本地檔案名稱
String picFileName = "${GenericApiService.BASE_IP}/upload/EIS_demo/images/" + file.path.split('/').last;
String picFileName = "${GenericApiService.BASE_IP}/upload/eis_$db/images/" + file.path.split('/').last;
// [修正] index.js 的 multer 配置要求 key 必須是 'file'
request.files.add(await http.MultipartFile.fromPath('file', file.path));