gongjinbao
2025-01-09 2f3910e32281777f5d838405660f4579fe73982d
Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/americanContainer
4个文件已修改
10 ■■■■ 已修改文件
src/component/LogOut.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/Login.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/component/LogOut.vue
@@ -32,7 +32,9 @@
    mounted() { },
    methods: {
        submit() {
            localStorage.clear();
            this.$store.commit('SET_USERINFO', {})
            this.$store.commit('SET_USERNAME', '')
            localStorage.clear()
            window.location.replace('/');
        }
    },
src/store/index.js
@@ -10,6 +10,7 @@
  mutations: {
    SET_USERINFO(state, userInfo) {
      state.userInfo = userInfo
      state.userName = userInfo.userName
      localStorage.setItem('userInfo', JSON.stringify(userInfo))
      localStorage.setItem('userName', userInfo.userName)
    },
src/utils/request.js
@@ -1,6 +1,7 @@
import axios from 'axios'
import CryptoJS from 'crypto-js';
import apiConfig from '@/config/baseurl'
import store from '@/store'
import {
  Message
@@ -69,6 +70,9 @@
          type: 'warning',
          duration: 2000
        })
        store.commit('SET_USERINFO', {})
        store.commit('SET_USERNAME', '')
        localStorage.clear()
        window.location.replace('/');
        return Promise.reject(res.data)
      }
src/view/Login.vue
@@ -95,7 +95,6 @@
                type: 2
            }).then((result) => {
                localStorage.setItem('extra', result.data.extra);
                localStorage.setItem('userInfo', JSON.stringify(result.data));
                this.$store.commit('SET_USERINFO', result.data);
                this.$router.push({ path: '/home' });
            }).catch(() => {