接口联调

This commit is contained in:
yanghang
2025-06-26 10:14:46 +08:00
parent ece5e7e1a9
commit f1bedb2340
3 changed files with 72 additions and 20 deletions
+24 -1
View File
@@ -62,7 +62,30 @@ export function downloadFile(id) {
});
});
}
// 获取音频 通用
export function downloadVoiceFile(url) {
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();
let _params = new FormData()
return new Promise((resolve, reject) => {
uni.downloadFile({
url: `${baseUrl}${url}`,
header,
success(result) {
console.log(result)
resolve(result)
},
fail(error) {
reject(new Error(error));
}
});
});
}
// 对象存储预览 /traoss/tras3/show/{文件ID}
export function previewFile(id, responseType = 'arraybuffer') {
const token = getToken();
+3 -2
View File
@@ -2,11 +2,12 @@ import request from '@/api/request'
const base_url = '/trastudy'
// 获取课程分类树接口
// 获取课程学习信息接口
export const getCourseStudyInfoApi = (data) => {
return request({
url: base_url + '/traStdyInfo/queryTraStdyProgressAndTeacher',
method: 'post',
data
});
};
};