pdf问题修复

dongdingding
付刚 4 years ago
parent fa8d3675c2
commit 8d3b8f3d61

@ -6,4 +6,4 @@ ENV = 'production'
# 管理系统/生产环境-服务器
VUE_APP_BASE_API = 'http://39.101.188.84:9007'
# VUE_APP_BASE_API = 'http://www.jichuanglanhai.com:9007/'

@ -40,11 +40,7 @@
class="el-upload-list__item ele-upload-list__item-content"
v-for="(file, index) in fileList"
>
<el-link
:href="`${baseUrl}${file.url}`"
:underline="false"
target="_blank"
>
<el-link :href="file.url" :underline="false" target="_blank">
<!-- 如果是pdf -->
<div class="pdf_file" v-if="file.url.indexOf('.pdf') !== -1">
<img src="../../assets/images/pdf.png" />
@ -60,7 +56,7 @@
file.url.indexOf('.jpg') !== -1 ||
file.url.indexOf('.jpeg') !== -1
"
:src="baseUrl + file.url"
:src="file.url"
/>
</viewer>
@ -202,8 +198,8 @@ export default {
this.uploadFileUrl = process.env.VUE_APP_BASE_API + "/common/upload";
this.$message.success("上传成功");
this.fileList.push({
name: res.fileName,
url: res.fileName,
name: file.name,
url: file.response.url,
});
this.$emit("input", this.listToString(this.fileList));
},

@ -17,7 +17,7 @@ module.exports = {
// 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath:
process.env.NODE_ENV === "production" ? "/demo/wujiangchangfangweb/" : "./",
process.env.NODE_ENV === "production" ? "/demo/wujiangchangfangweb/" : "/",
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: "dist",
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
@ -34,11 +34,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// 本地
// target: `http://localhost:9007`,
// 服务器
target: `http://39.101.188.84:9007`,
// target: `http://www.jichuanglanhai.com:9007`,
target: `http://localhost:9007`,
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save