| | |
| | | let res = await upload(formData); // 调取 接口 |
| | | console.log(res); |
| | | if (res.code == 200) { |
| | | // const path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | let path = ""; |
| | | if(import.meta.env.VITE_APP_ENV == 'development') { |
| | | path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | }else { |
| | | path = '/api/' + res.data.path |
| | | } |
| | | |
| | | const path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | // let path = ""; |
| | | // if(import.meta.env.VITE_APP_ENV == 'development') { |
| | | // path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | // }else { |
| | | // path = '/api/' + res.data.path |
| | | // } |
| | | |
| | | success(path); |
| | | } else { |
| | |
| | | await upload(formData).then(res => { |
| | | console.log(res); |
| | | if (res.code == 200) { |
| | | const path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | // let path = ""; |
| | | // if(import.meta.env.VITE_APP_ENV == 'development') { |
| | | // path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | // }else { |
| | | // path = '/api/' + res.data.path |
| | | // } |
| | | |
| | | let path = ""; |
| | | if(import.meta.env.VITE_APP_ENV == 'development') { |
| | | path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | }else { |
| | | path = '/api/' + res.data.path |
| | | } |
| | | // const path = import.meta.env.VITE_APP_BASE_API + '/' + res.data.path |
| | | // const path = '/api/' + res.data.path |
| | | success(path,res.data); |
| | | } else { |
| | | console.log("上传失败"); |