中秋节快乐

This commit is contained in:
Alone
2024-09-14 17:00:49 +08:00
parent 610dee88cd
commit dff1b038b1
4286 changed files with 807503 additions and 6 deletions
+449
View File
@@ -0,0 +1,449 @@
<!DOCTYPE html>
<html>
<head>
<title>{$node.node_title}</title>
{include file="common/header"/}
<el-form :inline="true">
<el-form-item>
<el-button icon="el-icon-plus" size="small" @click="clickAdd" plain>添加</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-delete" size="small" @click="postMultDelete" plain>批量删除</el-button>
</el-form-item>
<div style="float:right">
<el-form-item>
<el-select placeholder="请选择状态" size="small" v-model="search.admin_status">
<el-option value="" label="全部用户">
</el-option>
<el-option value="0" label="正常用户">
</el-option>
<el-option value="1" label="禁用用户">
</el-option>
</el-select>
</el-form-item>
<el-form-item style="width:120px;">
<el-select placeholder="筛选类别" size="small" v-model="search.filter">
<el-option value="admin_id" label="用户ID">
</el-option>
<el-option value="admin_name" label="用户昵称">
</el-option>
<el-option value="admin_account" label="用户帐号">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input placeholder="输入关键词搜索" size="small" v-model="search.keyword"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList_search" plain>搜索</el-button>
</el-form-item>
</div>
</el-form>
<el-table :data="dataList.data" @selection-change="changeSelection" v-loading="loading">
<el-table-column type="selection" width="50">
</el-table-column>
<el-table-column prop="admin_id" label="ID" width="100">
</el-table-column>
<el-table-column prop="admin_account" label="帐号">
</el-table-column>
<el-table-column prop="admin_name" label="昵称">
</el-table-column>
<el-table-column prop="group_name" label="用户组">
</el-table-column>
<el-table-column prop="admin_ipreg" label="注册IP" width="150">
</el-table-column>
<el-table-column label="最后活跃" width="120">
<template slot-scope="scope">
{{time2string(scope.row.admin_updatetime)}}
</template>
</el-table-column>
<el-table-column label="注册时间" width="120">
<template slot-scope="scope">
{{time2string(scope.row.admin_createtime)}}
</template>
</el-table-column>
<el-table-column label="禁用" width="80">
<template slot-scope="scope">
<el-switch v-model="scope.row.admin_status==1?true:false" active-color="#ff4949"
@change="clickStatus(scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-link type="primary" @click="clickEdit(scope.row)" :underline="false">编辑</el-link>&nbsp;
<el-link type="danger" @click="clickDelete(scope.row)" :underline="false">删除</el-link>
</template>
</el-table-column>
</el-table>
<div class="page">
<el-pagination @size-change="handleSizeChange" :page-sizes="[10, 20, 50, 100,200,500]" :page-size="10"
layout="total, sizes, prev, pager, next, jumper" background @current-change="changeCurrentPage"
:current-page="dataList.current_page" :page-count="dataList.last_page" :total="dataList.total">
</el-pagination>
</div>
<!-- 添加框 -->
<el-dialog title="添加用户" :visible.sync="dialogFormAdd" :modal-append-to-body='false' append-to-body :close-on-click-modal='false'>
<el-form :model="formAdd" status-icon :rules="rules" ref="formAdd">
<el-form-item label="帐号" :label-width="formLabelWidth" prop="admin_account">
<el-input size="medium" autocomplete="off" v-model="formAdd.admin_account"></el-input>
</el-form-item>
<el-form-item label="密码" :label-width="formLabelWidth" prop="admin_password">
<el-input size="medium" show-password="true" autocomplete="off" v-model="formAdd.admin_password">
</el-input>
</el-form-item>
<el-form-item label="昵称" :label-width="formLabelWidth" prop="admin_name">
<el-input size="medium" autocomplete="off" v-model="formAdd.admin_name"></el-input>
</el-form-item>
<el-form-item label="邮箱" :label-width="formLabelWidth" prop="admin_email">
<el-input size="medium" autocomplete="off" v-model="formAdd.admin_email"></el-input>
</el-form-item>
<el-form-item label="身份证" :label-width="formLabelWidth" prop="admin_idcard">
<el-input size="medium" autocomplete="off" v-model="formAdd.admin_idcard"></el-input>
</el-form-item>
<el-form-item label="真实姓名" :label-width="formLabelWidth">
<el-input size="medium" autocomplete="off" v-model="formAdd.admin_truename"></el-input>
</el-form-item>
<el-form-item label="用户组" :label-width="formLabelWidth">
<el-select size="medium" placeholder="请选择用户组" v-model="formAdd.admin_group">
<el-option v-for="group_add in groupList" :value="group_add.group_id" :label="group_add.group_name">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="postAdd">确认添加</el-button>
</div>
</el-dialog>
<!-- 修改框 -->
<el-dialog title="修改用户" :visible.sync="dialogFormEdit" :modal-append-to-body='false' append-to-body :close-on-click-modal='false'>
<el-form :model="formEdit" status-icon :rules="rules" ref="formEdit">
<el-form-item label="帐号" :label-width="formLabelWidth" prop="admin_account">
<el-input size="medium" autocomplete="off" v-model="formEdit.admin_account"></el-input>
</el-form-item>
<el-form-item label="密码" :label-width="formLabelWidth" prop="new_password">
<el-input size="medium" show-password="true" autocomplete="off" v-model="formEdit.new_password"
placeholder="不修改请留空">
</el-input>
</el-form-item>
<el-form-item label="昵称" :label-width="formLabelWidth" prop="admin_name">
<el-input size="medium" autocomplete="off" v-model="formEdit.admin_name"></el-input>
</el-form-item>
<el-form-item label="邮箱" :label-width="formLabelWidth" prop="admin_email">
<el-input size="medium" autocomplete="off" v-model="formEdit.admin_email"></el-input>
</el-form-item>
<el-form-item label="身份证" :label-width="formLabelWidth" prop="admin_idcard">
<el-input size="medium" autocomplete="off" v-model="formEdit.admin_idcard"></el-input>
</el-form-item>
<el-form-item label="真实姓名" :label-width="formLabelWidth">
<el-input size="medium" autocomplete="off" v-model="formEdit.admin_truename"></el-input>
</el-form-item>
<el-form-item label="用户组" :label-width="formLabelWidth">
<el-select size="medium" placeholder="请选择用户组" v-model="formEdit.admin_group">
<el-option v-for="group_edit in groupList" :value="group_edit.group_id"
:label="group_edit.group_name"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="postEdit">确认修改</el-button>
</div>
</el-dialog>
{include file="common/footer"/}
<script>
var app = new Vue({
el: '#app',
data() {
this.getList();
return {
search: {
admin_status: "",
keyword: "",
filter: "admin_id"
},
formLabelWidth: '80px',
dialogFormAdd: false,
dialogFormEdit: false,
loading: true,
dataList: [],
groupList: [],
selectList: [],
form: {
page: 1,
per_page: 10
},
formAdd: {
admin_group: 1
},
formEdit: {
admin_group: 1
},
rules: {
admin_account: [
{ required: true, message: '帐号必须填写', trigger: 'blur' },
],
admin_name: [
{ required: true, message: '昵称必须填写', trigger: 'blur' },
],
admin_password: [
{ required: true, message: '密码必须填写', trigger: 'blur' },
// { required: true, pattern: /^(?=.*[a-z])(?=.*\d).{6,16}$/, message: '密码必须包含字母和数字(6-16位)', trigger: 'blur' },
],
new_password: [
{ required: true, message: '密码必须填写', trigger: 'blur' },
// { pattern: /^(?=.*[a-z])(?=.*\d).{6,16}$/, message: '密码必须包含字母和数字(6-16位)', trigger: 'blur' },
],
admin_email: [
{ pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/, message: '邮箱格式不正确', trigger: 'blur' },
],
admin_idcard: [
{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证格式不正确', trigger: 'blur' },
],
}
}
},
methods: {
getList_search() {
this.form.page = 1;
this.getList();
},
time2string(timestamps) {
var now = new Date(timestamps * 1000),
y = now.getFullYear(),
m = now.getMonth() + 1,
d = now.getDate();
// return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 8);
return (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 5);
},
handleSizeChange(per_page) {
this.form.per_page = per_page;
this.getList();
},
postMultDelete() {
var that = this;
if (that.selectList.length == 0) {
that.$message.error('未选择任何用户!');
return;
}
this.$confirm('即将删除选中的用户, 是否确认?', '批量删除', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
axios.post('/admin/admin/delete', Object.assign({}, PostBase, {
admin_id: that.selectList.join(",")
}))
.then(function (response) {
that.getList();
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: response.data.message,
type: 'success'
});
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
}).catch(() => {
});
},
changeSelection(list) {
var that = this;
that.selectList = [];
for (var index in list) {
that.selectList.push(list[index].admin_id);
}
},
postEdit() {
var that = this;
that.$refs['formEdit'].validate((valid) => {
if (!valid) {
that.$message.error('仔细检查检查,是不是有个地方写得不对?');
return;
}
axios.post('/admin/admin/update', Object.assign({}, PostBase, that.formEdit))
.then(function (response) {
that.getList();
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: response.data.message,
type: 'success'
});
that.dialogFormEdit = false;
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
});
},
postAdd() {
var that = this;
that.$refs['formAdd'].validate((valid) => {
if (!valid) {
that.$message.error('仔细检查检查,是不是有个地方写得不对?');
return;
}
axios.post('/admin/admin/add', Object.assign({}, PostBase, that.formAdd))
.then(function (response) {
that.getList();
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: response.data.message,
type: 'success'
});
that.dialogFormAdd = false;
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
});
},
clickAdd() {
var that = this;
that.formAdd = {
admin_group: 1
};
axios.post('/admin/group/getList', Object.assign({}, PostBase))
.then(function (response) {
that.groupList = response.data.data;
if (response.data.code == CODE_SUCCESS) {
that.dialogFormAdd = true;
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
},
clickDelete(row) {
var that = this;
this.$confirm('即将删除这个用户, 是否确认?', '删除提醒', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
axios.post('/admin/admin/delete', Object.assign({}, PostBase, {
admin_id: row.admin_id
}))
.then(function (response) {
that.getList();
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: response.data.message,
type: 'success'
});
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
}).catch(() => {
});
},
clickStatus(row) {
var that = this;
axios.post(row.admin_status ? '/admin/admin/enable' : '/admin/admin/disable', Object.assign({}, PostBase, {
admin_id: row.admin_id
}))
.then(function (response) {
that.getList();
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: response.data.message,
type: 'success'
});
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
},
clickEdit(row) {
var that = this;
that.formEdit = row;
axios.post('/admin/group/getList', Object.assign({}, PostBase))
.then(function (response) {
if (response.data.code == CODE_SUCCESS) {
that.groupList = response.data.data;
axios.post('/admin/admin/detail', Object.assign({}, PostBase, {
admin_id: row.admin_id
}))
.then(function (response) {
if (response.data.code == CODE_SUCCESS) {
that.formEdit = response.data.data;
that.dialogFormEdit = true;
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
},
changeCurrentPage(page) {
this.form.page = page;
this.getList();
},
getList() {
var that = this;
that.loading = true;
axios.post('/admin/admin/getList', Object.assign({}, PostBase, that.form, that.search))
.then(function (response) {
that.loading = false;
if (response.data.code == CODE_SUCCESS) {
that.dataList = response.data.data;
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.loading = false;
that.$message.error('服务器内部错误');
console.log(error);
});
},
}
})
</script>
</html>
+263
View File
@@ -0,0 +1,263 @@
<!DOCTYPE html>
<html>
<head>
<title>后台管理系统</title>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="/static/admin/css/element.css">
<link rel="stylesheet" href="/static/admin/css/YAdmin.css">
<style>
.login-container {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: space-around;
min-width: 1280px;
min-height: 800px;
background: url(/static/admin/images/login_bg.jpg) no-repeat;
background-size: 100% 100%;
background-color: #ffffff;
}
.login-container:before{
content: " ";
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: url(/static/admin/images/login_bg_bottom.png) no-repeat;
background-size: 100% 100%;
height: 170px;
}
.login-box img{
width: 720px;
}
.login-border {
display: flex;
justify-content: center;
flex-direction: column;
position: relative;
top: -30px;
right: 100px;
}
.login-main{
background-color: #ffffff;
padding: 35px 45px 15px 45px;
border-radius: 6px;
}
.login-main .vadmin{
font-size: 16px;
font-weight: bold;
color: #6881ec;
line-height: 20px;
padding-bottom: 6px;
}
.login-logo {
margin: 0 0 20px;
}
.login-logo p {
color: #ffffff;
font-size: 25px;
font-weight: bold;
}
.login-submit {
margin-top: 10px;
width: 100%;
}
.login-form {
margin: 10px 0;
}
.login-form .el-form-item__content {
width: 270px;
}
.login-form .el-form-item {
margin-bottom: 26px;
}
.login-form .el-input input {
text-indent: 5px;
border-color: #DCDCDC;
border-radius: 3px;
border: none;
border-bottom: 1px solid #eee;
}
.login-form .el-input .el-input__prefix i {
padding: 0 5px;
font-size: 16px !important;
}
.login-code {
display: flex;
align-items: center;
justify-content: space-around;
margin-left: 10px;
cursor: pointer;
}
.login-code-img {
margin-top: 1px;
width: 100px;
height: 38px;
}
</style>
</head>
<body>
<div id="app" v-cloak>
<div id="app" v-cloak>
<div class="login-container">
<div class="login-box">
<img src="/static/admin/images/login_bg_box.png">
</div>
<div class="login-border">
<div class="login-logo">
<p>后台登录</p>
</div>
<div class="login-main">
<p class="vadmin">管理员登录</p>
<el-form class="login-form" status-icon :rules="loginRules" ref="loginForm" :model="loginForm"
label-width="0" size="default">
<el-form-item prop="admin_account">
<el-input @keyup.enter.native="handleLogin()" v-model="loginForm.admin_account"
auto-complete="off" placeholder="请输入账号">
<i slot="prefix" class="el-icon-user"></i>
</el-input>
</el-form-item>
<el-form-item prop="admin_password">
<el-input @keyup.enter.native="handleLogin()" v-model="loginForm.admin_password" show-password
auto-complete="off" placeholder="请输入密码">
<i slot="prefix" class="el-icon-key"></i>
</el-input>
</el-form-item>
<el-form-item v-if="codeUrl" prop="admin_code">
<el-row :span="34">
<el-col :span="14">
<el-input @keyup.enter.native="handleLogin()" v-model="loginForm.admin_code"
auto-complete="off" placeholder="请输入验证码">
<i slot="prefix" class="el-icon-mobile"></i>
</el-input>
</el-col>
<el-col :span="10">
<div class="login-code">
<img :src="codeUrl" class="login-code-img" @click="getCaptcha" alt="" />
</div>
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loading" @click.native.prevent="handleLogin"
class="login-submit">登 录
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="/static/admin/js/vue-2.6.10.min.js"></script>
<script src="/static/admin/js/axios.min.js"></script>
<script src="/static/admin/js/element.js"></script>
<script src="/static/admin/js/YAdmin.js"></script>
<script>
new Vue({
el: '#app',
data() {
return {
codeUrl: '',
codeToken: '',
loading: false,
loginForm: {
admin_account: '',
admin_password: '',
admin_code: '',
},
loginRules: {
admin_account: [
{ required: true, message: '请输入账号', trigger: 'blur' }
],
admin_password: [
{ required: true, message: '请输入密码', trigger: 'blur' },
{ min: 6, message: '密码长度最少为6位', trigger: 'blur' }
],
admin_code: [
{ required: true, message: '请输入验证码', trigger: 'blur' },
{ min: 4, max: 4, message: '验证码长度为4位', trigger: 'blur' }
]
}
}
},
created() {
this.getCaptcha();
},
methods: {
/**
* @description 正式登录
*/
handleLogin() {
var that = this;
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
this.loginForm.token = this.codeToken
axios.post('/admin/admin/login', Object.assign({}, PostBase, this.loginForm))
.then(function (response) {
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: '登录成功,正在跳转中',
type: 'success'
});
setTimeout(function () {
location.replace('/qfadmin');
}, 1000)
} else {
that.$message.error(response.data.message);
that.loading = false
that.getCaptcha();
}
})
.catch(function (error) {
that.$message.error('登录失败,服务器内部错误');
that.loading = false
});
}
})
},
onSubmit() {
var that = this;
axios.post('/admin/admin/login', Object.assign({}, PostBase, this.form))
.then(function (response) {
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: '登录成功,正在跳转中',
type: 'success'
});
setTimeout(function () {
location.replace('{$callback}');
}, 1000)
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('登录失败,服务器内部错误');
});
},
getCaptcha() {
var that = this;
axios.post('/admin/system/getCaptcha', Object.assign({}, PostBase))
.then(function (res) {
that.codeUrl = res.data.data.img
that.codeToken = res.data.data.token
})
.catch(function (error) {
that.$message.error('获取失败');
});
},
}
})
</script>
</html>
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html>
<head>
<title>{$node.node_title}</title>
{include file="common/header"/}
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span>修改我的密码</span>
</div>
<div class="text item">
<el-form :model="form" status-icon :rules="rules" ref="form" label-width="80px">
<el-form-item label="原密码" prop="oldPassword">
<el-input show-password v-model="form.oldPassword" placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码" prop="newPassword">
<el-input show-password password="password" v-model="form.newPassword" placeholder="请输入新密码">
</el-input>
</el-form-item>
<el-form-item label="新密码" prop="checkPassword">
<el-input show-password v-model="form.checkPassword" placeholder="请确认新密码"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">修改密码</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
{include file="common/footer"/}
<script>
var app = new Vue({
el: '#app',
data() {
return {
form: {
oldPassword: "",
newPassword: "",
checkPassword: "",
},
rules: {
oldPassword: [
{ required: true, message: '原密码必须输入', trigger: 'blur' },
],
newPassword: [
{ required: true, message: '必须输入', trigger: 'blur' },
],
checkPassword: [
{ required: true, message: '必须输入', trigger: 'blur' },
],
}
}
},
methods: {
onSubmit() {
var that = this;
that.$refs['form'].validate((valid) => {
if (!valid) {
that.$message.error('仔细检查检查,是不是有个地方写得不对?');
return;
}
if (that.form.newPassword != that.form.checkPassword) {
that.$message.error('两次密码输入不一致,请确认');
return;
}
axios.post('/admin/admin/motifypassword', Object.assign({}, PostBase, {
oldPassword: that.form.oldPassword,
newPassword: that.form.newPassword,
}))
.then(function (response) {
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: response.data.message,
type: 'success'
});
setTimeout(function () {
location.href = "/qfadmin/admin/login";
}, 2000);
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
});
},
}
});
</script>
</html>
+103
View File
@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html>
<head>
<title>{$node.node_title}</title>
{include file="common/header"/}
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span>修改我的资料</span>
</div>
<div class="text item">
<el-form :model="form" status-icon :rules="rules" ref="form" label-width="80px">
<el-form-item label="昵称" prop="admin_name">
<el-input v-model="form.admin_name" placeholder="请输入你的昵称"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="admin_truename">
<el-input v-model="form.admin_truename" placeholder="请输入你的真实姓名"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="admin_email">
<el-input v-model="form.admin_email" placeholder="请输入你的邮箱"></el-input>
</el-form-item>
<el-form-item label="身份证" prop="admin_idcard">
<el-input v-model="form.admin_idcard" placeholder="请输入你的身份证"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">更新资料</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
{include file="common/footer"/}
<script>
var app = new Vue({
el: '#app',
data() {
this.getData();
return {
form: {
},
rules: {
admin_name: [
{ required: true, message: '昵称必须填写', trigger: 'blur' },
],
admin_email: [
{ pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/, message: '邮箱格式不正确', trigger: 'blur' },
],
admin_idcard: [
{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证格式不正确', trigger: 'blur' },
],
}
}
},
methods: {
getData() {
var that = this;
axios.post('/admin/admin/getmyinfo', Object.assign({}, PostBase))
.then(function (response) {
if (response.data.code == CODE_SUCCESS) {
that.form = response.data.data;
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
},
onSubmit() {
var that = this;
that.$refs['form'].validate((valid) => {
if (!valid) {
that.$message.error('仔细检查检查,是不是有个地方写得不对?');
return;
}
if (that.form.newPassword != that.form.checkPassword) {
that.$message.error('两次密码输入不一致,请确认');
return;
}
axios.post('/admin/admin/updateMyInfo', Object.assign({}, PostBase, that.form))
.then(function (response) {
if (response.data.code == CODE_SUCCESS) {
that.$message({
message: response.data.message,
type: 'success'
});
} else {
that.$message.error(response.data.message);
}
})
.catch(function (error) {
that.$message.error('服务器内部错误');
console.log(error);
});
});
},
}
});
</script>
</html>