|
@@ -3,9 +3,31 @@ |
|
@@ -3,9 +3,31 @@ |
3
|
*/
|
3
|
*/
|
4
|
import utils from './utils';
|
4
|
import utils from './utils';
|
5
|
|
5
|
|
|
|
6
|
+const channelMap = {
|
|
|
7
|
+ 'baidu.com': 100000000000055,
|
|
|
8
|
+ 'so.com': 100000000000049,
|
|
|
9
|
+ 'sogou.com': 100000000000053,
|
|
|
10
|
+ 'bing.com': 100000000000057,
|
|
|
11
|
+ 'm.sm.cn': 100000000000059,
|
|
|
12
|
+ 'google.com': 100000000000061
|
|
|
13
|
+};
|
|
|
14
|
+
|
|
|
15
|
+const getMktcBySeo = () => {
|
|
|
16
|
+ var mktc,
|
|
|
17
|
+ rf = document.referrer;
|
|
|
18
|
+
|
|
|
19
|
+ for (var domain in channelMap) {
|
|
|
20
|
+ if (rf.indexOf(domain) > -1) {
|
|
|
21
|
+ mktc = channelMap[domain];
|
|
|
22
|
+ break;
|
|
|
23
|
+ }
|
|
|
24
|
+ }
|
|
|
25
|
+ return mktc;
|
|
|
26
|
+};
|
|
|
27
|
+
|
6
|
const getAppPath = () => {
|
28
|
const getAppPath = () => {
|
7
|
let qs = utils.queryString();
|
29
|
let qs = utils.queryString();
|
8
|
- let ct = qs.mkt_code || qs.union_type;
|
30
|
+ let ct = qs.mkt_code || qs.union_type || getMktcBySeo() || '100000000000349';
|
9
|
|
31
|
|
10
|
delete qs.openapp; // 防止重复打开
|
32
|
delete qs.openapp; // 防止重复打开
|
11
|
|
33
|
|