nelson
3 years ago
5 changed files with 10 additions and 215 deletions
@ -1,123 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html> |
|
||||
<head> |
|
||||
<meta charset="utf-8"> |
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
||||
<meta name="description" content="码农随笔,个人随笔是一个面向IT技术人员,提供个人平时工作总结和在线记录学习笔记,个人技术博客,在线云笔记,码农笔录,最新的技术博客,www.aiprose.com"> |
|
||||
<meta name="keywords" |
|
||||
content="码农随笔,个人随笔,博客,个人博客,个人笔记,技术博客,免费云笔记,云笔记,随笔,IT博客,谷歌地图,码农笔录,www.aiprose.com,aiprose.com,aiprose"> |
|
||||
<link rel="stylesheet" href="//oss.aiprose.com/ali/sui/css/sui.min.css"> |
|
||||
<script type="text/javascript" src="//oss.aiprose.com/ali/jquery/jquery.min.js"></script> |
|
||||
<script type="text/javascript" src="//oss.aiprose.com/ali/sui/js/sui.min.js"></script> |
|
||||
<title>首页 - 码农随笔</title> |
|
||||
<style> |
|
||||
.common { |
|
||||
margin: 0 0 3px 0; |
|
||||
} |
|
||||
|
|
||||
.common label { |
|
||||
width: 42px; |
|
||||
} |
|
||||
|
|
||||
.common input { |
|
||||
width: 150px; |
|
||||
height: 26px; |
|
||||
border-radius: 5px; |
|
||||
border: 1px solid #ddd; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body> |
|
||||
<div style="margin: 20px 35px;"> |
|
||||
<div class="common"> |
|
||||
<label>生日:</label> |
|
||||
<input type="text" id="birthday" class="form-control" style="display: inline-block" placeholder="输入日期" |
|
||||
data-toggle="datepicker" value='{{.User.Birthday.Format "2006-01-02"}}' |
|
||||
data-date-start-date='1969-12-12'/> |
|
||||
</div> |
|
||||
<div class="common"> |
|
||||
<label>昵称:</label> |
|
||||
<input id="nickName" value="{{.User.NickName}}"> |
|
||||
</div> |
|
||||
<div class="common"> |
|
||||
<label>邮箱:</label> |
|
||||
<input type="email" id="email" value="{{.User.Email}}"> |
|
||||
</div> |
|
||||
<div class="common"> |
|
||||
<label>手机:</label> |
|
||||
<input type="number" id="mobile" value="{{.User.Mobile}}"> |
|
||||
</div> |
|
||||
<div class="common"> |
|
||||
<label>Q Q:</label> |
|
||||
<input type="number" id="qqnum" value="{{.User.QQ}}"> |
|
||||
</div> |
|
||||
<div class="common"> |
|
||||
<label>性别:</label> |
|
||||
<select class="form-control " style="width: 150px;display: inline-block;height: 26px" id="catory"> |
|
||||
<option value="1">男</option> |
|
||||
<option value="0">女</option> |
|
||||
</select> |
|
||||
</div> |
|
||||
<div class="common"> |
|
||||
<label>简介:</label> |
|
||||
<textarea class="form-control" id="mdesc" rows="3"></textarea> |
|
||||
</div> |
|
||||
<div class="common" style="text-align: end;margin-top: 20px"> |
|
||||
<button type="button" class="btn btn-xl" id="cancelBtn">取消</button> |
|
||||
<button type="button" class="btn btn-primary btn-xl" id="saveBtn">保存</button> |
|
||||
</div> |
|
||||
|
|
||||
</div> |
|
||||
</body> |
|
||||
<script> |
|
||||
$(function () { |
|
||||
$("#mdesc").val("{{.User.DescInfo}}") |
|
||||
if(!{{.IsLogin}}){ |
|
||||
parent.location.href = "/login" |
|
||||
} |
|
||||
$("#saveBtn").click(function () { |
|
||||
var obj = {} |
|
||||
obj.birthday = $("#birthday").val() |
|
||||
obj.nickName = $("#nickName").val() |
|
||||
obj.email = $("#email").val() |
|
||||
if (obj.email && obj.email.trim().length != 0) { |
|
||||
reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; |
|
||||
if (!reg.test(obj.email)) { |
|
||||
layer.msg('邮箱格式不正确', function () { |
|
||||
}); |
|
||||
return |
|
||||
} |
|
||||
} |
|
||||
obj.mobile = $("#mobile").val() |
|
||||
if (obj.mobile && obj.mobile.trim() != "") { |
|
||||
if (obj.mobile.trim().length != 11) { |
|
||||
layer.msg('手机号格式不对', function () { |
|
||||
}); |
|
||||
return |
|
||||
} |
|
||||
} |
|
||||
obj.qqnum = $("#qqnum").val() |
|
||||
obj.catory = $("#catory").val() |
|
||||
obj.mdesc = $("#mdesc").val() |
|
||||
$.post('/api/user/edit', obj, |
|
||||
function (data) { |
|
||||
if (data.Status == 0) { |
|
||||
parent.layer.msg("保存成功", {icon: 6}); |
|
||||
var index = parent.layer.getFrameIndex(window.name); |
|
||||
parent.layer.close(index); |
|
||||
parent.refresh() |
|
||||
} else if (data.Status == 401) { |
|
||||
parent.location.href = "/login" |
|
||||
parent.layer.close(index); |
|
||||
} else { |
|
||||
layer.msg("服务器异常", {icon: 5}); |
|
||||
} |
|
||||
}, 'json') |
|
||||
}) |
|
||||
$("#cancelBtn").click(function () { |
|
||||
var index = parent.layer.getFrameIndex(window.name); |
|
||||
parent.layer.close(index); |
|
||||
}) |
|
||||
}) |
|
||||
</script> |
|
||||
</html> |
|
@ -1,77 +0,0 @@ |
|||||
{{template "header" .}} |
|
||||
<meta name="keywords" content="码农随笔,个人随笔,博客,个人博客,个人笔记,技术博客,免费云笔记,云笔记,随笔,IT博客,谷歌地图,码农笔录,aiprose"> |
|
||||
<title>注册 - 码农随笔</title> |
|
||||
</head> |
|
||||
<body> |
|
||||
<div class="root-container"> |
|
||||
{{template "nav" .}} |
|
||||
<div class="login-root"> |
|
||||
<div class="input-container"> |
|
||||
<div class="input-root"> |
|
||||
<div class="inputs-class regist"> |
|
||||
<i-form> |
|
||||
<form-item prop="user"> |
|
||||
<i-input type="text" v-model="user.username" placeholder="请输入用户名"> |
|
||||
<Icon type="ios-person-outline" slot="prepend"></Icon> |
|
||||
</i-input> |
|
||||
</form-item> |
|
||||
<form-item prop="password"> |
|
||||
<i-input type="password" v-model="user.userpwd" placeholder="请输入密码"> |
|
||||
<Icon type="ios-lock-outline" slot="prepend"></Icon> |
|
||||
</i-input> |
|
||||
</form-item> |
|
||||
<form-item prop="password"> |
|
||||
<i-input type="password" v-model="user.userpwdrepeat" placeholder="请重复密码"> |
|
||||
<Icon type="ios-lock-outline" slot="prepend"></Icon> |
|
||||
</i-input> |
|
||||
</form-item> |
|
||||
<i-button type="info" long @click="regist">快速注册</i-button> |
|
||||
</i-form> |
|
||||
<div class="login-bottom"> |
|
||||
<a href="/login">快速登录</a> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</body> |
|
||||
<script> |
|
||||
var app = new Vue({ |
|
||||
el: ".root-container", |
|
||||
delimiters: ['${', '}'], |
|
||||
data: { |
|
||||
user: {} |
|
||||
}, |
|
||||
methods: { |
|
||||
regist (){ |
|
||||
var _this= this |
|
||||
if (this.user.username.trim().length < 4) { |
|
||||
this.$Message.warning('用户名最低4位'); |
|
||||
return |
|
||||
} |
|
||||
if (this.user.userpwd.trim().length < 6) { |
|
||||
this.$Message.warning('密码最低6位'); |
|
||||
return |
|
||||
} |
|
||||
if (!this.user.userpwdrepeat || (this.user.userpwdrepeat.trim() != this.user.userpwd.trim())) { |
|
||||
this.$Message.warning('两次密码输入不一致'); |
|
||||
return |
|
||||
} |
|
||||
$.post('/api/regist', this.user, |
|
||||
function (data) { |
|
||||
if (data.Status == 1) { |
|
||||
_this.$Message.warning(data.Msg); |
|
||||
} else { |
|
||||
_this.$Message.success("注册成功,现在去登陆哦"); |
|
||||
setTimeout(function () { |
|
||||
window.location.href = "/login" |
|
||||
}, 800) |
|
||||
} |
|
||||
}, 'json') |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
</script> |
|
||||
<script type="text/javascript" src="/static/js/seo.js"></script> |
|
||||
</html> |
|
Loading…
Reference in new issue