test16(KYC页): 测试图片获取和发送接口

This commit is contained in:
hzj 2025-11-12 19:57:43 +08:00
parent 1e485fe4ce
commit 6d65bfb7a9

View File

@ -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) {
// 继续等待