feat: 后端版本迁移修改
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user