<template>
  <el-row class="movie-list">
    <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
      <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>当前公告</span>
          </div>
          <div class="text item">
            <span v-html="loginUser.signature" />
          </div>
        </el-card>
      </el-row>
    </el-col>
    <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
      <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>新公告</span>
            <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdate">更新</el-button>
          </div>
          <div class="text item">
            <el-form ref="form" :model="loginUser">
              <el-form-item>
                <el-input v-model="loginUser.signature" type="textarea" autosize style="padding-right: 1px" />
              </el-form-item>
            </el-form>
          </div>
        </el-card>
      </el-row>
    </el-col>
  </el-row>
</template>

<script>
import { getAuthedUser } from '@/utils/auth'

export default {
  name: 'SiteConfig',
  data() {
    return {
      loginUser: null
    }
  },
  created() {
    document.title = '站点配置'
    this.loginUser = getAuthedUser()
  },
  mounted() {
  },
  methods: {
    onUpdate() {
      console.log(this.loginUser.signature)
    }
  }
}
</script>

<style>
</style>
