
import Vue from 'vue'
import api from '@/api/api.js'
import fetch from '@/api/fetch.js'
import utils from './utils/utils.js'

import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);

// 当前环境
const type = 'prod'


// 环境配置
const config = {
	dev : {
		baseUrl : 'http://h5.xzaiyp.top/health-admin/appletApi',
	},
	prod : {
		baseUrl : 'https://www.petualmedical.com/health-admin/appletApi',
	}
}


// 默认配置
const defaultConfig = {
	mapKey : 'WH3BZ-5M4EA-RT3KU-CCBEN-OGGWF-T5BVB',
	aliOss: {
		url: 'https://image.hhlm1688.com/',
		config: {
			//桶的地址
			region: 'oss-cn-shanghai',
			//id
			accessKeyId: 'LTAI5tRbkjEJmdibzfCT8ymy',
			//密钥
			accessKeySecret: 'gE6BnsfaEGk23Zv2lOUvkvaWwhS6BV',
			//桶的名字
			bucket: 'petualmedical',
			endpoint: 'oss-cn-shanghai.aliyuncs.com',
		}
	},
}


uni.$uv.setConfig({
	// 修改$uv.config对象的属性
	config: {
		// 修改默认单位为rpx，相当于执行 uni.$uv.config.unit = 'rpx'
		unit: 'rpx'
	},
})

Vue.prototype.$config = utils.deepMergeObject(defaultConfig, config[type])

Vue.prototype.$api = api
Vue.prototype.$fetch = fetch

export default Vue.prototype.$config