Skip to content

Commit

Permalink
Fix upload image issue (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
崔庆才丨静觅 authored Jan 8, 2024
1 parent 3d1dd49 commit 9495ba4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix upload image issue",
"packageName": "@zhishuyun/hub",
"email": "[email protected]",
"dependentChangeType": "patch"
}
6 changes: 4 additions & 2 deletions src/components/chat/InputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:show-file-list="true"
:limit="1"
:multiple="false"
action="/api/v1/files/"
:action="uploadUrl"
:on-exceed="onExceed"
:on-error="onError"
:headers="headers"
Expand Down Expand Up @@ -51,6 +51,7 @@ import { defineComponent } from 'vue';
import { ElInput, ElMessage, ElTooltip, ElUpload } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { CHAT_MODEL_CHATGPT4_VISION, IChatModel } from '@/operators';
import { getBaseUrlData } from '@/utils';
export default defineComponent({
name: 'InputBox',
Expand Down Expand Up @@ -80,7 +81,8 @@ export default defineComponent({
data() {
return {
questionValue: this.question,
fileList: []
fileList: [],
uploadUrl: getBaseUrlData() + '/api/v1/files/'
};
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/AuthPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default defineComponent({
inviterId() {
// if forceInviterId is set, then use 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
const result =
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/Navigator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
<div class="middle" />
<div v-if="!collapsed" class="bottom">
<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" />
<template #title>{{ $t('common.nav.console') }}</template>
</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" />
<template #title>{{ $t('common.nav.distribution') }}</template>
</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" />
<template #title>{{ $t('common.nav.logOut') }}</template>
</el-menu-item>
Expand Down
7 changes: 5 additions & 2 deletions src/components/midjourney/ReferenceImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name="file"
:limit="5"
:multiple="true"
action="/api/v1/files/"
:action="uploadUrl"
list-type="picture"
:on-exceed="onExceed"
:on-error="onError"
Expand All @@ -29,9 +29,11 @@
import { defineComponent } from 'vue';
import { ElUpload, ElButton, UploadFiles, UploadFile, ElMessage } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { getBaseUrlData } from '@/utils';
interface IData {
fileList: UploadFiles;
uploadUrl: string;
}
export default defineComponent({
Expand All @@ -44,7 +46,8 @@ export default defineComponent({
emits: ['change'],
data(): IData {
return {
fileList: []
fileList: [],
uploadUrl: getBaseUrlData() + '/api/v1/files/'
};
},
computed: {
Expand Down

0 comments on commit 9495ba4

Please sign in to comment.