update
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import request from "@/utils/request";
|
||||
import { resolveStaticUrl } from "@/utils/url";
|
||||
|
||||
// 获取首页统计
|
||||
export function getAllCount() {
|
||||
@ -54,6 +55,14 @@ export function banner(params) {
|
||||
url: "/app/config/list",
|
||||
method: "get",
|
||||
params,
|
||||
}).then((resp) => {
|
||||
resp.data.map((el) => {
|
||||
if (el.images) {
|
||||
el.images = resolveStaticUrl(el.images);
|
||||
}
|
||||
return el;
|
||||
});
|
||||
return resp;
|
||||
});
|
||||
}
|
||||
|
||||
@ -281,7 +290,7 @@ export const getEnterpriseMap = () =>
|
||||
|
||||
// /app/map/achievementMap
|
||||
export const getAchievementMap = () =>
|
||||
request({
|
||||
url: "/app/map/achievementMap",
|
||||
method: "get",
|
||||
});
|
||||
request({
|
||||
url: "/app/map/achievementMap",
|
||||
method: "get",
|
||||
});
|
||||
|
8
src/utils/url.js
Normal file
8
src/utils/url.js
Normal file
@ -0,0 +1,8 @@
|
||||
export const resolveStaticUrl = (url) => {
|
||||
const fileIndex = url.indexOf("file");
|
||||
if (fileIndex > 0) {
|
||||
return `${import.meta.env.VITE_APP_BASE_API}/${url.substring(fileIndex)}`;
|
||||
} else {
|
||||
return `${import.meta.env.VITE_APP_BASE_API}/file/${url}`;
|
||||
}
|
||||
};
|
@ -76,7 +76,7 @@
|
||||
<div class="_l">
|
||||
<el-image
|
||||
style="width: 358px; height: 220px; vertical-align: middle"
|
||||
:src="item.image"
|
||||
:src="resolveStaticUrl(item.image)"
|
||||
fit="fill"
|
||||
></el-image>
|
||||
</div>
|
||||
@ -313,6 +313,7 @@ import {
|
||||
import { ElMessage } from "element-plus";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { resolveStaticUrl } from "@/utils/url";
|
||||
|
||||
console.log(activeQrCode);
|
||||
// import { omit } from "lodash";
|
||||
|
@ -45,7 +45,7 @@
|
||||
</h3>
|
||||
<div class="_info conter1000">
|
||||
<div v-if="isOddEvenNumber(index)" class="_r">
|
||||
<img :src="item.image" alt srcset />
|
||||
<img :src="resolveStaticUrl(item.image)" alt srcset />
|
||||
</div>
|
||||
<div
|
||||
:class="isOddEvenNumber(index) ? '_paddingl' : '_paddingr'"
|
||||
@ -58,7 +58,7 @@
|
||||
<p>{{ item[descriptionField] }}</p>
|
||||
</div>
|
||||
<div v-if="!isOddEvenNumber(index)" class="_r">
|
||||
<img :src="item.image" alt srcset />
|
||||
<img :src="resolveStaticUrl(item.image)" alt srcset />
|
||||
</div>
|
||||
</div>
|
||||
<div class="_list conter1400">
|
||||
@ -69,12 +69,14 @@
|
||||
@click="handlePath(child.id)"
|
||||
>
|
||||
<el-image
|
||||
:src="child.image"
|
||||
:src="resolveStaticUrl(child.image)"
|
||||
fit="cover"
|
||||
style="width: 100%; height: 135px"
|
||||
></el-image>
|
||||
<div class="_head text_hidden">{{ child[titleField] }}</div>
|
||||
<div class="_detail text_hidden">{{ child[descriptionField] }}</div>
|
||||
<div class="_detail text_hidden">
|
||||
{{ child[descriptionField] }}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="_liBtn text-right">
|
||||
@ -102,6 +104,7 @@ import { banner } from "@/api/website/home/index";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { getCase } from "@/api/website/solution";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { resolveStaticUrl } from "@/utils/url";
|
||||
// import { getCategory } from "../../../api/website/solution";
|
||||
|
||||
const router = useRouter();
|
||||
|
@ -21,7 +21,7 @@ const route = useRoute();
|
||||
width: 100%;
|
||||
.content {
|
||||
width: 100%;
|
||||
padding-top: 80px;
|
||||
padding-top: 160px;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user