// 引入模块
import App from './App'
import {
	createSSRApp
} from 'vue'
// 全局请求
import http from './utils/request.js'
// 精度计算
import decimal from './utils/decimal.js'
// 精度计算
import checkAccess from './utils/checkaccess.js'

export function createApp() {
	// 创建APP
	const app = createSSRApp(App)


	const CONSTANTS = {
		SHOP_TYPES: {
			1: '单店',
			2: '连锁',
			3: '诊所、社康等'
		}
	};

	// 挂载全局属性 
	app.config.globalProperties.$http = http
	// 挂载全局属性
	app.config.globalProperties.$decimal = decimal
	// 挂载全局属性
	app.config.globalProperties.$checkAccess = checkAccess
	// 全局注册组件
	// app.component()
	//挂载全局常量
	app.config.globalProperties.$CONSTANTS = CONSTANTS
	return {
		app
	}
}