Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] 修正: uploader组件支持企业微信 #5691 #5914

Open
shiyl962 opened this issue Oct 18, 2024 · 0 comments
Open

[Bug Report] 修正: uploader组件支持企业微信 #5691 #5914

shiyl962 opened this issue Oct 18, 2024 · 0 comments

Comments

@shiyl962
Copy link

重现链接

#5691 (comment)

Vant Weapp 版本

1.11.0 +

描述一下你遇到的问题。

如题

重现步骤

由于组件未处理企业微信环境下的api调用导致此问题,修改 \dist\vant-weapp\uploader\utils.js 的

export function chooseFile(...) {
   ....
default:
    //wx.chooseMessageFile(Object.assign(Object.assign({ count: multiple ? maxCount : 1, type: accept }, (extension ? { extension } : {})), { success: (res) => resolve(formatFile(res)), fail: reject }));
    const chooseOpts = Object.assign(Object.assign({ count: multiple ? maxCount : 1, type: accept }, (extension ? { extension } : {})), { success: (res) => resolve(formatFile(res)), fail: reject })
    if (isWxWork) {
      wx.qy.checkSession({
        success: () => {
          const qyOpts = Object.assign({
            fail: (ex) => { console.log('vant-weapp-uploader chooseFile failed =>', ex) },
            complete: (res) => { console.log('vant-weapp-uploader chooseFile complete =>', res) }
          }, chooseOpts)
          wx.qy.chooseMessageFile(qyOpts)
        },
        fail: () => { console.log('vant-weapp-uploader chooseFile: session_key 已经失效') }
      })
    }
    else {
      wx.chooseMessageFile(chooseOpts);
    }
    break;
   ....
}

经实机测试,问题修复

设备/浏览器

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant