[fix]文件上传大小限制

main
huyuanxiang 2 years ago
parent 4bed9058d6
commit 859474e28a

@ -1,18 +1,16 @@
import request from "@/utils/request";
import request, { baseUrl } from "@/utils/request";
import { getToken, removeToken, removeUserInfo } from "@/utils/auth";
export const getGoodsList = (params) => request('/erp/goods/list', params, 'get')
export const getGoodsById = (params) => request('/erp/goods/queryById', params, 'get')
export const getAddrList = (params) => request('/erp/addrManager/list', params, 'get')
export const getOrderList = (params) => request('/erp/order/list', params, 'get')
export const addOrder = (params) => request('/erp/order/add', params, 'post')
export const editOrder = (params) => request('/erp/order/edit', params, 'post')
export const getStatusList = (params) => request('/erp/order/queryState', params, 'get')
export const getAddrList = (params) => request('/erp/addrManager/list', params, 'get')
export const addAddr = (params) => request('/erp/addrManager/add', params, 'post')
export const editAddr = (params) => request('/erp/addrManager/edit', params, 'post')
export const delAddr = (params) => request('/erp/addrManager/delete?id='+params, {} , 'delete')
@ -20,14 +18,10 @@ export const delAddr = (params) => request('/erp/addrManager/delete?id='+params,
export const getCode = (params) => request('/sys/randomImage/' + params, {}, 'get')
export const login = (params) => request('/sys/login', params, 'POST')
export const getStatusList = (params) => request('/erp/order/queryState', params, 'get')
export const addCommit = (params) => request('/erp/bbs/add', params, 'post')
export const getCommits = (params) => request('/erp/bbs/list', params, 'get')
export const getCommit = (params) => request('/erp/bbs/queryById', params, 'get')
export const addCart = (params) => request('/erp/shoppingCart/add', params, 'post')
export const delCart = (params) => request('/erp/shoppingCart/delete?id='+params, {} , 'delete')
export const delCarts = (params) => request('/erp/shoppingCart/deleteBatch?ids='+params, {} , 'delete')
@ -41,7 +35,7 @@ export const uploadFile = (filePath) => {
mask: true
})
uni.uploadFile({
url: 'http://47.100.35.222:8080/jeecg-boot/sys/common/upload', //仅为示例,非真实的接口地址
url: baseUrl + '/sys/common/upload', //仅为示例,非真实的接口地址
filePath,
name: 'file',
header: {
@ -68,6 +62,14 @@ export const uploadFile = (filePath) => {
return
}
const data = JSON.parse(res.data)
if (data.code === 500)
{
uni.showToast({
title: data.message,
icon: 'none'
})
return
}
resolve(data.message)
},
fail(e) {

@ -5,7 +5,8 @@
* .then(res=>{console.log(res)})
*/
import { getToken, removeToken } from "./auth";
const baseUrl = 'http://47.100.35.222:8080/jeecg-boot';
export const baseUrl = 'http://47.100.35.222:8080/jeecg-boot';
async function request(mehtod, params, type = 'GET') {
//创建一个名为request请求的方法函数
const token = getToken()

Loading…
Cancel
Save