| | |
| | | <top-color></top-color> |
| | | </div> |
| | | </el-tooltip> |
| | | <el-tooltip v-if="showDebug" |
| | | :content="logsFlag?$t('navbar.bug'):logsLen+$t('navbar.bugs')" |
| | | effect="dark" |
| | | placement="bottom"> |
| | | <div class="top-bar__item"> |
| | | <top-logs></top-logs> |
| | | </div> |
| | | </el-tooltip> |
| | | <!-- 错误日志--> |
| | | <!-- <el-tooltip v-if="showDebug"--> |
| | | <!-- :content="logsFlag?$t('navbar.bug'):logsLen+$t('navbar.bugs')"--> |
| | | <!-- effect="dark"--> |
| | | <!-- placement="bottom">--> |
| | | <!-- <div class="top-bar__item">--> |
| | | <!-- <top-logs></top-logs>--> |
| | | <!-- </div>--> |
| | | <!-- </el-tooltip>--> |
| | | <el-tooltip v-if="showLock" |
| | | :content="$t('navbar.lock')" |
| | | effect="dark" |
| | |
| | | <top-theme></top-theme> |
| | | </div> |
| | | </el-tooltip> |
| | | <el-tooltip :content="$t('navbar.notice')" |
| | | effect="dark" |
| | | placement="bottom"> |
| | | <div class="top-bar__item top-bar__item--show"> |
| | | <top-notice></top-notice> |
| | | </div> |
| | | </el-tooltip> |
| | | <!-- 消息通知--> |
| | | <!-- <el-tooltip :content="$t('navbar.notice')"--> |
| | | <!-- effect="dark"--> |
| | | <!-- placement="bottom">--> |
| | | <!-- <div class="top-bar__item top-bar__item--show">--> |
| | | <!-- <top-notice></top-notice>--> |
| | | <!-- </div>--> |
| | | <!-- </el-tooltip>--> |
| | | <el-tooltip :content="$t('navbar.language')" |
| | | effect="dark" |
| | | placement="bottom"> |
| | |
| | | :visible.sync="passwordVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | style="margin-top: -15vh" |
| | | title="修改密码" |
| | | width="50%"> |
| | | width="50%" |
| | | @close="passwordClose"> |
| | | <avue-form ref="form" v-model="passwordForm" :option="passwordOption" @submit="submitSwitch"/> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | import topColor from "./top-color"; |
| | | import topNotice from './top-notice' |
| | | import topLang from "./top-lang"; |
| | | import {changePassword} from "@/api/user" |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | passwordVisible: false, |
| | | passwordForm: {}, |
| | | passwordOption: { |
| | | submitText:'保存', |
| | | submitText: '保存', |
| | | column: [ |
| | | { |
| | | label: '登陆密码', |
| | | prop: 'input', |
| | | prop: 'oldPassword', |
| | | span: 24, |
| | | labelWidth:"15%", |
| | | labelWidth: "15%", |
| | | type: 'password', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | { |
| | | label: '新登陆密码', |
| | | prop: 'input1', |
| | | prop: 'password', |
| | | span: 24, |
| | | labelWidth:"15%", |
| | | labelWidth: "15%", |
| | | type: 'password', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | { |
| | | label: '新密码登陆确认', |
| | | prop: 'input2', |
| | | prop: 'confirmPassword', |
| | | span: 24, |
| | | labelWidth:"15%", |
| | | labelWidth: "15%", |
| | | type: 'password', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | methods: { |
| | | // 修改密码 |
| | | changePasswordHandler() { |
| | | console.log('123'); |
| | | this.passwordVisible = true; |
| | | }, |
| | | handleScreen() { |
| | |
| | | this.userBox = true; |
| | | }, |
| | | submitSwitch(form, done) { |
| | | this.$store.dispatch("refreshToken", form).then(() => { |
| | | this.userBox = false; |
| | | this.$router.push({path: "/"}); |
| | | let userInfo = JSON.parse(localStorage.getItem('saber-userInfo')); |
| | | let params = { |
| | | userName: userInfo.content.userId, |
| | | oldPassword: func.encryptData(form.oldPassword, 'daliantan0v0vcip'), |
| | | password: func.encryptData(form.password, 'daliantan0v0vcip'), |
| | | confirmPassword: func.encryptData(form.confirmPassword, 'daliantan0v0vcip'), |
| | | |
| | | } |
| | | changePassword(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.passwordVisible = false; |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | resetRouter(); |
| | | this.$router.push({path: "/login"}); |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | done(); |
| | | }, |
| | | |
| | | // 关闭修改密码对话框 |
| | | passwordClose() { |
| | | this.$refs.form.resetFields(); |
| | | }, |
| | | |
| | | logout() { |
| | | this.$confirm(this.$t("logoutTip"), this.$t("tip"), { |
| | | confirmButtonText: this.$t("submitText"), |