test16(KYC页): 测试图片获取和发送接口
This commit is contained in:
parent
1e485fe4ce
commit
6d65bfb7a9
@ -33,11 +33,8 @@ export function uploadImgFile(renderFun) {
|
|||||||
console.debug(Object.keys(window.app))
|
console.debug(Object.keys(window.app))
|
||||||
|
|
||||||
// 检查具体的方法
|
// 检查具体的方法
|
||||||
console.debug('getAccessOrigin 方法存在?', typeof window.app.getAccessOrigin)
|
console.debug('getImagePath 方法存在?', typeof window.app.getImagePath)
|
||||||
console.debug(
|
console.debug('getImagePath 是函数?', typeof window.app.getImagePath === 'function')
|
||||||
'getAccessOrigin 是函数?',
|
|
||||||
typeof window.app.getAccessOrigin === 'function'
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 等待Flutter注入完成
|
// 等待Flutter注入完成
|
||||||
@ -51,16 +48,16 @@ export function uploadImgFile(renderFun) {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
window.app &&
|
window.app &&
|
||||||
window.app.getAccessOrigin &&
|
window.app.getImagePath &&
|
||||||
typeof window.app.getAccessOrigin === 'function'
|
typeof window.app.getImagePath === 'function'
|
||||||
) {
|
) {
|
||||||
console.debug('Flutter接口检测成功,调用 getAccessOrigin')
|
console.debug('Flutter接口检测成功,调用 getImagePath')
|
||||||
try {
|
try {
|
||||||
const result = window.app.getAccessOrigin()
|
const result = window.app.getImagePath()
|
||||||
console.debug('getAccessOrigin 返回结果:', result)
|
console.debug('getImagePath 返回结果:', result)
|
||||||
renderFun(result)
|
renderFun(result)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('调用 getAccessOrigin 出错:', error)
|
console.error('调用 getImagePath 出错:', error)
|
||||||
}
|
}
|
||||||
} else if (attempts < maxAttempts) {
|
} else if (attempts < maxAttempts) {
|
||||||
// 继续等待
|
// 继续等待
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user