修复上传图片地址
This commit is contained in:
parent
cd8f2588e6
commit
74784a8d9e
@ -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: {
|
||||||
|
|||||||
@ -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助手'
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user