1.任务量:10天
目前已经花费的时间:6天
还剩余的时间:4天
3.
4.vue的部分完成,只不过还没调试vue和springboot的接口。
<template> <div class="login-wrap"> <el-form class="login-container"> <h1 class="title">用户登录:</h1> <el-form-item> <el-input type="text" placeholder="用户账号" v-model="username" autocomplete="off" ></el-input> </el-form-item> <el-form-item> <el-input type="password" placeholder="用户密码" v-model="password" autocomplete="off" ></el-input> </el-form-item> <el-form-item> <el-button type="primary" @click="doLogin" style="width: 100%">登录</el-button> </el-form-item> <el-form-item> <el-button type="primary" @click="toRegister" style="width: 100%">注册</el-button> </el-form-item> <!-- <el-link type="primary" @click="toRegister">用户注册</el-link> --> <!-- <el-link type="primary">忘记密码</el-link> --> </el-form> </div> </template> <script> import { reqUserLogin } from '@/api'; import { mapState } from "vuex"; export default { name: "Login", data: function () { return { username: "", password: "", }; }, // mounted() { // //派发action,通知vuex发请求 // this.$store.dispatch("userLoginMock"); // }, // computed: { // ...mapState({ // usermock: (state) => state.user.usermock, // //bookList: (state) => state.booktext.bookList, // }), // }, methods: { doLogin (){ //alert(132); const { username, password } = this; //在发登录请求 try { //登录成功 this.$store.dispatch("userLoginMock", { username, password }); // const res = reqUserLogin({username,password}); // console.log(res); // console.log(222); if (JSON.parse(sessionStorage.getItem("userinfo"))) { alert("登录成功") }else{ alert("登陆失败") } // let goPath = this.$route.query.redirect||'/home'; //跳转到首页 this.$router.push('search'); } catch (error) { alert(error.message); } }, toRegister: function () { this.$router.push("/register"); }, }, }; </script> <style> .login-wrap { box-sizing: border-box; width: 100%; height: 100%; padding-top: 10%; } .login-container { border-radius: 10px; margin: 0px auto; width: 350px; padding: 30px 35px 15px 35px; background: #fff; border: 1px solid #eaeaea; text-align: left; box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0.1); } .title { margin: 0px auto 40px auto; text-align: center; color: #505458; } </style>
标签:username,团队,登录,auto,冲刺,alert,state,password From: https://www.cnblogs.com/teamno12/p/17342215.html