index.js
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
import reportWebVitals from './reportWebVitals'
import 'antd/dist/antd.css'
import { init } from 'loading-bar'
import 'loading-bar/src/index.css'
import store from './store'
import { install } from 'system-collect'
import http from './libs/fetch'
import { APP } from './config/index'
import { setAPP } from 'xbd-cookie'
setAPP(APP)
init()
store.dispatch.baseConfig.init()
.then(res => {
if (!res) {
console.error('平台配置参数未获取', res)
return
}
http.setHeader('operationChannel', res.operationChannel)
install(
process.env.REACT_APP_API === 'production' ? 'production' : 'development',
'browser',
res.platformName,
res.app_code
)
})
if (process.env.NODE_ENV !== 'development') document.domain = 'b2bwings.com'
ReactDOM.render(
<App />,
document.getElementById('root')
)
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals()