This commit is contained in:
qiuyuan 2025-08-08 19:39:28 +08:00
commit 56c43a74e0
7 changed files with 10 additions and 9 deletions

View File

@ -18,7 +18,7 @@
</template> </template>
<script> <script>
import { BASE_URL } from '@/utils/config'; import { BASE_URL,IMAGE_BASE_URL } from '@/utils/config';
export default { export default {
data() { data() {
@ -115,7 +115,7 @@ export default {
try { try {
const res = await new Promise((resolve, reject) => { const res = await new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${BASE_URL}/api/v1/upload`, url: `${IMAGE_BASE_URL}/api/v1/upload`,
filePath: file.url, filePath: file.url,
name: 'file', name: 'file',
header: { header: {

View File

@ -101,7 +101,8 @@
<script> <script>
import { import {
WS_BASE_URL WS_BASE_URL,
IMAGE_BASE_URL
} from '@/utils/config'; } from '@/utils/config';
export default { export default {
@ -135,7 +136,7 @@
const userInfo = wx.getStorageSync('userInfo') || {}; const userInfo = wx.getStorageSync('userInfo') || {};
this.userId = userInfo.id || Date.now().toString(); this.userId = userInfo.id || Date.now().toString();
this.userName = userInfo.name || '默认用户'; this.userName = userInfo.name || '默认用户';
this.userAvatar = userInfo.avatar || this.userAvatar; this.userAvatar = userInfo.avatar?`${IMAGE_BASE_URL+userInfo.avatar}`:this.userAvatar;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: options.name || 'AI助手' title: options.name || 'AI助手'

View File

@ -123,7 +123,7 @@
try { try {
const res = await new Promise((resolve, reject) => { const res = await new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${BASE_URL}/api/v1/upload`, url: `${IMAGE_BASE_URL}/api/v1/upload`,
filePath: file.url, filePath: file.url,
name: 'file', name: 'file',
header: { header: {

View File

@ -465,7 +465,7 @@
uploadAvatar(filePath) { uploadAvatar(filePath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${BASE_URL}/api/v1/upload`, url: `${IMAGE_BASE_URL}/api/v1/upload`,
filePath: filePath, filePath: filePath,
name: 'file', name: 'file',
header: { header: {

View File

@ -149,7 +149,7 @@
try { try {
const res = await new Promise((resolve, reject) => { const res = await new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${BASE_URL}/api/v1/upload`, url: `${IMAGE_BASE_URL}/api/v1/upload`,
filePath: filePath, filePath: filePath,
name: 'file', name: 'file',
header: { header: {

View File

@ -231,7 +231,7 @@
uploadSingleImage(filePath) { uploadSingleImage(filePath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${BASE_URL}/api/v1/upload`, url: `${IMAGE_BASE_URL}/api/v1/upload`,
filePath: filePath, filePath: filePath,
name: 'file', name: 'file',
header: { header: {

View File

@ -280,7 +280,7 @@ export default {
try { try {
const res = await new Promise((resolve, reject) => { const res = await new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: `${BASE_URL}/api/v1/upload`, url: `${IMAGE_BASE_URL}/api/v1/upload`,
filePath: file.url, filePath: file.url,
name: 'file', name: 'file',
header: { header: {