上传图片和附件路径调整为相对路径
This commit is contained in:
parent
9ec6e7a515
commit
f7bdee8d14
2
.env.dev
2
.env.dev
@ -6,6 +6,8 @@ VUE_APP_TITLE = "车联通"后台管理系统
|
|||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
VUE_APP_BASE_API = 'http://localhost:48080'
|
VUE_APP_BASE_API = 'http://localhost:48080'
|
||||||
|
# 附件请求地址前缀
|
||||||
|
VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
@ -9,6 +9,8 @@ VUE_APP_BASE_API = '/prod-api'
|
|||||||
|
|
||||||
# 根据服务器或域名修改
|
# 根据服务器或域名修改
|
||||||
PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
||||||
|
# 附件请求地址前缀
|
||||||
|
VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
|
||||||
# 二级部署路径
|
# 二级部署路径
|
||||||
VUE_APP_APP_NAME ='yudao-admin'
|
VUE_APP_APP_NAME ='yudao-admin'
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
number: 0,
|
number: 0,
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
|
viewFileUrl: process.env.VUE_APP_FILE_API,
|
||||||
baseUrl: process.env.VUE_APP_BASE_API,
|
baseUrl: process.env.VUE_APP_BASE_API,
|
||||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
||||||
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
||||||
@ -88,7 +89,7 @@ export default {
|
|||||||
// 然后将数组转为对象数组
|
// 然后将数组转为对象数组
|
||||||
this.fileList = list.map(item => {
|
this.fileList = list.map(item => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: this.viewFileUrl+item };
|
||||||
}
|
}
|
||||||
item.uid = item.uid || new Date().getTime() + temp++;
|
item.uid = item.uid || new Date().getTime() + temp++;
|
||||||
return item;
|
return item;
|
||||||
|
@ -88,6 +88,7 @@ export default {
|
|||||||
number: 0,
|
number: 0,
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
baseUrl: "",
|
baseUrl: "",
|
||||||
|
viewFileUrl: process.env.VUE_APP_FILE_API,
|
||||||
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
||||||
fileList: [],
|
fileList: [],
|
||||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/uploadDetail", // 请求地址
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/uploadDetail", // 请求地址
|
||||||
@ -110,7 +111,7 @@ export default {
|
|||||||
const list = Array.isArray(val)? val : this.value.split(",");
|
const list = Array.isArray(val)? val : this.value.split(",");
|
||||||
this.fileList = list.map((item) => {
|
this.fileList = list.map((item) => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: this.viewFileUrl+item };
|
||||||
}
|
}
|
||||||
item.uid = item.uid || new Date().getTime() + temp++;
|
item.uid = item.uid || new Date().getTime() + temp++;
|
||||||
return item;
|
return item;
|
||||||
@ -134,7 +135,7 @@ export default {
|
|||||||
const list = Array.isArray(this.value)? this.value : this.value.split(",");
|
const list = Array.isArray(this.value)? this.value : this.value.split(",");
|
||||||
this.fileList = list.map((item) => {
|
this.fileList = list.map((item) => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: this.viewFileUrl+item };
|
||||||
}
|
}
|
||||||
item.uid = item.uid || new Date().getTime() + temp++;
|
item.uid = item.uid || new Date().getTime() + temp++;
|
||||||
return item;
|
return item;
|
||||||
|
@ -76,6 +76,7 @@ export default {
|
|||||||
dialogImageUrl: "",
|
dialogImageUrl: "",
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
hideUpload: false,
|
hideUpload: false,
|
||||||
|
viewFileUrl: process.env.VUE_APP_FILE_API,
|
||||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
||||||
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
||||||
fileList: []
|
fileList: []
|
||||||
@ -91,7 +92,7 @@ export default {
|
|||||||
this.fileList = list.map(item => {
|
this.fileList = list.map(item => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
// edit by 芋道源码
|
// edit by 芋道源码
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: this.viewFileUrl+item };
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user