|
|
|
@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml"
|
|
|
|
|
xmlns:v-bind="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8"/>
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
|
|
|
<meta http-equiv="pragma" content="no-cache" />
|
|
|
|
|
<meta http-equiv="content-type" content="no-cache, must-revalidate" />
|
|
|
|
|
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT"/>
|
|
|
|
|
<title>更新密码</title>
|
|
|
|
|
|
|
|
|
|
<link href="../css/bootstrap.min.css" rel="stylesheet"/>
|
|
|
|
|
<link href="../css/font-awesome.css" rel="stylesheet"/>
|
|
|
|
|
<link href="../css/basic.css" rel="stylesheet"/>
|
|
|
|
|
<link href="../css/custom.css" rel="stylesheet"/>
|
|
|
|
|
<link href="../css/element/index.css" rel="stylesheet"/>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
[v-cloak] {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div id="wrapper" v-cloak>
|
|
|
|
|
<nav class="navbar navbar-default navbar-cls-top " role="navigation" style="margin-bottom: 0">
|
|
|
|
|
<div class="navbar-header">
|
|
|
|
|
<a class="navbar-brand" href="index.html">后端管理系统</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="header-right">
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-info" @click="logout" title="退出登录">
|
|
|
|
|
<i class="fa fa-sign-out fa-2x"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="header-right">
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-info" title="跳转到个人信息" @click="personalPage">
|
|
|
|
|
<i class="fa fa-user fa-2x"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="header-right" style="padding-top: 25px">欢迎你,{{ user.name }}</div>
|
|
|
|
|
|
|
|
|
|
<div class="header-left">
|
|
|
|
|
<a href="/front/index.html" class="btn btn-info" title="跳转到首页">
|
|
|
|
|
<i class="fa fa-dot-circle-o fa-2x"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
<nav class="navbar-default navbar-side" role="navigation">
|
|
|
|
|
<div class="sidebar-collapse">
|
|
|
|
|
<ul class="nav" id="main-menu">
|
|
|
|
|
<li>
|
|
|
|
|
<a href="index.html"><i class="fa fa-dashboard"></i>系统首页</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="#"><i class="fa fa-yelp "></i>信息展示 <span class="fa arrow"></span></a>
|
|
|
|
|
<ul class="nav nav-second-level collapse in">
|
|
|
|
|
<li v-if="authority.indexOf(1) != -1">
|
|
|
|
|
<a href="adminInfo.html"><i class="fa fa-table"></i>管理员信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(2) != -1">
|
|
|
|
|
<a href="userInfo.html"><i class="fa fa-table"></i>用户信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(3) != -1">
|
|
|
|
|
<a href="classifyInfo.html"><i class="fa fa-table"></i>菜谱大类信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(4) != -1">
|
|
|
|
|
<a href="subClassifyInfo.html"><i class="fa fa-table"></i>菜谱小类信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(5) != -1">
|
|
|
|
|
<a href="foodsMenuInfo.html"><i class="fa fa-table"></i>菜谱信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(6) != -1">
|
|
|
|
|
<a href="foodsMaterialInfo.html"><i class="fa fa-table"></i>食材信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(7) != -1">
|
|
|
|
|
<a href="collectInfo.html"><i class="fa fa-table"></i>收藏信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(8) != -1">
|
|
|
|
|
<a href="praiseInfo.html"><i class="fa fa-table"></i>笔记点赞信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(9) != -1">
|
|
|
|
|
<a href="notesInfo.html"><i class="fa fa-table"></i>笔记信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(10) != -1">
|
|
|
|
|
<a href="newsInfo.html"><i class="fa fa-table"></i>饮食资讯信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(1000001) != -1">
|
|
|
|
|
<a href="advertiserInfo.html"><i class="fa fa-table"></i>公告信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li v-if="authority.indexOf(1000002) != -1">
|
|
|
|
|
<a href="messageInfo.html"><i class="fa fa-table"></i>趣味答题信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
<a href="javascript:void(0)" @click="personalPage"><i class="fa fa-user"></i>个人信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="notesInfoComment.html"><i class="fa fa-file"></i>笔记信息评论</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
<a href="updatePassword.html" class="active-menu"><i class="fa fa-unlock-alt"></i>修改密码</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="javascript:void(0)" @click="logout"><i class="fa fa-power-off"></i>退出登录</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
<div id="page-wrapper">
|
|
|
|
|
<div id="page-inner">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<h1 class="page-subhead-line">这是修改密码页,可以对自己的密码进行修改。 </h1>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
|
<div class="panel-heading">修改密码</div>
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
<form role="form" style="width: 300px">
|
|
|
|
|
<input type="hidden" id="id" name="id" v-model="entity.id">
|
|
|
|
|
<div class="form-group input-group">
|
|
|
|
|
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
|
|
|
|
<input type="password" class="form-control" v-model="entity.password" placeholder="原密码"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group input-group">
|
|
|
|
|
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
|
|
|
|
<input type="password" class="form-control" v-model="entity.newPassword" placeholder="新密码"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group input-group">
|
|
|
|
|
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
|
|
|
|
<input type="password" class="form-control" v-model="entity.new2Password" placeholder="确认密码"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
<a href="javascript:void(0)" @click="updatePassword()" class="btn btn-primary">提交</a>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script src="../js/jquery-1.10.2.js"></script>
|
|
|
|
|
<script src="../js/bootstrap.min.js"></script>
|
|
|
|
|
<script src="../js/jquery.metisMenu.js"></script>
|
|
|
|
|
<script src="../js/custom.js"></script>
|
|
|
|
|
<script src="../js/my.js"></script>
|
|
|
|
|
<script src="../js/vue2.6.11/vue.min.js"></script>
|
|
|
|
|
<script src="../js/vue2.6.11/axios.js"></script>
|
|
|
|
|
<script src="../js/element/index.js"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
function msg(type, msg) {
|
|
|
|
|
Vue.prototype.$message({
|
|
|
|
|
type: type, // success(成功)、warning(警告), error(错误)
|
|
|
|
|
message: msg,
|
|
|
|
|
duration: 2000,
|
|
|
|
|
offset: 100,
|
|
|
|
|
center: true,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
new Vue({
|
|
|
|
|
el: '#wrapper',
|
|
|
|
|
data: {
|
|
|
|
|
user: {},
|
|
|
|
|
authority: [],
|
|
|
|
|
objs: [],
|
|
|
|
|
entity: {}
|
|
|
|
|
},
|
|
|
|
|
created: function () {
|
|
|
|
|
|
|
|
|
|
this.user = JSON.parse(localStorage.getItem('user'));
|
|
|
|
|
|
|
|
|
|
axios.get("/getAccountInfo").then(res => {
|
|
|
|
|
if (res.data.code === '0') {
|
|
|
|
|
this.entity.id = res.data.data.id;
|
|
|
|
|
} else {
|
|
|
|
|
msg('error', res.data.msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
axios.get("/authority").then(res => {
|
|
|
|
|
if (res.data.code === '0') {
|
|
|
|
|
this.authority = res.data.data;
|
|
|
|
|
} else {
|
|
|
|
|
msg('error', res.data.msg);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
updatePassword: function () {
|
|
|
|
|
if (!this.entity.password || this.entity.password === '') {
|
|
|
|
|
msg('warning', '请输入原密码');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!this.entity.newPassword || this.entity.newPassword === '') {
|
|
|
|
|
msg('warning', '请输入新密码');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!this.entity.new2Password || this.entity.new2Password === '') {
|
|
|
|
|
msg('warning', '请确认密码');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.entity.newPassword !== this.entity.new2Password) {
|
|
|
|
|
msg('warning', '两次输入的新密码不一致');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
axios.put("/updatePassword", this.entity).then(res => {
|
|
|
|
|
if (res.data.code === '0') {
|
|
|
|
|
msg('success', '密码修改成功');
|
|
|
|
|
window.location = '/end/page/login.html';
|
|
|
|
|
} else {
|
|
|
|
|
msg('error', res.data.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
logout() {
|
|
|
|
|
logout();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|