<template>
  <div>login</div>
</template>
<script lang="ts">
import {Component, Vue} from "vue-property-decorator";
@Component({
  components: {
  },
})
export default class signIn extends Vue {
  public async created() {
    const id = '123124'; // todo 从对方 iframe 拿数据
    // todo 接口待适配
    const res = await this.$ajax({
      type: "post",
      url: 'http://124.71.144.118:46789/api/user/demo/token',
      params: { id },
    });

    if (res) {
      sessionStorage.setItem(`user`, JSON.stringify({
        id,
        token: res.data.token
      }));
      this.$router.push({ path: "/categoryManage" });
    }
  }
}
</script>
<style>
</style>
