From 7d0b7f478d812933b3dc3721095f7d5d8df44238 Mon Sep 17 00:00:00 2001 From: zhangxiao <898441624@qq.com> Date: 星期五, 09 八月 2024 20:08:49 +0800 Subject: [PATCH] fix: 上传图片修改 --- .env.development | 2 src/views/dmx/model/index.vue | 8 src/store/modules/user/index.ts | 7 src/store/modules/user/types.ts | 1 src/components/upload/index.vue | 9 src/views/dmx/knowledgeLib/tool.vue | 772 +++++++++++++++++++++++++++--------------------------- .env.production | 1 src/views/dmx/model/components/addTableName.vue | 15 src/views/dmx/model/components/addPageModel.vue | 19 + src/views/login/components/login-form.vue | 4 10 files changed, 439 insertions(+), 399 deletions(-) diff --git a/.env.development b/.env.development index ab9243a..9df3da8 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,2 @@ VUE_APP_BASE_API=/api/v1 -VITE_API_BASE_URL= 'http://192.168.20.116:1080' \ No newline at end of file +VITE_API_BASE_URL= 'http://192.168.20.158:1080' \ No newline at end of file diff --git a/.env.production b/.env.production index e69de29..c1e4cc7 100644 --- a/.env.production +++ b/.env.production @@ -0,0 +1 @@ +VUE_APP_BASE_API=/api/v1 \ No newline at end of file diff --git a/src/components/upload/index.vue b/src/components/upload/index.vue index ffae588..b58aeaf 100644 --- a/src/components/upload/index.vue +++ b/src/components/upload/index.vue @@ -11,6 +11,9 @@ <script setup> import { computed, ref, onMounted, watch, watchEffect } from 'vue'; + import { useUserStore } from '@/store'; + + const userStore = useUserStore(); const props = defineProps({ limit: { type: Number, @@ -50,6 +53,12 @@ url: item, })); } + + // console.log( + // window.location.origin, + // import.meta.env.VITE_API_BASE_URL, + // 8988 + // ); }); // console.log(urls.value, 8988); diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index 0a3e0d3..51faef3 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -30,6 +30,7 @@ certification: undefined, role: '', resources:undefined, + hrefUrl:undefined }), getters: { @@ -67,6 +68,7 @@ async login(loginForm: LoginData):string { try { const res = await userLogin(loginForm); + setToken(res.data.access_token); const userInfo = { avatar: res.data.avatar, @@ -101,6 +103,11 @@ this.logoutCallBack(); } }, + + + getHreFurl(url: string) { + this.hrefUrl=url + }, }, }); diff --git a/src/store/modules/user/types.ts b/src/store/modules/user/types.ts index 71fae3f..56bbc28 100644 --- a/src/store/modules/user/types.ts +++ b/src/store/modules/user/types.ts @@ -17,4 +17,5 @@ certification?: number; role: RoleType; resources:any; + hrefUrl?: string; } diff --git a/src/views/dmx/knowledgeLib/tool.vue b/src/views/dmx/knowledgeLib/tool.vue index 9fc3e64..572b6d0 100644 --- a/src/views/dmx/knowledgeLib/tool.vue +++ b/src/views/dmx/knowledgeLib/tool.vue @@ -41,14 +41,15 @@ auto-label-width @submit="handleSubmit" > - <a-divider style="margin-top: 10px" - v-if=" - form.parser_id === 'naive'" /> + <a-divider + style="margin-top: 10px" + v-if="form.parser_id === 'naive'" + /> <a-form-item field="slider" label="鍧桾oken鏁�" - v-if=" - form.parser_id === 'naive'"> + v-if="form.parser_id === 'naive'" + > <a-slider v-model="form.chunk_token_num" :min="0" @@ -56,18 +57,27 @@ show-input /> </a-form-item> - <a-divider style="margin-top: 10px" - v-if="form.parser_id === 'naive' || - form.parser_id === 'qa'|| - form.parser_id === 'manual' || - form.parser_id === 'laws' || - form.parser_id === 'book'" /> - <a-form-item field="raptor" label="浣跨敤鍙洖澧炲己RAPTOR绛栫暐" - v-if="form.parser_id === 'naive' || - form.parser_id === 'qa'|| - form.parser_id === 'manual' || - form.parser_id === 'laws' || - form.parser_id === 'book'"> + <a-divider + style="margin-top: 10px" + v-if=" + form.parser_id === 'naive' || + form.parser_id === 'qa' || + form.parser_id === 'manual' || + form.parser_id === 'laws' || + form.parser_id === 'book' + " + /> + <a-form-item + field="raptor" + label="浣跨敤鍙洖澧炲己RAPTOR绛栫暐" + v-if=" + form.parser_id === 'naive' || + form.parser_id === 'qa' || + form.parser_id === 'manual' || + form.parser_id === 'laws' || + form.parser_id === 'book' + " + > <a-space direction="vertical" size="large"> <a-switch v-model="form.use_raptor" @@ -144,9 +154,8 @@ style="margin-left: 10px" type="primary" html-type="submit" - >纭畾 - </a-button - > + >纭畾 + </a-button> </div> </a-form-item> </a-form> @@ -181,9 +190,8 @@ type="outline" class="button" style="margin-right: 10px" - >鎵归噺 - <icon-down style="margin-left: 4px" - /> + >鎵归噺 + <icon-down style="margin-left: 4px" /> </a-button> <template #content> <a-space direction="vertical"> @@ -272,8 +280,7 @@ class="button" style="margin-right: 10px" > - <icon-sort - /> + <icon-sort /> </a-button> <template #content> <a-radio-group @@ -340,394 +347,385 @@ </template> <script lang="ts" setup> -import { - onMounted, - onBeforeMount, - reactive, - ref, - computed, - watch -} from "vue"; -import { Message } from "@arco-design/web-vue"; -import { - kbdocumentchangeparser, - achunkCreate, - queryChunkList, - chunkSwitch, - chunkRm, achunkGet -} from "@/api/kbList"; -import addDetails from "@/views/dmx/knowledgeLib/addDetails.vue"; -import eidtDetails from "@/views/dmx/knowledgeLib/eidtDetails.vue"; + import { + onMounted, + onBeforeMount, + reactive, + ref, + computed, + watch, + } from 'vue'; + import { Message } from '@arco-design/web-vue'; + import { + kbdocumentchangeparser, + achunkCreate, + queryChunkList, + chunkSwitch, + chunkRm, + achunkGet, + } from '@/api/kbList'; + import addDetails from '@/views/dmx/knowledgeLib/addDetails.vue'; + import eidtDetails from '@/views/dmx/knowledgeLib/eidtDetails.vue'; -const visible = ref(false); -const loading = ref(false); -const radio = ref("1"); -const keyBg = ref(""); -const eidtDil = ref(); -const eidtDilVisible = ref(false); -const eidtDilinfo = reactive({}); + const visible = ref(false); + const loading = ref(false); + const radio = ref('1'); + const keyBg = ref(''); + const eidtDil = ref(); + const eidtDilVisible = ref(false); + const eidtDilinfo = reactive({}); -const props = defineProps(["kbtenantInfo", "item", "kbdetail"]); -// const emit = defineEmits(['upTabdateItem']) + const props = defineProps(['kbtenantInfo', 'item', 'kbdetail']); + // const emit = defineEmits(['upTabdateItem']) -let threshold = computed(() => { - return form.threshold / 100; -}); - -const kbtenantInfo = props.kbtenantInfo; - -let parser_ids = kbtenantInfo.parser_ids.split(",").map((item) => { - const [value1, value2] = item.split(":"); - return { - name: value2, - value: value1 - }; -}); - -// 杩囨护瑙f瀽鏂规硶 - -const filterParserArr = [ - 'naive', - 'qa', - 'resume', - 'manual', - 'book', - 'laws', - 'one', -] - - - - - -const isBtn = ref(true); - -const closeSlelct = () => { - window.addEventListener("click", (event) => { - if (!event.target.closest(".space_search") && !isBtn.value) { - isBtn.value = true; - // form.keywords = ''; - } - }); -}; - -watch(isBtn, (val) => { - if (!val) { - closeSlelct(); - } -}); - -const form = reactive({ - parser_id: '', - doc_id: props.item.id, - max_token: 698, - threshold: 0.3, - max_cluster: 233, - random_seed: 1500, - chunk_token_num: 128, - use_raptor: false, - keywords: "", - pages: {}, - prompt: - "璇锋�荤粨浠ヤ笅娈佃惤銆� 灏忓績鏁板瓧锛屼笉瑕佺紪閫犮�� 娈佃惤濡備笅锛歕n" + - " {cluster_content}\n" + - "浠ヤ笂灏辨槸浣犻渶瑕佹�荤粨鐨勫唴瀹广��" -}); -const formRef = ref(null); -const rules = { - prompt: [ - { - required: true, - message: "鎻愮ず璇嶄笉鍏佽涓虹┖" - } - ] -}; - -const listData = ref([]); - -const formatter = (value) => { - return value / 100; -}; - -function randomNumber() { - // 鐢熸垚涓�涓粙浜巑in鍜宮ax涔嬮棿鐨勯殢鏈烘暣鏁帮紙鍖呭惈min鍜宮ax锛� - const min = 1; // 鏈�灏忓�� - const max = 10000; // 鏈�澶у�� - form.random_seed = Math.floor(Math.random() * (max - min + 1)) + min; -} - -const handleSubmit = async ({ values, errors }) => { - if (!errors) { - let data = await kbdocumentchangeparser({ - parser_id: form.parser_id, - doc_id: form.doc_id, - parser_config: { - raptor: { - use_raptor: form.use_raptor, - prompt: form.prompt, - max_token: form.max_token, - threshold: form.threshold, - max_cluster: form.max_cluster, - random_seed: form.random_seed - }, - chunk_token_num: form.chunk_token_num, - pages: [] - } - }); - if (data.code == 0) { - Message.success("閰嶇疆鎴愬姛"); - } else { - Message.error("閰嶇疆澶辫触"); - } - visible.value = false; - } -}; - -const handleClick = () => { - visible.value = true; -}; -const handleCancel = () => { - visible.value = false; -}; - -const contentClick = async (item) => { - try { - const data = await achunkGet({ - chunk_id: item.chunk_id - }); - // console.log(data.data); - Object.assign(eidtDilinfo, data.data); - eidtDilVisible.value = true; - } catch (error) { - Message.error("鑾峰彇澶辫触"); - } - - -}; -const handleOpened = (el) => { - // console.log('props',props.kbtenantInfo); - console.log('props',props.item); - // console.log('props',props.kbdetail); - console.log(parser_ids, "parser_ids"); - let parser_id = props.item.parser_id; - parser_ids.forEach((item) => { - if (item.name == parser_id) { - form.parser_id = item.value; - } + let threshold = computed(() => { + return form.threshold / 100; }); + const kbtenantInfo = props.kbtenantInfo; - // Object.assign(form,{ - // name: '',// 鐢ㄦ埛鍚� - // nameJoin: '',// 鏄电О - // post: '',// 宀椾綅 - // txt: '',// 澶囨敞 - // }); - // formRef.value.resetFields(); - console.log(props.item.id); -}; - -const onChangeRAPTOR = () => { -}; - -const indeterminate = ref(false); -const checkedAll = ref(false); -const data = ref([]); -const switchType = ref(false); -const available_int = ref(""); -const onRadioChange = () => { - console.log(radio.value); -}; -//鎵归噺鎿嶄綔 -const handleChangeAll = (value) => { - indeterminate.value = false; - if (value) { - checkedAll.value = true; - listData.value.forEach((item) => { - data.value.push(item.chunk_id); - }); - } else { - checkedAll.value = false; - data.value = []; - } -}; - -const handleChange = (values) => { - data.value = values; -}; - -//鎵归噺鍚敤鍒犻櫎绂佺敤 -const addBlock = (type) => { - if (data.value.length == 0) { - Message.error("璇烽�夋嫨瑕佹搷浣滅殑鏁版嵁"); - return; - } - if (type == 3) { - deleteChunk(); - } else { - let params = { - chunk_ids: data.value, - available_int: type, - doc_id: props.item.id + let parser_ids = kbtenantInfo.parser_ids.split(',').map((item) => { + const [value1, value2] = item.split(':'); + return { + name: value2, + value: value1, }; - chunkSwitch(params).then((res) => { - if (res.code == 0) { - Message.success("鎿嶄綔鎴愬姛"); - getList(); - checkedAll.value = false; - data.value = []; - } else { - Message.error("鎿嶄綔澶辫触"); + }); + + // 杩囨护瑙f瀽鏂规硶 + + const filterParserArr = [ + 'naive', + 'qa', + 'resume', + 'manual', + 'book', + 'laws', + 'one', + ]; + + const isBtn = ref(true); + + const closeSlelct = () => { + window.addEventListener('click', (event) => { + if (!event.target.closest('.space_search') && !isBtn.value) { + isBtn.value = true; + // form.keywords = ''; } }); - } -}; - -const groupListContentClick = (value) => { - keyBg.value = value; -}; - -const onChangeavailable = () => { - getList(); -}; - -const handleChangeStatus = (val) => { - updateChunkStatus(val); -}; -const isLoading = ref(true); -// 鑷畾涔夊姞杞芥彁绀烘枃鏈� -const tip = "鍔犺浇涓紝璇风◢鍊�..."; -//鑾峰彇鍒楄〃 -const getList = async () => { - let params = { - doc_id: props.item.id, - keywords: form.keywords, - page: 1, - size: 10000 }; - if (available_int.value !== "") { - params.available_int = available_int.value; + + watch(isBtn, (val) => { + if (!val) { + closeSlelct(); + } + }); + + const form = reactive({ + parser_id: '', + doc_id: props.item.id, + max_token: 698, + threshold: 0.3, + max_cluster: 233, + random_seed: 1500, + chunk_token_num: 128, + use_raptor: false, + keywords: '', + pages: {}, + prompt: + '璇锋�荤粨浠ヤ笅娈佃惤銆� 灏忓績鏁板瓧锛屼笉瑕佺紪閫犮�� 娈佃惤濡備笅锛歕n' + + ' {cluster_content}\n' + + '浠ヤ笂灏辨槸浣犻渶瑕佹�荤粨鐨勫唴瀹广��', + }); + const formRef = ref(null); + const rules = { + prompt: [ + { + required: true, + message: '鎻愮ず璇嶄笉鍏佽涓虹┖', + }, + ], + }; + + const listData = ref([]); + + const formatter = (value) => { + return value / 100; + }; + + function randomNumber() { + // 鐢熸垚涓�涓粙浜巑in鍜宮ax涔嬮棿鐨勯殢鏈烘暣鏁帮紙鍖呭惈min鍜宮ax锛� + const min = 1; // 鏈�灏忓�� + const max = 10000; // 鏈�澶у�� + form.random_seed = Math.floor(Math.random() * (max - min + 1)) + min; } - await queryChunkList(params).then((res) => { - if (res.code == 0) { - listData.value = res.data.chunks; - isLoading.value = false; - listData.value = listData.value.map((item) => { - item.available_int = parseInt(item.available_int); - return item; + + const handleSubmit = async ({ values, errors }) => { + if (!errors) { + let data = await kbdocumentchangeparser({ + parser_id: form.parser_id, + doc_id: form.doc_id, + parser_config: { + raptor: { + use_raptor: form.use_raptor, + prompt: form.prompt, + max_token: form.max_token, + threshold: form.threshold, + max_cluster: form.max_cluster, + random_seed: form.random_seed, + }, + chunk_token_num: form.chunk_token_num, + pages: [], + }, + }); + if (data.code == 0) { + Message.success('閰嶇疆鎴愬姛'); + } else { + Message.error('閰嶇疆澶辫触'); + } + visible.value = false; + } + }; + + const handleClick = () => { + visible.value = true; + }; + const handleCancel = () => { + visible.value = false; + }; + + const contentClick = async (item) => { + try { + const data = await achunkGet({ + chunk_id: item.chunk_id, + }); + // console.log(data.data); + Object.assign(eidtDilinfo, data.data); + eidtDilVisible.value = true; + } catch (error) { + Message.error('鑾峰彇澶辫触'); + } + }; + const handleOpened = (el) => { + // console.log('props',props.kbtenantInfo); + console.log('props', props.item); + // console.log('props',props.kbdetail); + console.log(parser_ids, 'parser_ids'); + let parser_id = props.item.parser_id; + parser_ids.forEach((item) => { + if (item.name == parser_id) { + form.parser_id = item.value; + } + }); + + // Object.assign(form,{ + // name: '',// 鐢ㄦ埛鍚� + // nameJoin: '',// 鏄电О + // post: '',// 宀椾綅 + // txt: '',// 澶囨敞 + // }); + // formRef.value.resetFields(); + console.log(props.item.id); + }; + + const onChangeRAPTOR = () => {}; + + const indeterminate = ref(false); + const checkedAll = ref(false); + const data = ref([]); + const switchType = ref(false); + const available_int = ref(''); + const onRadioChange = () => { + console.log(radio.value); + }; + //鎵归噺鎿嶄綔 + const handleChangeAll = (value) => { + indeterminate.value = false; + if (value) { + checkedAll.value = true; + listData.value.forEach((item) => { + data.value.push(item.chunk_id); + }); + } else { + checkedAll.value = false; + data.value = []; + } + }; + + const handleChange = (values) => { + data.value = values; + }; + + //鎵归噺鍚敤鍒犻櫎绂佺敤 + const addBlock = (type) => { + if (data.value.length == 0) { + Message.error('璇烽�夋嫨瑕佹搷浣滅殑鏁版嵁'); + return; + } + if (type == 3) { + deleteChunk(); + } else { + let params = { + chunk_ids: data.value, + available_int: type, + doc_id: props.item.id, + }; + chunkSwitch(params).then((res) => { + if (res.code == 0) { + Message.success('鎿嶄綔鎴愬姛'); + getList(); + checkedAll.value = false; + data.value = []; + } else { + Message.error('鎿嶄綔澶辫触'); + } }); } - }); -}; -//鏇存柊鍒楄〃 -const canplaythrough = () => { - getList(); -}; - -//鍚敤绂佺敤 -const updateChunkStatus = (val) => { - let params = { - chunk_ids: [val.chunk_id], - available_int: val.available_int, - doc_id: props.item.id }; - chunkSwitch(params).then((res) => { - console.log(res); - if (res.code == 0) { - Message.success("鏇存柊鎴愬姛"); - getList(); - } else { - Message.error("鏇存柊澶辫触"); - } - }); -}; -//鍒犻櫎 -const deleteChunk = () => { - let params = { - chunk_ids: data.value, - doc_id: props.item.id + const groupListContentClick = (value) => { + keyBg.value = value; }; - chunkRm(params).then((res) => { - console.log(res); - if (res.code == 0) { - Message.success("鍒犻櫎鎴愬姛"); - getList(); - } else { - Message.error("鍒犻櫎澶辫触"); + + const onChangeavailable = () => { + getList(); + }; + + const handleChangeStatus = (val) => { + updateChunkStatus(val); + }; + const isLoading = ref(true); + // 鑷畾涔夊姞杞芥彁绀烘枃鏈� + const tip = '鍔犺浇涓紝璇风◢鍊�...'; + //鑾峰彇鍒楄〃 + const getList = async () => { + let params = { + doc_id: props.item.id, + keywords: form.keywords, + page: 1, + size: 10000, + }; + if (available_int.value !== '') { + params.available_int = available_int.value; } + await queryChunkList(params).then((res) => { + if (res.code == 0) { + listData.value = res.data.chunks; + isLoading.value = false; + listData.value = listData.value.map((item) => { + item.available_int = parseInt(item.available_int); + return item; + }); + } + }); + }; + //鏇存柊鍒楄〃 + const canplaythrough = () => { + getList(); + }; + + //鍚敤绂佺敤 + const updateChunkStatus = (val) => { + let params = { + chunk_ids: [val.chunk_id], + available_int: val.available_int, + doc_id: props.item.id, + }; + chunkSwitch(params).then((res) => { + console.log(res); + if (res.code == 0) { + Message.success('鏇存柊鎴愬姛'); + getList(); + } else { + Message.error('鏇存柊澶辫触'); + } + }); + }; + + //鍒犻櫎 + const deleteChunk = () => { + let params = { + chunk_ids: data.value, + doc_id: props.item.id, + }; + chunkRm(params).then((res) => { + console.log(res); + if (res.code == 0) { + Message.success('鍒犻櫎鎴愬姛'); + getList(); + } else { + Message.error('鍒犻櫎澶辫触'); + } + }); + }; + + onBeforeMount(() => { + getList(); }); -}; - -onBeforeMount(() => { - getList(); -}); -onMounted(() => { - -}); + onMounted(() => {}); </script> <style scoped lang="less"> -.parser { - width: 100%; + .parser { + width: 100%; - ::v-deep .arco-btn-outline:hover, - .arco-btn-outline, - .arco-btn-outline[type='button'] { - color: #2a2a2b; - border: 1px solid #2a2a2b; - } - - .button { - //color: #2a2a2b!important; - } -} - -::-webkit-scrollbar { - display: none; -} - -.groupMain { - width: 100%; - height: 500px; - overflow: auto; - display: flex; - justify-content: center; - - .groupList { - display: flex; - padding: 24px; - border-radius: 8px; - //background: #eff8ff; - border: 1px solid #f0f0f0; - margin-bottom: 20px; - overflow: auto; - - .groupList-content { - width: 700px; - //height: 100px; - overflow: auto; - box-sizing: border-box; - margin: 0; - padding: 0; + ::v-deep .arco-btn-outline:hover, + .arco-btn-outline, + .arco-btn-outline[type='button'] { color: #2a2a2b; - font-size: 14px; - font-family: Inter; - position: relative; + border: 1px solid #2a2a2b; + } + + .button { + //color: #2a2a2b!important; } } -} -:deep(.emphaRed em) { - color: red !important; -} + ::-webkit-scrollbar { + display: none; + } -.groupActive { - background: #eff8ff; -} + .groupMain { + width: 100%; + height: 500px; + overflow: auto; + display: flex; + justify-content: center; -.groupNoActive { - background: var(--color-bg-1); - color: var(--color-text-1); -} + .groupList { + display: flex; + padding: 24px; + border-radius: 8px; + //background: #eff8ff; + border: 1px solid #f0f0f0; + margin-bottom: 20px; + overflow: auto; + + .groupList-content { + width: 700px; + //height: 100px; + overflow: auto; + box-sizing: border-box; + margin: 0; + padding: 0; + color: #2a2a2b; + font-size: 14px; + font-family: Inter; + position: relative; + } + } + } + + :deep(.emphaRed em) { + color: red !important; + } + + .groupActive { + background: #eff8ff; + } + + .groupNoActive { + background: var(--color-bg-1); + color: var(--color-text-1); + } </style> diff --git a/src/views/dmx/model/components/addPageModel.vue b/src/views/dmx/model/components/addPageModel.vue index 23008ea..21cd429 100644 --- a/src/views/dmx/model/components/addPageModel.vue +++ b/src/views/dmx/model/components/addPageModel.vue @@ -137,6 +137,9 @@ import { Modal, Message } from '@arco-design/web-vue'; import message from '@arco-design/web-vue/es/message'; import { resolveUnref } from '@vueuse/core'; + import { useUserStore } from '@/store'; + + const userStore = useUserStore(); const addPageModelVisible = defineModel('show'); const loading = ref(false); @@ -222,14 +225,20 @@ const uploadAction = '/api/v1/llm/upload'; // 鏇挎崲涓轰綘鐨勪笂浼燗PI const fileList = ref([]); const imageUrls = ref([]); + const uploadUrl = ref([]); + const httpUrl = localStorage.getItem('httpUrl'); const updateFileList = (newFileList) => { fileList.value = newFileList; - console.log(newFileList, 88); }; const handleSuccess = (urls) => { - imageUrls.value = urls; // 鎷垮埌涓婁紶鐨勫浘鐗囧湴鍧� + uploadUrl.value = urls; + + const urlsArr = urls.map((url) => { + return httpUrl + url; + }); + imageUrls.value = urlsArr; // 鎷垮埌涓婁紶鐨勫浘鐗囧湴鍧� }; const emit = defineEmits(['refresh-parent']); const handleSubmit = ({ values, errors }) => { @@ -250,7 +259,7 @@ volc_sk: form.volc_sk, api_base: form.api_base, all_params: all_params, - logo: imageUrls.value[0], + logo: uploadUrl.value[0], }); if ((data as any).code == 200) { @@ -269,7 +278,7 @@ volc_sk: form.volc_sk, api_base: form.api_base, all_params: all_params, - logo: imageUrls.value[0], + logo: uploadUrl.value[0], }); if ((data as any).code == 200) { @@ -361,7 +370,7 @@ }); } - imageUrls.value.push(data.data.logo); + imageUrls.value.push(httpUrl + data.data.logo); }; watchEffect(() => { diff --git a/src/views/dmx/model/components/addTableName.vue b/src/views/dmx/model/components/addTableName.vue index 0b5648c..9b6c8c9 100644 --- a/src/views/dmx/model/components/addTableName.vue +++ b/src/views/dmx/model/components/addTableName.vue @@ -70,6 +70,8 @@ import { Message } from '@arco-design/web-vue'; const addTabVisible = defineModel('tabShow'); + + const httpUrl = localStorage.getItem('httpUrl'); const loading = ref(false); const props = defineProps({ task_id: { @@ -123,7 +125,7 @@ tags: form.tags, api_base: form.api_base, // all_params: all_params, - logo: imageUrls.value[0], + logo: uploadUrl.value[0], }) .then((resData) => { if ((resData as any).code === 200) { @@ -138,7 +140,7 @@ tags: form.tags, api_base: form.api_base, // all_params: all_params, - logo: imageUrls.value[0], + logo: uploadUrl.value[0], }) .then((resData) => { if ((resData as any).code === 200) { @@ -166,13 +168,18 @@ const uploadAction = '/api/v1/llm/upload'; // 鏇挎崲涓轰綘鐨勪笂浼燗PI const fileList = ref([]); const imageUrls = ref([]); + const uploadUrl = ref([]); const updateFileList = (newFileList) => { fileList.value = newFileList; }; const handleSuccess = (urls) => { - imageUrls.value = urls; // 鎷垮埌涓婁紶鐨勫浘鐗囧湴鍧� - console.log(urls, 77777); + uploadUrl.value = urls; + + const urlsArr = urls.map((url) => { + return httpUrl + url; + }); + imageUrls.value = urlsArr; // 鎷垮埌涓婁紶鐨勫浘鐗囧湴鍧� }; const handleOpened = (el) => { diff --git a/src/views/dmx/model/index.vue b/src/views/dmx/model/index.vue index de9f216..2c1fed9 100644 --- a/src/views/dmx/model/index.vue +++ b/src/views/dmx/model/index.vue @@ -42,7 +42,7 @@ width: '100%', }" alt="鏆傛棤鍥剧墖" - :src="item.logo" + :src="httpUrl + item.logo" /> </div> <a-card :bordered="false" hoverable> @@ -83,7 +83,7 @@ width: '100%', }" alt="鏆傛棤鍥剧墖" - :src="list.logo" + :src="httpUrl + list.logo" /> <!-- src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a20012a2d4d5b9db43dfc6a01fe508c0.png~tplv-uwbnlip3yd-webp.webp" --> </div> @@ -174,7 +174,9 @@ deleteLlmFactory, } from '@/api/model'; import { Modal, Message } from '@arco-design/web-vue'; + import { useUserStore } from '@/store'; + const userStore = useUserStore(); let count = 5; const activeKey = ref(1); const data = ref([ @@ -208,6 +210,8 @@ const changeTabs = (val) => { tabKey.value = val; }; + + const httpUrl = localStorage.getItem('httpUrl'); const show = ref(false); const tabShow = ref(false); const title = ref('娣诲姞妯″紡'); diff --git a/src/views/login/components/login-form.vue b/src/views/login/components/login-form.vue index 583ef10..f3cb36d 100644 --- a/src/views/login/components/login-form.vue +++ b/src/views/login/components/login-form.vue @@ -112,6 +112,10 @@ ...othersQuery, }, }); + + const url = window.location.origin; + localStorage.setItem('httpUrl', url); + userStore.getHreFurl(url); Message.success(t('鐧诲綍鎴愬姛')); const { rememberPassword } = loginConfig.value; const { email, password } = values; -- Gitblit v1.8.0