课程中心页面注册,uv-tabs引入

This commit is contained in:
yanghang
2025-06-18 17:58:40 +08:00
parent ec981efa71
commit 514bea374a
16 changed files with 1137 additions and 2 deletions
+24 -1
View File
@@ -39,4 +39,27 @@ export const uploadFile = (file, data) => {
}
});
});
};
};
// 对象存储预览 /traoss/tras3/show/{文件ID}
export function previewFile(id,responseType = 'blob') {
const token = getToken();
const header = {};
if (token)
header['summary'] = token
return new Promise((resolve, reject) => {
uni.request({
url: `/traoss/tras3/show/${id}`,
header,
responseType,
success(result) {
resolve(result.data)
},
fail(error) {
reject(new Error('Upload failed'));
}
});
});
}