<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
  import fs from 'fs'
  import path from 'path'
  import {reqImportConfigFiles} from "./api"

  export default {
    name: 'vedio_app',

    async mounted() {
      // 将配置文件传给服务器
      const formData = new FormData()
      let device = fs.readFileSync(path.join(__static, '/EnityDevice.json'), 'utf8')
      let bigscreen = fs.readFileSync(path.join(__static, '/EnityBigScreen.json'), 'utf8')

      formData.append('device',device)
      formData.append('bigscreen',bigscreen)

      // 发送请求将配置文件传给服务器
      const res = await reqImportConfigFiles(formData)
      if(!res){
        console.log('上传配置文件成功!')
      }
    }
  }
</script>

<style>

</style>
