|
|
@@ -0,0 +1,108 @@
|
|
|
+<template>
|
|
|
+ <div class="modify-wrapper">
|
|
|
+ <el-container>
|
|
|
+ <el-header class="modify-header">{{ $t('login.adminModifyPasswd') }}</el-header> <!-- 管理员密码修改 -->
|
|
|
+ <el-main>
|
|
|
+ <div class="white-box">
|
|
|
+ <el-form ref="form" :model="passwordInfo" label-width="250px" class="">
|
|
|
+ <el-form-item :label="$t('login.adminCode')"> <!-- 用户编号 -->
|
|
|
+ <el-input v-model="passwordInfo.adminName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('login.originLoginPassword')"> <!-- 原登录密码 -->
|
|
|
+ <el-input v-model="passwordInfo.oldPassword" show-password></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('login.newLoginPassword')"> <!-- 新登录密码 -->
|
|
|
+ <el-input v-model="passwordInfo.password" show-password></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('login.confirmLoginPassword')"> <!-- 确认新密码 -->
|
|
|
+ <el-input v-model="passwordInfo.surePassword" show-password></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="handleModifyPasswordSubmit" :loading="modifyPasswordButtonStat">{{ $t("common.confirm") }}</el-button> <!-- 确认修改 -->
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+ <script>
|
|
|
+// import axiosObj from '../../utils/axiosPlugin'
|
|
|
+ import tool from '@/utils/tool'
|
|
|
+ import { noLoginModifyPassword } from '@/api/user'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'modify-password',
|
|
|
+ mounted () {
|
|
|
+ this.passwordInfo.adminName = this.$route.params.adminName
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ passwordInfo: {
|
|
|
+ adminName: '',
|
|
|
+ oldPassword: '',
|
|
|
+ password: '',
|
|
|
+ surePassword: ''
|
|
|
+ },
|
|
|
+ modifyPasswordButtonStat: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleModifyPasswordSubmit () {
|
|
|
+ this.modifyPasswordButtonStat = true
|
|
|
+ let objectThis = this
|
|
|
+ noLoginModifyPassword(this.passwordInfo).then(response => {
|
|
|
+ this.modifyPasswordButtonStat = false
|
|
|
+ this.$message.success(response.data)
|
|
|
+ objectThis.$router.push('/login')
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error(err)
|
|
|
+ this.modifyPasswordButtonStat = false
|
|
|
+ })
|
|
|
+ // axiosObj.post(path, this.passwordInfo).then(response => {
|
|
|
+ // this.$message.success(response)
|
|
|
+ // this.modifyPasswordButtonStat = false
|
|
|
+ // this.$router.push('/login')
|
|
|
+ // }).catch(error => {
|
|
|
+ // this.modifyPasswordButtonStat = false
|
|
|
+ // error = tool.errorHandle(error)
|
|
|
+ // this.$message.error(error.message)
|
|
|
+ // console.log(error)
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <style scoped>
|
|
|
+ .modify-wrapper .white-box {
|
|
|
+ background: #fff;
|
|
|
+ padding: 25px;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ border-radius: 0;box-shadow: 0 0 10px #f2f1f4;
|
|
|
+ }
|
|
|
+
|
|
|
+ .modify-wrapper .modify-header{
|
|
|
+ text-align: center;
|
|
|
+ line-height: 60px;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ @media (max-width: 760px) {
|
|
|
+ /deep/ .white-box {
|
|
|
+ margin-top: 85px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-form-item__label {
|
|
|
+ text-align:left;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-form-item__content {
|
|
|
+ margin-left:0px !important;
|
|
|
+ width:100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|