<template>
  <div class="page-padding">
    <div>用户名</div>
    <input type="text" v-model="account" rows="1"></input>
    <div>密码</div>
    <input type="text" v-model="passwd" rows="1"></input>
    <div class="login-btn" @click.stop="loginAction">登陆</div>
  </div>
</template>

<script>
  import {loginMember} from '../service/getData'
  import md5 from 'js-md5'
  import Input from "iview/src/components/input/input";
export default {
  name: 'Login',
  components: {Input},
  data () {
    return {
      account: 'zzwyadmin',
      passwd: '123456'
    }
  },

  methods: {
    loginAction () {
      let params = {
        userAccount: this.account,
        platform:'1',
        version:'6',
        password:this.passwd,
      }

      let that = this
      loginMember(params).then((res) => {
        if (res.status === '200') {
          let data = res.data;
          localStorage.setItem('memberId',data.id);
          localStorage.setItem('token',data.token);

        }
      }).catch((error) => {
      })
    },

  }
}
</script>

<style lang="scss" scoped>
.page-padding {
  padding: 10px;
}

.login-btn {
  margin-top: 10px;
  width: 100px;
  height: 35px;
  background-color: #22BEEB;
  color: #fff;
  text-align: center;
  line-height: 35px;
}
</style>
