Feat:管家入驻(小程序)

This commit is contained in:
LinCyJang
2025-10-10 23:42:37 +08:00
parent 0dd7b2ed2d
commit 9244c3215d
5 changed files with 795 additions and 0 deletions
+30
View File
@@ -1199,3 +1199,33 @@ export function uploadImage(imgPath, callback) {
}
});
}
export function uploadVideo(videoPath, callback) {
uni.showLoading({
title: "视频上传中",
mask: true
});
uni.uploadFile({
url: `${VUE_APP_API_URL}/api/upload`,
filePath: videoPath,
header: {
Authorization: "Bearer " + store.getters.token
},
name: "file",
success: res => {
if (callback) {
callback(JSON.parse(res.data).link)
}
},
fail: err => {
uni.showToast({
title: "上传视频失败" + err,
icon: "none",
duration: 2000
});
},
complete: res => {
uni.hideLoading()
}
});
}