Fix upload image issue (#42)
This commit is contained in:
1 parent
dc1e68cb03
commit
4e8d1dad07
5 files changed
+20
-8
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"type": "patch",
|
||||||
|
"comment": "fix upload image issue",
|
||||||
|
"packageName": "@zhishuyun/hub",
|
||||||
|
"email": "cqc@germey.cn",
|
||||||
|
"dependentChangeType": "patch"
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
:show-file-list="true"
|
:show-file-list="true"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:multiple="false"
|
:multiple="false"
|
||||||
action="/api/v1/files/"
|
:action="uploadUrl"
|
||||||
:on-exceed="onExceed"
|
:on-exceed="onExceed"
|
||||||
:on-error="onError"
|
:on-error="onError"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
@@ -51,6 +51,7 @@ import { defineComponent } from 'vue';
|
|||||||
import { ElInput, ElMessage, ElTooltip, ElUpload } from 'element-plus';
|
import { ElInput, ElMessage, ElTooltip, ElUpload } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import { CHAT_MODEL_CHATGPT4_VISION, IChatModel } from '@/operators';
|
import { CHAT_MODEL_CHATGPT4_VISION, IChatModel } from '@/operators';
|
||||||
|
import { getBaseUrlData } from '@/utils';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'InputBox',
|
name: 'InputBox',
|
||||||
@@ -80,7 +81,8 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
questionValue: this.question,
|
questionValue: this.question,
|
||||||
fileList: []
|
fileList: [],
|
||||||
|
uploadUrl: getBaseUrlData() + '/api/v1/files/'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export default defineComponent({
|
|||||||
inviterId() {
|
inviterId() {
|
||||||
// if forceInviterId is set, then use forceInviterId
|
// if forceInviterId is set, then use forceInviterId
|
||||||
if (this.$config?.distribution?.forceInviterId) {
|
if (this.$config?.distribution?.forceInviterId) {
|
||||||
return this.$config?.distribution?.defaultInviterId;
|
return this.$config?.distribution?.forceInviterId;
|
||||||
}
|
}
|
||||||
// Otherwise, use the inviter_id in the url, then use the inviter_id in the cookie, and finally use the default inviter_id
|
// Otherwise, use the inviter_id in the url, then use the inviter_id in the cookie, and finally use the default inviter_id
|
||||||
const result =
|
const result =
|
||||||
|
|||||||
@@ -31,15 +31,15 @@
|
|||||||
<div class="middle" />
|
<div class="middle" />
|
||||||
<div v-if="!collapsed" class="bottom">
|
<div v-if="!collapsed" class="bottom">
|
||||||
<el-menu :default-active="activeIndex">
|
<el-menu :default-active="activeIndex">
|
||||||
<el-menu-item @click="onConsole">
|
<el-menu-item v-if="$config.navigation?.console" @click="onConsole">
|
||||||
<font-awesome-icon icon="fa-solid fa-compass" class="mr-2" />
|
<font-awesome-icon icon="fa-solid fa-compass" class="mr-2" />
|
||||||
<template #title>{{ $t('common.nav.console') }}</template>
|
<template #title>{{ $t('common.nav.console') }}</template>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item @click="onDistribution">
|
<el-menu-item v-if="showDistribution" @click="onDistribution">
|
||||||
<font-awesome-icon icon="fa-solid fa-coins" class="mr-2" />
|
<font-awesome-icon icon="fa-solid fa-coins" class="mr-2" />
|
||||||
<template #title>{{ $t('common.nav.distribution') }}</template>
|
<template #title>{{ $t('common.nav.distribution') }}</template>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item @click="onLogout">
|
<el-menu-item v-if="authenticated" @click="onLogout">
|
||||||
<font-awesome-icon icon="fa-solid fa-arrow-right-from-bracket" class="mr-2" />
|
<font-awesome-icon icon="fa-solid fa-arrow-right-from-bracket" class="mr-2" />
|
||||||
<template #title>{{ $t('common.nav.logOut') }}</template>
|
<template #title>{{ $t('common.nav.logOut') }}</template>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
name="file"
|
name="file"
|
||||||
:limit="5"
|
:limit="5"
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
action="/api/v1/files/"
|
:action="uploadUrl"
|
||||||
list-type="picture"
|
list-type="picture"
|
||||||
:on-exceed="onExceed"
|
:on-exceed="onExceed"
|
||||||
:on-error="onError"
|
:on-error="onError"
|
||||||
@@ -29,9 +29,11 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElUpload, ElButton, UploadFiles, UploadFile, ElMessage } from 'element-plus';
|
import { ElUpload, ElButton, UploadFiles, UploadFile, ElMessage } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
|
import { getBaseUrlData } from '@/utils';
|
||||||
|
|
||||||
interface IData {
|
interface IData {
|
||||||
fileList: UploadFiles;
|
fileList: UploadFiles;
|
||||||
|
uploadUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -44,7 +46,8 @@ export default defineComponent({
|
|||||||
emits: ['change'],
|
emits: ['change'],
|
||||||
data(): IData {
|
data(): IData {
|
||||||
return {
|
return {
|
||||||
fileList: []
|
fileList: [],
|
||||||
|
uploadUrl: getBaseUrlData() + '/api/v1/files/'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
Reference in new issue
Block a user