田源
2024-08-15 8d788cfa6a5e4126843106baddbe103a586ce600
Source/plt-web/plt-web-ui/src/page/index/top/index.vue
@@ -27,14 +27,15 @@
          <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"
@@ -51,13 +52,14 @@
          <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&#45;&#45;show">-->
<!--          <top-notice></top-notice>-->
<!--        </div>-->
<!--      </el-tooltip>-->
      <el-tooltip :content="$t('navbar.language')"
                  effect="dark"
                  placement="bottom">
@@ -129,6 +131,8 @@
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: {
@@ -151,9 +155,10 @@
        column: [
          {
            label: '登陆密码',
            prop: 'input',
            prop: 'oldPassword',
            span: 24,
            labelWidth:"15%",
            type:'password',
            rules: [
              {
                required: true,
@@ -164,9 +169,10 @@
          },
          {
            label: '新登陆密码',
            prop: 'input1',
            prop: 'password',
            span: 24,
            labelWidth:"15%",
            type:'password',
            rules: [
              {
                required: true,
@@ -177,9 +183,10 @@
          },
          {
            label: '新密码登陆确认',
            prop: 'input2',
            prop: 'confirmPassword',
            span: 24,
            labelWidth:"15%",
            type:'password',
            rules: [
              {
                required: true,
@@ -270,7 +277,6 @@
  methods: {
    // 修改密码
    changePasswordHandler() {
      console.log('123');
      this.passwordVisible = true;
    },
    handleScreen() {
@@ -293,10 +299,27 @@
      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 = {
        userOid:userInfo.content.userOid,
        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;
        }
      }).catch(err => {
        console.log(err);
      })
      // this.$store.dispatch("refreshToken", form).then(() => {
      //   this.userBox = false;
      //   this.$router.push({path: "/"});
      // })
      done();
    },
    logout() {
@@ -306,6 +329,7 @@
        type: "warning"
      }).then(() => {
        this.$store.dispatch("LogOut").then(() => {
          console.log('123');
          resetRouter();
          this.$router.push({path: "/login"});
        });