|
|
|
@ -16,7 +16,11 @@ func RenderLogin(w http.ResponseWriter, render interface{}) {
|
|
|
|
|
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
|
|
|
|
<meta name="generator" content="Jekyll v3.8.6">
|
|
|
|
|
<title>邮箱IMAP-登录页</title>
|
|
|
|
|
<!-- Bootstrap core CSS -->
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
|
|
|
|
|
<!-- Bootstrap core CSS -->
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
@ -38,7 +42,6 @@ func RenderLogin(w http.ResponseWriter, render interface{}) {
|
|
|
|
|
body {
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
body {
|
|
|
|
|
display: -ms-flexbox;
|
|
|
|
|
display: flex;
|
|
|
|
@ -82,19 +85,61 @@ func RenderLogin(w http.ResponseWriter, render interface{}) {
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body class="text-center">
|
|
|
|
|
<form class="form-signin" action="/login" method="post">
|
|
|
|
|
<h1 class="h3 mb-3 font-weight-normal">邮箱IMAP工具</h1>
|
|
|
|
|
<label for="inputServer" class="sr-only">IMAP服务器:</label>
|
|
|
|
|
<input type="text" name="server" id="inputServer" class="form-control" placeholder="IMAP服务器" required autofocus>
|
|
|
|
|
<label for="inputEmail" class="sr-only">邮箱地址:</label>
|
|
|
|
|
<input type="email" id="inputEmail" name="email" class="form-control" placeholder="邮箱地址" required autofocus>
|
|
|
|
|
<label for="inputPassword" class="sr-only">密码:</label>
|
|
|
|
|
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="密码" required>
|
|
|
|
|
{{if .}}<div class="alert alert-danger" role="alert">{{.}}</div>{{end}}
|
|
|
|
|
<button class="btn btn-lg btn-primary btn-block" type="submit">登陆</button>
|
|
|
|
|
<p class="mt-5 mb-3 text-muted">© 2020</p>
|
|
|
|
|
</form>
|
|
|
|
|
<div id="app" style="width:100%">
|
|
|
|
|
<template>
|
|
|
|
|
<div class="form-signin">
|
|
|
|
|
<h1 class="h3 mb-3 font-weight-normal">邮箱IMAP工具</h1>
|
|
|
|
|
<label for="inputServer" class="sr-only">IMAP服务器:</label>
|
|
|
|
|
<input type="text" v-model="imapServer" name="server" id="inputServer" class="form-control" placeholder="IMAP服务器如imap.sina.net:143" required autofocus>
|
|
|
|
|
<label for="inputEmail" class="sr-only">邮箱地址:</label>
|
|
|
|
|
<input type="email" v-model="imapEmail" id="inputEmail" name="email" class="form-control" placeholder="邮箱地址" required autofocus>
|
|
|
|
|
<label for="inputPassword" class="sr-only">密码:</label>
|
|
|
|
|
<input type="password" v-model="imapPass" name="password" id="inputPassword" class="form-control" placeholder="密码" required>
|
|
|
|
|
{{if .}}<div class="alert alert-danger" role="alert">{{.}}</div>{{end}}
|
|
|
|
|
<el-button :loading="false" type="primary" v-on:click="checkEmailPass">登陆</el-button>
|
|
|
|
|
<p class="mt-5 mb-3 text-muted">© 2020</p>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
<script>
|
|
|
|
|
new Vue({
|
|
|
|
|
el: '#app',
|
|
|
|
|
data: {
|
|
|
|
|
imapEmail:"",
|
|
|
|
|
imapServer:"",
|
|
|
|
|
imapPass:"",
|
|
|
|
|
loading:false,
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
checkEmailPass: function () {
|
|
|
|
|
var data={}
|
|
|
|
|
data.server=this.imapServer;
|
|
|
|
|
data.email=this.imapEmail;
|
|
|
|
|
data.password=this.imapPass;
|
|
|
|
|
let _this=this;
|
|
|
|
|
this.loading=true;
|
|
|
|
|
$.post("/check",data,function(data){
|
|
|
|
|
if(data.code==200){
|
|
|
|
|
_this.$message({
|
|
|
|
|
message: data.msg,
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
_this.$message({
|
|
|
|
|
message: data.msg,
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
_this.loading=false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
</html>
|
|
|
|
|
`
|
|
|
|
|
t, _ := template.New("list").Parse(html)
|
|
|
|
|