增加阿里云oss上传

This commit is contained in:
2024-12-04 10:34:04 +08:00
parent 183b646167
commit 408f0eaa29
10 changed files with 5476 additions and 3946 deletions

22
src/api/classApi.js Normal file
View File

@@ -0,0 +1,22 @@
class API {
constructor(url,req) {
const map={
add:'POST',
del:'DELETE',
update:'PUT',
get:'GET'
}
this.url=url
for(let key in map){
this[key]=function(data){
data=Array.isArray(data)?data:{...data,shopId:uni.getStorageSync('shopId')}
if(key==='del'){
delete data.shopId
}
return req(url, data,map[key])
}
}
}
}
export default API