Commit f4d14069 authored by jiaxu.yan's avatar jiaxu.yan

feat(图片上传): 修改图片上传组件,更换上传地址

parent 51bfceb0
...@@ -9,3 +9,6 @@ VUE_APP_BASE_API = '/dev-api' ...@@ -9,3 +9,6 @@ VUE_APP_BASE_API = '/dev-api'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 图片服务器地址
VUE_APP_IMAGE_API = http://49.232.167.247:22039
\ No newline at end of file
...@@ -6,3 +6,5 @@ ENV = 'production' ...@@ -6,3 +6,5 @@ ENV = 'production'
# 中汽研安全检测平台管理系统/生产环境 # 中汽研安全检测平台管理系统/生产环境
VUE_APP_BASE_API = 'http://49.232.167.247:22032' VUE_APP_BASE_API = 'http://49.232.167.247:22032'
# 图片服务器地址
VUE_APP_IMAGE_API = http://49.232.167.247:22039
\ No newline at end of file
...@@ -8,3 +8,5 @@ ENV = 'staging' ...@@ -8,3 +8,5 @@ ENV = 'staging'
# 中汽研安全检测平台管理系统/测试环境 # 中汽研安全检测平台管理系统/测试环境
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = '/stage-api'
# 图片服务器地址
VUE_APP_IMAGE_API = http://49.232.167.247:22039
\ No newline at end of file
...@@ -80,8 +80,8 @@ export default { ...@@ -80,8 +80,8 @@ export default {
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
hideUpload: false, hideUpload: false,
baseUrl: process.env.VUE_APP_BASE_API, baseUrl: process.env.VUE_APP_IMAGE_API,
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio', // 上传的图片服务器地址
headers: { headers: {
Authorization: 'Bearer ' + getToken() Authorization: 'Bearer ' + getToken()
}, },
...@@ -161,7 +161,8 @@ export default { ...@@ -161,7 +161,8 @@ export default {
// 上传成功回调 // 上传成功回调
handleUploadSuccess(res, file) { handleUploadSuccess(res, file) {
if (res.code === 200) { if (res.code === 200) {
this.uploadList.push({ name: res.fileName, url: res.fileName }) // const Image = process.env.VUE_APP_IMAGE_API + res.url
this.uploadList.push({ name: res.originalFilename, url: res.url })
this.uploadedSuccessfully() this.uploadedSuccessfully()
} else { } else {
this.number-- this.number--
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment