<script>
import config from './config.js'
import { getAccessToken, setOpenId, getOpenId } from '@/utils/auth'
export default {
  data() {
    return {}
  },
  async onLaunch(options) {
    await this.initApp()
  },
  methods: {
    // 初始化应用
    initApp() {
      uni.hideTabBar()
      // 初始化应用配置
      this.initConfig()
    },
    initConfig() {
      this.globalData.config = config
      uni.getSystemInfoAsync({
        success: res => {
          uni.setStorageSync('MOBILE', res.model)
          uni.setStorageSync('SYSTEM', res.system)
          uni.setStorageSync('PIXELRATIO', res.pixelRatio)
        },
        fail: err => {
          console.error('获取设备信息失败：', err)
        }
      })
    }
  }
}
</script>

<style lang="scss">
@import '@/uni_modules/windi-css-uniapp/index.scss';
@import '@/static/scss/index.scss';
</style>
