修改首页和登录页统计接口逻辑

This commit is contained in:
田岩
2025-06-24 16:42:26 +08:00
22 changed files with 1297 additions and 38 deletions
+24 -1
View File
@@ -39,6 +39,29 @@ export const uploadFile = (file, data) => {
});
};
// 对象存储下载 /traoss/tras3/show/{文件ID}
export function downloadFile(id) {
const token = getToken();
const header = {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
};
if (token)
header['summary'] = token
let baseUrl = get_base_url();
return new Promise((resolve, reject) => {
uni.downloadFile({
url: `${baseUrl}/traoss/tras3/show/${id}`,
header,
success(result) {
resolve(result)
},
fail(error) {
reject(new Error(error));
}
});
});
}
// 对象存储预览 /traoss/tras3/show/{文件ID}
export function previewFile(id, responseType = 'arraybuffer') {
@@ -91,7 +114,7 @@ export function previewCacheThumbImage(id, width = 30, height = 30) {
let base64 = `data:image/png;base64,` + result.data.body
resolve(base64)
}else{
reject(new Error(result.data.message))
reject({error:result.data.message})
}
},
fail(error) {