<template>
  <div class="mini_login_box">
    <div class="login_form_box">
        <login-panel
          @loginSuccess="handleLoginSuccess"
          :miniLoginInfo="miniLoginInfo"
        >
        </login-panel>
    </div>
  </div>
</template>
<script>
import LoginPanel from "../components/LoginPanel.vue";
import {
  getUrlValue,
} from "../utils/index.js";

export default {
  components: {
    LoginPanel
  },
  data() {
    return {
      msg: "这是小登录页",
      oldUserName:(top.window.Scp&&top.window.Scp.User.fuserid)||false,
      username: (top.window.Scp&&top.window.Scp.User.fuserid)||"",
     
      questType:getUrlValue("","questType"),
      isRefresh:getUrlValue("","isRefresh")=="true"?true:false,
   
    };
  },
  computed:{
    miniLoginInfo(){
      return {
        username:this.username,
        oldUserName:this.oldUserName,
        questType:this.questType,
        isRefresh:this.isRefresh,
      }
    }
  },
  async created(){
  },
  mounted() {},
  methods: {
    handleLoginSuccess(data){
       if(this.questType=="ajax"){
            top.window.SysPage.closeMiniLogin(this.isRefresh);
        }else{
            location.reload();
        }
    },
 
  }
};
</script>
<style lang="scss" scoped>
.mini_login_box{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  .login_form_box{
    width: 400px;
  }
}

</style>
