修复上传图片地址
This commit is contained in:
parent
cd8f2588e6
commit
74784a8d9e
@ -18,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { BASE_URL } from '@/utils/config';
|
||||
import { BASE_URL,IMAGE_BASE_URL } from '@/utils/config';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -115,7 +115,7 @@ export default {
|
||||
try {
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/api/v1/upload`,
|
||||
url: `${IMAGE_BASE_URL}/api/v1/upload`,
|
||||
filePath: file.url,
|
||||
name: 'file',
|
||||
header: {
|
||||
|
||||
@ -101,7 +101,8 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
WS_BASE_URL
|
||||
WS_BASE_URL,
|
||||
IMAGE_BASE_URL
|
||||
} from '@/utils/config';
|
||||
|
||||
export default {
|
||||
@ -135,7 +136,7 @@
|
||||
const userInfo = wx.getStorageSync('userInfo') || {};
|
||||
this.userId = userInfo.id || Date.now().toString();
|
||||
this.userName = userInfo.name || '默认用户';
|
||||
this.userAvatar = userInfo.avatar || this.userAvatar;
|
||||
this.userAvatar = userInfo.avatar?`${IMAGE_BASE_URL+userInfo.avatar}`:this.userAvatar;
|
||||
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.name || 'AI助手'
|
||||
|
||||
@ -123,7 +123,7 @@
|
||||
try {
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/api/v1/upload`,
|
||||
url: `${IMAGE_BASE_URL}/api/v1/upload`,
|
||||
filePath: file.url,
|
||||
name: 'file',
|
||||
header: {
|
||||
|
||||
@ -465,7 +465,7 @@
|
||||
uploadAvatar(filePath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/api/v1/upload`,
|
||||
url: `${IMAGE_BASE_URL}/api/v1/upload`,
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
|
||||
@ -149,7 +149,7 @@
|
||||
try {
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/api/v1/upload`,
|
||||
url: `${IMAGE_BASE_URL}/api/v1/upload`,
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
|
||||
@ -231,7 +231,7 @@
|
||||
uploadSingleImage(filePath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/api/v1/upload`,
|
||||
url: `${IMAGE_BASE_URL}/api/v1/upload`,
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
|
||||
@ -280,7 +280,7 @@ export default {
|
||||
try {
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${BASE_URL}/api/v1/upload`,
|
||||
url: `${IMAGE_BASE_URL}/api/v1/upload`,
|
||||
filePath: file.url,
|
||||
name: 'file',
|
||||
header: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user