add chart code
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user