zhangzengfei
2021-02-01 9f82f4a5cbc86dbba5c6ced881555b007f314a0c
修复自动登录手动退出后的操作
1个文件已修改
32 ■■■■ 已修改文件
src/pages/desktop/index/components/Tools.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/desktop/index/components/Tools.vue
@@ -73,10 +73,10 @@
<script>
import html2canvas from 'html2canvas';
import { logout,updatePwd } from "@/api/login";
import { logout, updatePwd } from "@/api/login";
export default {
  name: "Tools",
  data () {
  data() {
    var validatePass = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请输入密码'));
@@ -104,9 +104,9 @@
      maxOrderOne: '',
      userInfo: {},
      showPasswdForm: false,
      rules:{
      rules: {
        oldPwd: [
          {required: true, message: '请输入旧密码', trigger: 'blur'}
          { required: true, message: '请输入旧密码', trigger: 'blur' }
        ],
        newPwd: [
          { required: true, validator: validatePass, trigger: 'blur' }
@@ -123,7 +123,7 @@
    };
  },
  created () {
  created() {
    let _that = this;
    this.userInfo = sessionStorage.getItem("userInfo") && JSON.parse(sessionStorage.getItem("userInfo"));
    console.log(this.userInfo)
@@ -162,13 +162,13 @@
            oldPwd: this.passwdForm.oldPwd,
            newPwd: this.passwdForm.checkPwd
          }
          updatePwd(json).then(res=>{
            console.log(res,'修改密码')
          updatePwd(json).then(res => {
            console.log(res, '修改密码')
            this.$notify({
              type:res.success?'success':'error',
              message:res.msg
              type: res.success ? 'success' : 'error',
              message: res.msg
            })
            if(res.success){
            if (res.success) {
              this.showPasswdForm = false
              // this.$nextTick(_=>{
              //   this.toLogout('修改密码成功,请重新登录!')
@@ -198,7 +198,7 @@
      );
    },
    togglePreference () {
    togglePreference() {
      //this.$store.commit("desktop/togglePreference");
      //显示桌面,最小化已打开的应用
      ;
@@ -212,7 +212,7 @@
        });
      })
    },
    dockClick (dock) {
    dockClick(dock) {
      if (dock.type === "1") {
        window.open(dock.url);
@@ -229,11 +229,11 @@
        this.$store.commit("desktop/refreshFrame", dock);
      }
    },
    toolHover (dock) {
    toolHover(dock) {
      //this.$parent.screenShot(dock)
    },
    toLogout () {
    toLogout() {
      let _this = this;
      this.$confirm("提示:确定退出吗?", {
        center: true,
@@ -243,6 +243,8 @@
        logout().then(res => {
          if (res === "退出成功") {
            sessionStorage.removeItem("userInfo");
            // 手动退出, 取消自动登录
            sessionStorage.removeItem("autoLogin");
            _this.userInfo = {};
            location.assign('/view/index');
            this.$notify({
@@ -297,7 +299,7 @@
.tools .tools-middle::before {
  width: 1px;
  height: 20px;
  content: '';
  content: "";
  position: absolute;
  top: 10px;
  left: 0;