@cqsjjb/course-res-design 0.1.0-beta.5 → 0.1.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/courseLibrary.js +2 -2
- package/api/global.js +2 -2
- package/api/utils.js +4 -1
- package/package.json +1 -1
package/api/courseLibrary.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getApiBaseName } from './utils';
|
|
|
7
7
|
* @returns {Promise}
|
|
8
8
|
*/
|
|
9
9
|
export const getResources = params => {
|
|
10
|
-
return request.get(`/${getApiBaseName()}/course/getResExam/${params.fileId}`);
|
|
10
|
+
return request.get(`/${getApiBaseName(params?.apiBaseName)}/course/getResExam/${params.fileId}`);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -16,7 +16,7 @@ export const getResources = params => {
|
|
|
16
16
|
* @returns {Promise}
|
|
17
17
|
*/
|
|
18
18
|
export const getTemplateHour = params => {
|
|
19
|
-
return request.post(`/${getApiBaseName()}/course/getResourceHour`, params);
|
|
19
|
+
return request.post(`/${getApiBaseName(params?.apiBaseName)}/course/getResourceHour`, params);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/**
|
package/api/global.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getApiBaseName } from './utils';
|
|
|
7
7
|
* @returns {Promise}
|
|
8
8
|
*/
|
|
9
9
|
export const getResUrlAction = params => {
|
|
10
|
-
return request.get(`/${getApiBaseName()}/course/getVideoUrlByFileId/${params.fileId}`);
|
|
10
|
+
return request.get(`/${getApiBaseName(params?.apiBaseName)}/course/getVideoUrlByFileId/${params.fileId}`);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -17,6 +17,6 @@ export const getResUrlAction = params => {
|
|
|
17
17
|
*/
|
|
18
18
|
export const getVideoCaption = params => {
|
|
19
19
|
return request.get(
|
|
20
|
-
`/${getApiBaseName()}/course/getCaptionListByFileId/${params.fileId}`
|
|
20
|
+
`/${getApiBaseName(params?.apiBaseName)}/course/getCaptionListByFileId/${params.fileId}`
|
|
21
21
|
);
|
|
22
22
|
};
|
package/api/utils.js
CHANGED
|
@@ -2,7 +2,10 @@ const inIframe = () => {
|
|
|
2
2
|
return window.self !== window.top;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
export const getApiBaseName = () => {
|
|
5
|
+
export const getApiBaseName = (baseName) => {
|
|
6
|
+
if(baseName) {
|
|
7
|
+
return baseName;
|
|
8
|
+
}
|
|
6
9
|
try {
|
|
7
10
|
const location = inIframe() ? window.parent.location : window.location;
|
|
8
11
|
return location.pathname.match(/^\/(\w+)\/[C|c]ontainer/)[1];
|