|
@@ -97,12 +97,15 @@ class APIClient {
|
|
|
|
|
|
// 根据课程获取课列表
|
|
|
static getLessonList(courseId, callback) {
|
|
|
- let macUrl = '';
|
|
|
- WinBoxAPI.getMacUrl( (res) => {
|
|
|
- macUrl = res;
|
|
|
- } )
|
|
|
- let params = APIClient.addCacheParam({});
|
|
|
- AJAXHelper.get(`/course/${courseId}/lessons`, { params, mac: macUrl}, callback);
|
|
|
+ APIClient.getUserMacUrl( ( mac ) => {
|
|
|
+ let params = APIClient.addCacheParam({});
|
|
|
+ params.mac = mac;
|
|
|
+ console.log('params',params)
|
|
|
+ AJAXHelper.get(`/course/${courseId}/lessons`, params , callback);
|
|
|
+ });
|
|
|
+ // let params = APIClient.addCacheParam({});
|
|
|
+ // console.log('params',params)
|
|
|
+ // AJAXHelper.get(`/course/${courseId}/lessons`, { params }, callback);
|
|
|
}
|
|
|
|
|
|
// 获取课程详情
|
|
@@ -181,10 +184,20 @@ class APIClient {
|
|
|
AJAXHelper.post('/callback/event', params, callback);
|
|
|
}
|
|
|
|
|
|
+ // 获取用户的mac地址
|
|
|
+ static getUserMacUrl(callback) {
|
|
|
+ let mac = '';
|
|
|
+ WinBoxAPI.getMacUrl((isTrue, res) => {
|
|
|
+ mac = res.data;
|
|
|
+ callback( mac );
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
// 获取用户的下载记录
|
|
|
static getUserDownloadList(callback) {
|
|
|
- let params = { mac: WinBoxAPI.getMacUrl()}
|
|
|
- AJAXHelper.get('/callback/download/list', { params }, callback);
|
|
|
+ APIClient.getUserMacUrl( ( mac ) => {
|
|
|
+ AJAXHelper.get('/callback/download/list', { mac: mac }, callback);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
}
|