zby-live-sdk 1.0.49-beta20230427 → 1.0.49-beta20230427-1
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/CHANGELOG.md +14 -4
- package/dist/zby-live-sdk.cjs.js +2 -2
- package/dist/zby-live-sdk.esm.js +2 -2
- package/dist/zby-live-sdk.umd.js +2 -2
- package/package.json +1 -1
- package/src/config/config.js +3 -2
- package/src/network/commonFetch.js +13 -8
package/package.json
CHANGED
package/src/config/config.js
CHANGED
|
@@ -18,7 +18,7 @@ const urls = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// export const version = require('../../package.json').version;
|
|
21
|
-
export const version = '1.0.49-beta20230427';
|
|
21
|
+
export const version = '1.0.49-beta20230427-1';
|
|
22
22
|
|
|
23
23
|
export const liveExt = {
|
|
24
24
|
name: 'live',
|
|
@@ -133,7 +133,8 @@ export const getApiCloudBaseUrl = () => {
|
|
|
133
133
|
|
|
134
134
|
export const getApiMixStreams = () => {
|
|
135
135
|
const { env ,saasMode} = config;
|
|
136
|
-
const urls =
|
|
136
|
+
const urls = saasMode == 1 ? apiMixStreamsBp : apiMixStreams ;
|
|
137
|
+
console.log('混流-test', urls, saasMode);
|
|
137
138
|
return urls[env];
|
|
138
139
|
}
|
|
139
140
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @FilePath: \demo9\51-demo\src\_zby_live_sdk\src\network\commonFetch.js
|
|
8
8
|
*/
|
|
9
9
|
import axios from 'axios';
|
|
10
|
+
import { config } from '../config/config'
|
|
10
11
|
import Qs from 'qs';
|
|
11
12
|
/**
|
|
12
13
|
* 真正的请求
|
|
@@ -25,12 +26,13 @@ const get = (params, url, timeout, headers) => {
|
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
28
|
|
|
28
|
-
const post = (data, url, timeout) => {
|
|
29
|
+
const post = (data, url, timeout,headers) => {
|
|
29
30
|
return axios({
|
|
30
31
|
method: 'post',
|
|
31
32
|
url,
|
|
32
33
|
timeout,
|
|
33
|
-
data
|
|
34
|
+
data,
|
|
35
|
+
headers
|
|
34
36
|
});
|
|
35
37
|
};
|
|
36
38
|
|
|
@@ -45,18 +47,21 @@ const post1 = (data, url, timeout, headers) => {
|
|
|
45
47
|
};
|
|
46
48
|
function commonFetch(url, options, method = 'GET', timeOut = 60000, headers) {
|
|
47
49
|
if (method === 'GET') { // 如果是GET请求,拼接url
|
|
48
|
-
|
|
50
|
+
let header = Object.assign({},headers,{orgId:config.orgId})
|
|
51
|
+
return get(options, url, timeOut, header).then((res)=>{
|
|
49
52
|
return res.data;
|
|
50
53
|
});
|
|
51
|
-
} else if(method === 'POST')
|
|
52
|
-
|
|
54
|
+
} else if (method === 'POST') {
|
|
55
|
+
let header = Object.assign({},headers,{orgId:config.orgId})
|
|
56
|
+
return post(options, url, timeOut, header).then((res)=>{
|
|
53
57
|
return res.data;
|
|
54
58
|
});
|
|
55
59
|
} else if(method === 'FROMDATA') {
|
|
56
|
-
let
|
|
57
|
-
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
|
60
|
+
let header = {
|
|
61
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
62
|
+
orgId: config.orgId
|
|
58
63
|
};
|
|
59
|
-
return post1(options, url, timeOut,
|
|
64
|
+
return post1(options, url, timeOut, header).then((res)=>{
|
|
60
65
|
return res.data;
|
|
61
66
|
});
|
|
62
67
|
}
|