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

taro3.6.4 版本uploadFile方法上传文件,formData 中的参数丢掉 #17003

Open
vivi-wei opened this issue Dec 11, 2024 · 0 comments
Open

Comments

@vivi-wei
Copy link

相关平台

微信小程序

小程序基础库: 3.5.8
使用框架: Vue 3

复现步骤

Taro.uploadFile({
  url: baseHost   '/ai/file', // 文件上传的地址
  filePath,
  name: 'file', // 请求的 key,后端接收用
  formData: {
    type: fileType, // 传递文件类型到后端
    image: true,
  },

后端需要接收image参数才会返回上传文件的地址,之前使用这种方式是可以正常上传,某一次构建之后,后端就接受不到image这个参数,尝试之后发现把 image: true 改成 image: 'true' 就又可以了。

期望结果

为什么 之前 image传布尔值是可以的

实际结果

现在image 传布尔值,后端接收不到image参数

环境信息

Taro v4.0.8


  Taro CLI 4.0.8 environment info:
    System:
      OS: macOS 11.6.8
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 22.4.0 - ~/.nvm/versions/node/v22.4.0/bin/node
      Yarn: 1.22.18 - /usr/local/bin/yarn
      npm: 10.8.1 - ~/.nvm/versions/node/v22.4.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.4 => 3.6.4 
      @tarojs/components: 3.6.4 => 3.6.4 
      @tarojs/helper: 3.6.4 => 3.6.4 
      @tarojs/plugin-framework-vue3: 3.6.4 => 3.6.4 
      @tarojs/plugin-html: ^3.6.4 => 3.6.18 
      @tarojs/plugin-platform-alipay: 3.6.4 => 3.6.4 
      @tarojs/plugin-platform-h5: 3.6.4 => 3.6.4 
      @tarojs/plugin-platform-jd: 3.6.4 => 3.6.4 
      @tarojs/plugin-platform-qq: 3.6.4 => 3.6.4 
      @tarojs/plugin-platform-swan: 3.6.4 => 3.6.4 
      @tarojs/plugin-platform-tt: 3.6.4 => 3.6.4 
      @tarojs/plugin-platform-weapp: 3.6.4 => 3.6.4 
      @tarojs/runtime: 3.6.4 => 3.6.4 
      @tarojs/shared: 3.6.4 => 3.6.4 
      @tarojs/taro: 3.6.4 => 3.6.4 
      @tarojs/webpack5-runner: 3.6.4 => 3.6.4 
      babel-preset-taro: 3.6.4 => 3.6.4 
      eslint-config-taro: 3.6.4 => 3.6.4 
This was referenced Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant