<template>
  <div class="app-container">
    <div class="container">
      <el-form ref="form" :model="form" label-width="120px" label-position="left">
        <el-form-item label="请输入授权码:">
          <el-input v-model="form.sqm"></el-input>
        </el-form-item>
      </el-form>
      <footer>
        <el-button type="primary" @click="save">保 存</el-button>
      </footer>
    </div>
  </div>
</template>
<script>
import { addAuthorizationSqm } from '@/api/system/index'
export default {
  data () {
    return {
      form: {
        sqm: ''
      }
    }
  },
  methods: {
    save () {
      let params = {
        sqm:this.form.sqm
      }
      addAuthorizationSqm(params).then(res => {
        // console.log(res,'addAuthorizationSqm')
        if(res.code == 200) {
          this.$router.push({path:'/dashboard'})
        }else if (res.code == 400){
          this.$message({
              type: 'error',
              message: '授权码过期或不正确!'
            });
        }
      }).catch(err => {
        console.log(res)
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.app-container {
  height: calc(100vh - 86px);
}
.container {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #e6e6e6e0;
  border-radius: 15px;
  .el-form  {
    display: flex;
    align-items: center;
    flex: 1;
  }
  footer {
    margin-bottom: 30px;
  }
}
</style>