
import Vue from 'vue'
import api from '@/api/api.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/school-api',
		// baseUrl : 'https://school-admin.xzaiyp.top/school-api',
	},
	prod : {
		baseUrl : 'https://school-admin.xzaiyp.top/school-api',
	}
}


// 默认配置
const defaultConfig = {
	mapKey : '',
	aliOss : {
		//阿里云oss绑定的域名
		url : 'https://tennis-oss.xzaiyp.top/',
		config : {
			//桶的地址
			region: 'oss-cn-guangzhou',
			//id
			accessKeyId:'LTAI5tNycA46YTwm383dRvMV',
			//密钥s
			accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG',
			//桶的名字
			bucket: 'zhuoqiu-image',
			endpoint:'oss-cn-guangzhou.aliyuncs.com',
		}
	},
}

uni.$uv.setConfig({
	config: {
		unit: 'rpx'
	},
})

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

Vue.prototype.$api = api

export default Vue.prototype.$config