| | |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 客服企微二维码上传(staff 的 service_qrcode_url 列) |
| | | // 与 api/user/provider.js 的 uploadLicense 是同一个后端接口:ruoyi-file 在网关上是 |
| | | // 与 ruoyi-system 并列的独立路由(Path=/file/** → 9300),url 不带 /system 前缀。 |
| | | // |
| | | // Content-Type 必须显式写成 multipart/form-data,不能跟着全局 json 头走: |
| | | // utils/request.js 把 axios 默认头设成了 application/json;charset=utf-8,而 axios 1.x 的 |
| | | // transformRequest 见到「json 头 + FormData」会走 JSON.stringify(formDataToJSON(data)), |
| | | // 文件被序列化成 JSON 对象发出去 —— 后端收到空 MultipartFile,表现为「上传成功但没图」。 |
| | | // 写成 multipart/form-data(不带 boundary),浏览器适配器会清掉这个头, |
| | | // 由浏览器自己补上带 boundary 的版本。 |
| | | export function uploadQrcode(data) { |
| | | return request({ |
| | | url: '/file/upload', |
| | | method: 'post', |
| | | headers: { 'Content-Type': 'multipart/form-data' }, |
| | | data: data |
| | | }) |
| | | } |