env:后端的请求地址,调整到 env 里

This commit is contained in:
YunaiV
2024-01-20 13:13:28 +08:00
parent 80f80e358f
commit 33d57fd7e5
33 changed files with 130 additions and 145 deletions
+4 -6
View File
@@ -1,27 +1,25 @@
import { baseUrl, apiPath } from '@/sheep/config';
const FileApi = {
// 上传文件
uploadFile: (file) => {
// TODO 芋艿:访问令牌的接入;
const token = uni.getStorageSync('token');
uni.showLoading({
title: '上传中',
});
return new Promise((resolve, reject) => {
// 此处先换成yudao
// TODO 芋艿:后续搞下
uni.uploadFile({
// url: 'http://api-dashboard.yudao.iocoder.cn' + '/app-api/infra/file/upload',
url: 'http://127.0.0.1:48080' + '/app-api/infra/file/upload',
url: baseUrl + apiPath + '/infra/file/upload',
filePath: file,
name: 'file',
header: {
// Accept: 'text/json',
// Authorization: token,
Accept : '*/*',
'tenant-id' :'1',
// Authorization: 'Bearer test247',
},
success: (uploadFileRes) => {
debugger
let result = JSON.parse(uploadFileRes.data);
if (result.error === 1) {
uni.showToast({