You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.2 KiB
92 lines
2.2 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../css/landc.css">
|
|
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
|
|
|
<script src="../js/vue.js"></script>
|
|
<script src="../js/axios.min.js"></script>
|
|
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
|
|
|
<script src="../js/jquery-1.12.4.js"></script>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="main">
|
|
<form action="/login" id="loginForm">
|
|
<div id="top">
|
|
设备管理系统
|
|
</div>
|
|
<div class="lo">
|
|
<div class="bg t1"></div>
|
|
<input class="inp" id="username" name="username" v-model="user.username" type="text" placeholder="请输入用户名">
|
|
</div>
|
|
<div class="lo">
|
|
<div class="bg t2"></div>
|
|
<input class="inp" id="password" v-model="user.password" type="password" placeholder="请输入用密码">
|
|
</div>
|
|
<div>
|
|
<input type="button" @click="login" value="立即登陆" id="btn">
|
|
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<p id=foot>
|
|
©版本所有 2024期 |
|
|
<a id=a1 href="https://www.baidu.com/">山东科技大学</a>
|
|
</p>
|
|
</div>
|
|
|
|
<script>
|
|
new Vue({
|
|
el:'#app',
|
|
data:{
|
|
user:{
|
|
username:"",
|
|
password:""
|
|
},
|
|
|
|
|
|
|
|
},
|
|
methods:{
|
|
login(){
|
|
//向后端发送请求
|
|
axios.post("/user/login",this.user).then(resp=>{
|
|
//sessionStrorage浏览器缓存浏览器关闭失效
|
|
//localStrorage文件系统
|
|
|
|
if(resp.data.code==200){
|
|
sessionStorage.setItem("loginUser",JSON.stringify(resp.data.data))
|
|
|
|
location.href="http://localhost/index.html"//通过location对象跳转
|
|
|
|
|
|
}else {
|
|
alert(resp.data.message)
|
|
//location.reload()
|
|
this.user.username=""
|
|
this.user.password=""
|
|
}
|
|
})
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
<!-- <script src="../js/land.js" type="text/javascript"></script>-->
|
|
</body>
|
|
</html> |