diff --git a/src/utils/uploadFiles.js b/src/utils/uploadFiles.js index 13a7338..1518bae 100644 --- a/src/utils/uploadFiles.js +++ b/src/utils/uploadFiles.js @@ -33,11 +33,8 @@ export function uploadImgFile(renderFun) { console.debug(Object.keys(window.app)) // 检查具体的方法 - console.debug('getAccessOrigin 方法存在?', typeof window.app.getAccessOrigin) - console.debug( - 'getAccessOrigin 是函数?', - typeof window.app.getAccessOrigin === 'function' - ) + console.debug('getImagePath 方法存在?', typeof window.app.getImagePath) + console.debug('getImagePath 是函数?', typeof window.app.getImagePath === 'function') } // 等待Flutter注入完成 @@ -51,16 +48,16 @@ export function uploadImgFile(renderFun) { if ( window.app && - window.app.getAccessOrigin && - typeof window.app.getAccessOrigin === 'function' + window.app.getImagePath && + typeof window.app.getImagePath === 'function' ) { - console.debug('Flutter接口检测成功,调用 getAccessOrigin') + console.debug('Flutter接口检测成功,调用 getImagePath') try { - const result = window.app.getAccessOrigin() - console.debug('getAccessOrigin 返回结果:', result) + const result = window.app.getImagePath() + console.debug('getImagePath 返回结果:', result) renderFun(result) } catch (error) { - console.error('调用 getAccessOrigin 出错:', error) + console.error('调用 getImagePath 出错:', error) } } else if (attempts < maxAttempts) { // 继续等待