feat:地址配置
This commit is contained in:
@@ -1,36 +1,40 @@
|
||||
// 在此不用配置接口前缀
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://172.16.46.62:30081/admin-api'
|
||||
// const BaseUrl = isDev ? 'http://192.168.26.163:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||
//
|
||||
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
||||
const upgradeBaseUrl = 'http://192.168.26.116:888/admin-api'
|
||||
// 正式环境
|
||||
const BaseUrl = isDev ? 'http://172.17.19.29:48080/admin-api' : 'http://172.17.19.29:48080/admin-api'
|
||||
const upgradeBaseUrl = isDev? 'http://172.17.19.29:48080/admin-api':'http://172.17.19.29:48080/admin-api'
|
||||
const websocketUrl = isDev ? 'ws://172.17.19.11:30330' : 'ws://172.17.19.11:30330'
|
||||
|
||||
// 公司测试环境
|
||||
// const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||
// const upgradeBaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||
// const websocketUrl = isDev ? 'ws://192.168.26.116:888/ws' : 'ws://192.168.26.116:888/ws'
|
||||
|
||||
const tenantId = '1'
|
||||
export const clientId = 'zgty_lims'
|
||||
|
||||
function initDefaultBaseUrl() {
|
||||
uni.setStorageSync('base_url', BaseUrl)
|
||||
uni.setStorageSync('tenant_id', tenantId)
|
||||
uni.setStorageSync('baseUrl', BaseUrl)
|
||||
uni.setStorageSync('tenantId', tenantId)
|
||||
uni.setStorageSync('upgradeBaseUrl', upgradeBaseUrl)
|
||||
uni.setStorageSync('webSocketUrl', websocketUrl)
|
||||
}
|
||||
initDefaultBaseUrl()
|
||||
|
||||
export function getBaseUrl() {
|
||||
return uni.getStorageSync('base_url')
|
||||
return uni.getStorageSync('baseUrl')
|
||||
}
|
||||
|
||||
export function getImgBaseUrl() {
|
||||
return uni.getStorageSync('base_url').replace('/api', '')
|
||||
return uni.getStorageSync('baseUrl').replace('/api', '')
|
||||
}
|
||||
export function getTenantId() {
|
||||
return uni.getStorageSync('tenant_id')
|
||||
return uni.getStorageSync('tenantId')
|
||||
}
|
||||
|
||||
export function getUpgradeBaseUrl() {
|
||||
return uni.getStorageSync('upgradeBaseUrl')
|
||||
}
|
||||
export function getWebSocketUrl() {
|
||||
// return uni.getStorageSync('base_url').replace('/api', '') + '/ws'
|
||||
return 'ws://192.168.26.116:888/ws'
|
||||
return uni.getStorageSync('webSocketUrl')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user