1234567891011121314151617181920212223242526272829303132333435 |
- type env = 'develop' | 'trial' | 'release'
- interface ConfigObj {
- api: string
- webview: string
- sokcet: string
- upload?: string
- }
- type ServerConfig = {
- [key in env]: ConfigObj
- }
- const config: ServerConfig = {
- develop: {
- api: 'https://v4-test.4dkankan.com',
- webview: 'https://test.4dkankan.com/livestream',
- sokcet: 'wss://testws.4dkankan.com',
- },
- trial: {
- api: 'https://v4-test.4dkankan.com',
- webview: 'https://test.4dkankan.com/livestream',
- sokcet: 'wss://testws.4dkankan.com',
- },
- release: {
- api: 'https://www.4dkankan.com',
- webview: 'https://www.4dkankan.com/livestream',
- sokcet: 'wss://ws.4dkankan.com',
- }
- }
- const currentEnv = wx.getAccountInfoSync().miniProgram.envVersion
- export const server = config[currentEnv]
|