mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-19 18:22:10 +08:00
搭建框架
This commit is contained in:
158
views/account/login.tpl
Normal file
158
views/account/login.tpl
Normal file
@@ -0,0 +1,158 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="author" content="SmartWiki" />
|
||||
<title>用户登录 - Powered by MinDoc</title>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/static/css/main.css" rel="stylesheet">
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="static/bootstrap/js/html5shiv.min.js"></script>
|
||||
<script src="/static/bootstrap/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
||||
<script src="/static/jquery/1.12.4/jquery.min.js"></script>
|
||||
</head>
|
||||
<body class="manual-container">
|
||||
<header class="navbar navbar-static-top smart-nav navbar-fixed-top manual-header" role="banner">
|
||||
<div class="container">
|
||||
<div class="navbar-header col-sm-12 col-md-6 col-lg-5">
|
||||
<a href="/" class="navbar-brand">MinDoc</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container manual-body">
|
||||
<div class="row login">
|
||||
<div class="login-body">
|
||||
<form role="form" method="post">
|
||||
<h3 class="text-center">用户登录</h3>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-user"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="用户名" name="account" id="account" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-lock"></i>
|
||||
</div>
|
||||
<input type="password" class="form-control" placeholder="密码" name="passwd" id="passwd" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
{{if ne .ENABLED_CAPTCHA "false"}}
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-check-square"></i>
|
||||
</div>
|
||||
<input type="text" name="code" id="code" class="form-control" style="width: 150px" maxlength="5" placeholder="验证码" autocomplete="off">
|
||||
<img id="captcha-img" src="" onclick="this.src='/verify?key=login&t='+(new Date()).getTime();" title="点击换一张">
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="is_remember"> 保持登录
|
||||
</label>
|
||||
<a href="{{urlfor "AccountController.FindPassword" }}" style="display: inline-block;float: right">忘记密码?</a>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="button" id="btn-login" class="btn btn-success" style="width: 100%" data-loading-text="正在登录..." autocomplete="off">立即登录</button>
|
||||
</div>
|
||||
{{if ne .ENABLED_REGISTER "false"}}
|
||||
<div class="form-group">
|
||||
还没有账号?<a href="{{urlfor "AccountController.Register" }}" title="立即注册">立即注册</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{template "widgets/footer.tpl" .}}
|
||||
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
||||
<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/layer/layer.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#account,#passwd,#code").on('focus',function () {
|
||||
$(this).tooltip('destroy').parents('.form-group').removeClass('has-error');;
|
||||
});
|
||||
|
||||
$(document).keydown(function (e) {
|
||||
var event = document.all ? window.event : e;
|
||||
if(event.keyCode === 13){
|
||||
$("#btn-login").click();
|
||||
}
|
||||
});
|
||||
$("#btn-login").on('click',function () {
|
||||
var $btn = $(this).button('loading');
|
||||
|
||||
var account = $.trim($("#account").val());
|
||||
var passwd = $.trim($("#passwd").val());
|
||||
var code = $("#code").val();
|
||||
if(account === ""){
|
||||
$("#account").tooltip({placement:"auto",title : "账号不能为空",trigger : 'manual'})
|
||||
.tooltip('show')
|
||||
.parents('.form-group').addClass('has-error');
|
||||
$btn.button('reset');
|
||||
return false;
|
||||
|
||||
}else if(passwd === ""){
|
||||
$("#passwd").tooltip({title : '密码不能为空',trigger : 'manual'})
|
||||
.tooltip('show')
|
||||
.parents('.form-group').addClass('has-error');
|
||||
$btn.button('reset');
|
||||
return false;
|
||||
}else if(code !== undefined && code === ""){
|
||||
$("#code").tooltip({title : '验证码不能为空',trigger : 'manual'})
|
||||
.tooltip('show')
|
||||
.parents('.form-group').addClass('has-error');
|
||||
$btn.button('reset');
|
||||
return false;
|
||||
}else{
|
||||
$.ajax({
|
||||
url : "{{urlfor "AccountController.Login"}}",
|
||||
data : $("form").serializeArray(),
|
||||
dataType : "json",
|
||||
type : "POST",
|
||||
success : function (res) {
|
||||
|
||||
if(res.errcode != 20001){
|
||||
$("#captcha-img").click();
|
||||
$("#code").val('');
|
||||
layer.msg(res.message);
|
||||
$btn.button('reset');
|
||||
}else{
|
||||
window.location = "/";
|
||||
}
|
||||
|
||||
},
|
||||
error :function () {
|
||||
$("#captcha-img").click();
|
||||
$("#code").val('');
|
||||
layer.msg('系统错误');
|
||||
$btn.button('reset');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -33,7 +33,7 @@
|
||||
<div class="m-box">
|
||||
<div class="box-head">
|
||||
<strong class="box-title">项目列表</strong>
|
||||
<a href="{{urlfor "BookController.Create"}}" class="btn btn-success btn-sm pull-right">添加项目</a>
|
||||
<button type="button" data-toggle="modal" data-target="#addBookDialogModal" class="btn btn-success btn-sm pull-right">添加项目</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@@ -72,8 +72,114 @@
|
||||
</div>
|
||||
{{template "widgets/footer.tpl" .}}
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="addBookDialogModal" tabindex="-1" role="dialog" aria-labelledby="addBookDialogModalLabel">
|
||||
<div class="modal-dialog" role="document" style="width: 655px">
|
||||
<form method="post" autocomplete="off" action="{{urlfor "BookController.Create"}}" id="addBookDialogForm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">添加项目</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="标题(不超过100字)" name="book_name" id="bookName">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="pull-left" style="padding: 7px 5px 6px 0">
|
||||
{{.BaseUrl}}{{urlfor "DocumentController.Index" ":key" ""}}
|
||||
</div>
|
||||
<input type="text" class="form-control pull-left" style="width: 220px;vertical-align: middle" placeholder="项目唯一标识(不能超过50字)" name="identify" id="identify">
|
||||
<div class="clearfix"></div>
|
||||
<p class="text" style="font-size: 12px;color: #999;margin-top: 6px;">文档标识只能包含小写字母、数字,以及“-”和“_”符号,并且只能小写字母打头</p>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea name="description" id="description" class="form-control" placeholder="描述信息不超过500个字符" style="height: 90px;"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-6">
|
||||
<label>
|
||||
<input type="radio" name="privately_owned" value="0" checked> 公开<span class="text">(任何人都可以访问)</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<label>
|
||||
<input type="radio" name="privately_owned" value="1"> 私有<span class="text">(只要参与者或使用令牌才能访问)</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-3">
|
||||
<label>
|
||||
<input type="radio" checked name="comment_status" value="open">允许所有人评论<span class="text"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<label>
|
||||
<input type="radio" name="comment_status" value="">关闭评论<span class="text"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<label>
|
||||
<input type="radio" name="comment_status" value="">仅允许参与者评论<span class="text"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<label>
|
||||
<input type="radio" name="comment_status" value="registered_only">仅允许注册者评论<span class="text"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<span id="form-error-message"></span>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-success">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div><!--END Modal-->
|
||||
|
||||
<script src="/static/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="/static/js/jquery.form.js" type="text/javascript"></script>
|
||||
<script src="/static/js/main.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#addBookDialogForm").ajaxForm({
|
||||
beforeSubmit : function () {
|
||||
var bookName = $.trim($("#bookName").val());
|
||||
if(bookName === ""){
|
||||
return showError("项目标题不能为空")
|
||||
}
|
||||
if(bookName.length > 100){
|
||||
return showError("项目标题必须小于100字符");
|
||||
}
|
||||
|
||||
var identify = $.trim($("#identify").val());
|
||||
if(identify === ""){
|
||||
return showError("项目标识不能为空");
|
||||
}
|
||||
if(identify.length > 50){
|
||||
return showError("项目标识必须小于50字符");
|
||||
}
|
||||
var description = $.trim($("#description").val());
|
||||
|
||||
if(description.length > 500){
|
||||
return showError("描述信息不超过500个字符");
|
||||
}
|
||||
return showSuccess("");
|
||||
},
|
||||
success : function (res) {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -10,8 +10,10 @@
|
||||
<!-- Bootstrap -->
|
||||
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
|
||||
<link href="/static/webuploader/webuploader.css" rel="stylesheet">
|
||||
<link href="/static/cropper/2.3.4/cropper.min.css" rel="stylesheet">
|
||||
<link href="/static/css/main.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
@@ -41,23 +43,19 @@
|
||||
<form role="form" method="post" id="memberInfoForm">
|
||||
<div class="form-group">
|
||||
<label>用户名</label>
|
||||
<input type="text" class="form-control disabled">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-nickname">昵称</label>
|
||||
<input type="text" class="form-control" name="userNickname" id="user-nickname" max="20" placeholder="昵称" value="admin">
|
||||
<input type="text" class="form-control disabled" value="{{.Member.Account}}" disabled>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-email">邮箱<strong class="text-danger">*</strong></label>
|
||||
<input type="email" class="form-control" value="longfei6671@163.com" id="user-email" name="userEmail" max="100" placeholder="邮箱">
|
||||
<input type="email" class="form-control" value="{{.Member.Email}}" id="userEmail" name="email" max="100" placeholder="邮箱">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>手机号</label>
|
||||
<input type="text" class="form-control" id="user-phone" name="userPhone" maxlength="20" title="手机号码" placeholder="手机号码" value="">
|
||||
<input type="text" class="form-control" id="userPhone" name="phone" maxlength="20" title="手机号码" placeholder="手机号码" value="{{.Member.Phone}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="description">描述</label>
|
||||
<textarea class="form-control" rows="3" title="描述" name="description" id="description" maxlength="500"></textarea>
|
||||
<textarea class="form-control" rows="3" title="描述" name="description" id="description" maxlength="500">{{.Member.Description}}</textarea>
|
||||
<p style="color: #999;font-size: 12px;">描述不能超过500字</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -69,7 +67,7 @@
|
||||
<div class="form-right">
|
||||
<label>
|
||||
<a href="javascript:;" data-toggle="modal" data-target="#upload-logo-panel">
|
||||
<img src="/uploads/user/201612/58649aefa944e_58649aef.JPG" onerror="this.src='https://wiki.iminho.me/static/images/middle.gif'" class="img-circle" alt="头像" style="max-width: 120px;max-height: 120px;" id="headimgurl">
|
||||
<img src="{{.Member.Avatar}}" onerror="this.src='/static/images/middle.gif'" class="img-circle" alt="头像" style="max-width: 120px;max-height: 120px;" id="headimgurl">
|
||||
</a>
|
||||
</label>
|
||||
</div>
|
||||
@@ -79,7 +77,148 @@
|
||||
</div>
|
||||
{{template "widgets/footer.tpl" .}}
|
||||
</div>
|
||||
<script src="/static/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
|
||||
<!-- Start Modal -->
|
||||
<div class="modal fade" id="upload-logo-panel" tabindex="-1" role="dialog" aria-labelledby="修改头像" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title">修改头像</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="wraper">
|
||||
<div id="image-wraper">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="watch-crop-list">
|
||||
<div class="preview-title">预览</div>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="img-preview preview-lg"></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="img-preview preview-sm"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<span id="error-message"></span>
|
||||
<div id="filePicker" class="btn">选择</div>
|
||||
<button type="button" id="saveImage" class="btn btn-success" style="height: 40px;width: 77px;" data-loading-text="上传中...">上传</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--END Modal-->
|
||||
<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/webuploader/webuploader.min.js" type="text/javascript"></script>
|
||||
<script src="/static/cropper/2.3.4/cropper.min.js" type="text/javascript"></script>
|
||||
<script src="/static/js/jquery.form.js" type="text/javascript"></script>
|
||||
<script src="/static/js/main.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#upload-logo-panel").on("hidden.bs.modal",function () {
|
||||
$("#upload-logo-panel").find(".modal-body").html(window.modalHtml);
|
||||
}).on("show.bs.modal",function () {
|
||||
window.modalHtml = $("#upload-logo-panel").find(".modal-body").html();
|
||||
});
|
||||
|
||||
|
||||
$("#memberInfoForm").ajaxForm({
|
||||
beforeSubmit : function () {
|
||||
|
||||
var email = $.trim($("#userEmail").val());
|
||||
if(!email){
|
||||
return showError('邮箱不能为空');
|
||||
}
|
||||
$("button[type='submit']").button('loading');
|
||||
},
|
||||
success : function (res) {
|
||||
$("button[type='submit']").button('reset');
|
||||
if(res.errcode === 0){
|
||||
showSuccess("保存成功");
|
||||
}else{
|
||||
showError(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
var uploader = WebUploader.create({
|
||||
auto: false,
|
||||
swf: '/static/webuploader/Uploader.swf',
|
||||
server: '{{urlfor "SettingController.Upload"}}',
|
||||
pick: "#filePicker",
|
||||
fileVal : "image-file",
|
||||
fileNumLimit : 1,
|
||||
compress : false,
|
||||
accept: {
|
||||
title: 'Images',
|
||||
extensions: 'jpg,jpeg,png',
|
||||
mimeTypes: 'image/jpg,image/jpeg,image/png'
|
||||
}
|
||||
}).on("beforeFileQueued",function (file) {
|
||||
uploader.reset();
|
||||
}).on( 'fileQueued', function( file ) {
|
||||
uploader.makeThumb( file, function( error, src ) {
|
||||
$img = '<img src="' + src +'" style="max-width: 360px;max-height: 360px;">';
|
||||
if ( error ) {
|
||||
$img.replaceWith('<span>不能预览</span>');
|
||||
return;
|
||||
}
|
||||
|
||||
$("#image-wraper").html($img);
|
||||
window.ImageCropper = $('#image-wraper>img').cropper({
|
||||
aspectRatio: 1 / 1,
|
||||
dragMode : 'move',
|
||||
viewMode : 1,
|
||||
preview : ".img-preview"
|
||||
});
|
||||
}, 1, 1 );
|
||||
}).on("uploadError",function (file,reason) {
|
||||
console.log(reason);
|
||||
$("#error-message").text("上传失败:" + reason);
|
||||
|
||||
}).on("uploadSuccess",function (file, res) {
|
||||
|
||||
if(res.errcode === 0){
|
||||
console.log(res);
|
||||
$("#upload-logo-panel").modal('hide');
|
||||
$("#headimgurl").attr('src',res.url);
|
||||
}else{
|
||||
$("#error-message").text(res.message);
|
||||
}
|
||||
}).on("beforeFileQueued",function (file) {
|
||||
if(file.size > 1024*1024*2){
|
||||
uploader.removeFile(file);
|
||||
uploader.reset();
|
||||
alert("文件必须小于2MB");
|
||||
return false;
|
||||
}
|
||||
}).on("uploadComplete",function () {
|
||||
$("#saveImage").button('reset');
|
||||
});
|
||||
$("#saveImage").on("click",function () {
|
||||
var files = uploader.getFiles();
|
||||
if(files.length > 0) {
|
||||
$("#saveImage").button('loading');
|
||||
var cropper = window.ImageCropper.cropper("getData");
|
||||
|
||||
uploader.option("formData", cropper);
|
||||
|
||||
uploader.upload();
|
||||
}else{
|
||||
alert("请选择头像");
|
||||
}
|
||||
});
|
||||
}catch(e){
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -39,16 +39,16 @@
|
||||
<div class="box-body" style="width: 300px;">
|
||||
<form role="form" method="post" id="securityForm">
|
||||
<div class="form-group">
|
||||
<label>原始密码</label>
|
||||
<input type="password" name="password1" class="form-control disabled" placeholder="原始密码">
|
||||
<label for="password1">原始密码</label>
|
||||
<input type="password" name="password1" id="password1" class="form-control disabled" placeholder="原始密码">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user-nickname">新密码</label>
|
||||
<input type="password" class="form-control" name="password2" id="user-nickname" max="50" placeholder="新密码">
|
||||
<label for="password2">新密码</label>
|
||||
<input type="password" class="form-control" name="password2" id="password2" max="50" placeholder="新密码">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>确认密码</label>
|
||||
<input type="password" class="form-control" id="user-phone" name="password2" placeholder="确认密码">
|
||||
<label for="password3">确认密码</label>
|
||||
<input type="password" class="form-control" id="password3" name="password3" placeholder="确认密码">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success" data-loading-text="保存中...">保存修改</button>
|
||||
@@ -61,7 +61,47 @@
|
||||
</div>
|
||||
{{template "widgets/footer.tpl" .}}
|
||||
</div>
|
||||
<script src="/static/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="/static/js/jquery.form.js" type="text/javascript"></script>
|
||||
<script src="/static/js/main.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
$("#securityForm").ajaxForm({
|
||||
beforeSubmit : function () {
|
||||
var oldPasswd = $("#password1").val();
|
||||
var newPasswd = $("#password2").val();
|
||||
var confirmPassword = $("#password3").val();
|
||||
if(!oldPasswd ){
|
||||
showError("原始密码不能为空");
|
||||
return false;
|
||||
}
|
||||
if(!newPasswd){
|
||||
showError("新密码不能为空");
|
||||
return false;
|
||||
}
|
||||
if(!confirmPassword){
|
||||
showError("确认密码不能为空");
|
||||
return false;
|
||||
}
|
||||
if(confirmPassword !== newPasswd){
|
||||
showError("确认密码不正确");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success : function (res) {
|
||||
if(res.errcode === 0){
|
||||
showSuccess('保存成功');
|
||||
$("#password1").val('');
|
||||
$("#password2").val('');
|
||||
$("#password3").val('');
|
||||
}else{
|
||||
showError(res.message);
|
||||
}
|
||||
}
|
||||
}) ;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -12,7 +12,7 @@
|
||||
<li><a href="https://wiki.iminho.me/setting/site" class="item"><i class="fa fa-cogs"></i> 网站设置</a> </li>
|
||||
<li><a href="https://wiki.iminho.me/member/users" class="item"><i class="fa fa-group"></i> 用户管理</a> </li>
|
||||
<li>
|
||||
<a href="https://wiki.iminho.me/logout" title="退出登录"><i class="fa fa-sign-out"></i> 退出登录</a>
|
||||
<a href="{{urlfor "AccountController.Logout"}}" title="退出登录"><i class="fa fa-sign-out"></i> 退出登录</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -21,7 +21,7 @@
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<div class="img user-info" data-toggle="dropdown">
|
||||
<img src="/static/images/headimgurl.jpg" class="img-circle userbar-avatar">
|
||||
<img src="{{.Member.Avatar}}" class="img-circle userbar-avatar">
|
||||
<div class="userbar-content">
|
||||
<span>lifei6671</span>
|
||||
<div>管理员</div>
|
||||
@@ -36,10 +36,10 @@
|
||||
<a href="{{urlfor "BookController.Index"}}" title="我的项目"><i class="fa fa-book" aria-hidden="true"></i> 我的项目</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" title="用户管理"><i class="fa fa-users" aria-hidden="true"></i> 用户管理</a>
|
||||
<a href="{{urlfor "ManagerController.Users"}}" title="用户管理"><i class="fa fa-users" aria-hidden="true"></i> 用户管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://wiki.iminho.me/logout" title="退出登录"><i class="fa fa-sign-out"></i> 退出登录</a>
|
||||
<a href="{{urlfor "AccountController.Logout"}}" title="退出登录"><i class="fa fa-sign-out"></i> 退出登录</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user