update
This commit is contained in:
@ -8,7 +8,9 @@
|
||||
>
|
||||
<template #error>
|
||||
<div class="image-slot">
|
||||
<el-icon><picture-filled /></el-icon>
|
||||
<el-icon>
|
||||
<picture-filled/>
|
||||
</el-icon>
|
||||
</div>
|
||||
</template>
|
||||
</el-image>
|
||||
@ -16,6 +18,7 @@
|
||||
|
||||
<script setup>
|
||||
import {isExternal} from "@/utils/validate";
|
||||
import {resolveStaticUrl} from "@/utils/uri";
|
||||
|
||||
const props = defineProps({
|
||||
src: {
|
||||
@ -37,7 +40,7 @@ const realSrc = computed(() => {
|
||||
if (isExternal(real_src)) {
|
||||
return real_src;
|
||||
}
|
||||
return import.meta.env.VITE_APP_BASE_API + real_src;
|
||||
return resolveStaticUrl(real_src)
|
||||
});
|
||||
|
||||
const realSrcList = computed(() => {
|
||||
@ -47,7 +50,7 @@ const realSrcList = computed(() => {
|
||||
if (isExternal(item)) {
|
||||
return srcList.push(item);
|
||||
}
|
||||
return srcList.push(import.meta.env.VITE_APP_BASE_API + item);
|
||||
return srcList.push(resolveStaticUrl(item));
|
||||
});
|
||||
return srcList;
|
||||
});
|
||||
@ -66,13 +69,16 @@ const realHeight = computed(() =>
|
||||
border-radius: 5px;
|
||||
background-color: #ebeef5;
|
||||
box-shadow: 0 0 5px 1px #ccc;
|
||||
|
||||
:deep(.el-image__inner) {
|
||||
transition: all 0.3s;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.image-slot) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -59,9 +59,9 @@ const useUserStore = defineStore("user", {
|
||||
.then((res) => {
|
||||
const user = res.user;
|
||||
const avatar =
|
||||
/* user.avatar == "" || user.avatar == null
|
||||
!user.avatar
|
||||
? defAva
|
||||
: import.meta.env.VITE_APP_BASE_API + */user.avatar;
|
||||
: import.meta.env.VITE_APP_BASE_API + user.avatar.substring(user.avatar.indexOf("/file"));
|
||||
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
|
9
src/utils/uri.js
Normal file
9
src/utils/uri.js
Normal file
@ -0,0 +1,9 @@
|
||||
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}`
|
||||
}
|
||||
}
|
@ -50,10 +50,12 @@
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
<el-button icon="refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>重置
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -66,7 +68,8 @@
|
||||
icon="plus"
|
||||
size="default"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>新增
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
@ -86,7 +89,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="图片" prop="images" align="center">
|
||||
<template #default="{ row }">
|
||||
<ImagePreview :width="50" :height="50" :src="row.images" />
|
||||
<ImagePreview :width="50" :height="50"
|
||||
:src="row.images"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="建议上传图片尺寸" prop="sizes" align="center"/>
|
||||
@ -111,14 +115,16 @@
|
||||
type="text"
|
||||
icon="edit"
|
||||
@click="handleUpdate(row)"
|
||||
>编辑</el-button
|
||||
>编辑
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="delete"
|
||||
@click="handleDelete(row)"
|
||||
>删除</el-button
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -163,7 +169,8 @@
|
||||
style="margin-left: 15px"
|
||||
@click="addDomain"
|
||||
v-if="form.domains ? (form.domains.length ? false : true) : false"
|
||||
>添加子节点</el-button
|
||||
>添加子节点
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -183,13 +190,15 @@
|
||||
<el-button
|
||||
style="margin-left: 30px"
|
||||
@click.prevent="removeDomain(domain)"
|
||||
>删除</el-button
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="index + 1 == form.domains.length"
|
||||
type="primary"
|
||||
@click="addDomain"
|
||||
>添加</el-button
|
||||
>添加
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -226,6 +235,7 @@ import {
|
||||
import {tenantSelect} from "@/api/subPlatform/tenant";
|
||||
import {reactive, toRefs} from "vue";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {resolveStaticUrl} from "@/utils/uri";
|
||||
|
||||
const loading = ref(true); // 是否正在加载
|
||||
const showSearch = ref(true); // 是否显示搜索栏
|
||||
@ -260,7 +270,7 @@ const data = reactive({
|
||||
],
|
||||
local: [{required: true, message: "所在位置不能为空", trigger: "change"}],
|
||||
title: [{required: true, message: "数据名称不能为空", trigger: "blur"}],
|
||||
sizes: [{ required: true, message: "建议尺寸不能为空", trigger: "blur" }],
|
||||
// sizes: [{required: true, message: "建议尺寸不能为空", trigger: "blur"}],
|
||||
images: [
|
||||
{
|
||||
required: true,
|
||||
@ -411,7 +421,8 @@ const handleDelete = (row) => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
getList();
|
||||
getSiteList();
|
||||
|
@ -51,10 +51,12 @@
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
<el-button icon="refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>重置
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -67,7 +69,8 @@
|
||||
icon="plus"
|
||||
size="default"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>新增
|
||||
</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
@ -84,7 +87,7 @@
|
||||
<div>
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="row.image"
|
||||
:src="resolveStaticUrl(row.image)"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
</div>
|
||||
@ -117,14 +120,16 @@
|
||||
type="text"
|
||||
icon="edit"
|
||||
@click="handleUpdate(row)"
|
||||
>编辑</el-button
|
||||
>编辑
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
icon="delete"
|
||||
@click="handleDelete(row)"
|
||||
>删除</el-button
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -214,6 +219,7 @@ import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {cloneDeep} from "lodash";
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
import {resolveStaticUrl} from "@/utils/uri";
|
||||
|
||||
const dataList = ref([]);
|
||||
// TODO:isSuper
|
||||
@ -377,7 +383,8 @@ const handleDelete = (row) => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
getList();
|
||||
|
@ -63,7 +63,7 @@
|
||||
<div>
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="row.image"
|
||||
:src="resolveStaticUrl(row.image)"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
</div>
|
||||
@ -185,6 +185,7 @@ import {
|
||||
import WangEditor from "@/components/WangEditor/index.vue";
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
import {planCategoryList} from "../../../../api/website/solution";
|
||||
import {resolveStaticUrl} from "@/utils/uri";
|
||||
|
||||
const dataList = ref([]);
|
||||
const loading = ref(true);
|
||||
|
@ -32,7 +32,7 @@ export default defineConfig(({ mode, command }) => {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
"/dev-api": {
|
||||
// target: "http://192.168.110.10:1618",
|
||||
target: 'http://101.34.131.16:81/api',
|
||||
target: 'http://119.45.197.174:81/api',
|
||||
// target: "http://101.34.251.155:81/api",
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||
|
Reference in New Issue
Block a user