移到新目錄(gogs) 並優化 login 及上傳圖片機制

This commit is contained in:
2026-01-03 00:48:49 +08:00
parent b26a339d5c
commit 0a9f0b8583
6 changed files with 99 additions and 24 deletions
+2 -2
View File
@@ -39,11 +39,11 @@ class ExpenseApiService {
// 使用 GenericApiService 內定義的 BASE_IP
var request = http.MultipartRequest(
'POST',
Uri.parse("$BASE_IP/upload/EIS_demo/images")
Uri.parse("${GenericApiService.BASE_IP}/upload/EIS_demo/images")
);
// 取得本地檔案名稱
String picFileName = "$BASE_IP/upload/EIS_demo/images/" + file.path.split('/').last;
String picFileName = "${GenericApiService.BASE_IP}/upload/EIS_demo/images/" + file.path.split('/').last;
// [修正] index.js 的 multer 配置要求 key 必須是 'file'
request.files.add(await http.MultipartFile.fromPath('file', file.path));