feat: 后端版本迁移修改

This commit is contained in:
Blizzard
2026-05-24 01:38:28 +08:00
parent 058a575e10
commit f8d71ee800
29 changed files with 304 additions and 291 deletions
+7 -4
View File
@@ -24,10 +24,13 @@ Page({
this.classifyPlant(imagePath);
},
classifyPlant(filePath) {
async classifyPlant(filePath) {
this.setData({ isLoading: true, hasError: false });
request.uploadToUrl('/classify/plant', filePath, 'file').then(res => {
try {
// Directly upload file to classify endpoint without uploading to MinIO file service
const res = await request.uploadToUrl('/plant/classify/plant', filePath);
const results = res.result || [];
// Map results with percentage scores
@@ -46,10 +49,10 @@ Page({
topResult: mappedResults.length > 0 ? mappedResults[0] : null,
isLoading: false
});
}).catch(err => {
} catch (err) {
console.error('Classify failed', err);
this.setData({ isLoading: false, hasError: true });
});
}
},
// Retry identification