import {
  createSSRApp
} from 'vue'
import App from './App.vue'
// 国际化
import { setupI18n } from './lang'
import { setupRouter } from './router'

// 兼容低版浏览器
import legacy from './plugin/legacy'
legacy()

// 设置默认语言
uni.getSystemInfo({
  success: () => {
    uni.setStorageSync('cloudLang', 'zh_CN')
  }
})
export function createApp () {
  const app = createSSRApp(App)
  app.use(setupI18n)
  setupRouter(app)
  return {
    app
  }
}
