zhangyanpeng
2020-05-07 dca74c76b85c5ece7b87beae9d9f921883b55564
调整cookies
11个文件已修改
74 ■■■■■ 已修改文件
src/components/finance/actualPayment.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/finance/collectionStatistics.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/popup/newProject.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/popup/prodetail.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/square.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.ts 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Home.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Mine.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/calendarTask.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/list.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/finance/actualPayment.vue
@@ -125,8 +125,11 @@
        },
        mounted() { //组件配置后,页面显示前。用于加载数据
            this.getData();
            this.userId = localStorage.getItem('userId');
            this.assign = localStorage.getItem('assign');
            //this.userId = localStorage.getItem('userId');
            //this.assign = localStorage.getItem('assign');
            this.userId = this.$cookies.get('userId');
            this.assign = this.$cookies.get('assign');
        },
        methods: {
            Cancel2() {
src/components/finance/collectionStatistics.vue
@@ -128,8 +128,11 @@
        },
        mounted() { //组件配置后,页面显示前。用于加载数据
            this.getData();
            this.userId = localStorage.getItem('userId');
            this.assign = localStorage.getItem('assign');
            //this.userId = localStorage.getItem('userId');
            //this.assign = localStorage.getItem('assign');
            this.userId = this.$cookies.get('userId');
            this.assign = this.$cookies.get('assign');
        },
        methods: {
            Cancel2() {
src/components/popup/newProject.vue
@@ -216,8 +216,11 @@
        this.ruleForm = this.rowData;
    }
    
    this.userId = localStorage.getItem('userId');
    this.assign = localStorage.getItem('assign');
    //this.userId = localStorage.getItem('userId');
    //this.assign = localStorage.getItem('assign');
    this.userId = this.$cookies.get('userId');
    this.assign = this.$cookies.get('assign');
},
  methods:{
        getUsers() {
src/components/popup/prodetail.vue
@@ -29,8 +29,11 @@
        }
  },
mounted() {
    this.userId = localStorage.getItem('userId');
    this.assign = localStorage.getItem('assign');
    //this.userId = localStorage.getItem('userId');
    //this.assign = localStorage.getItem('assign');
    this.userId = this.$cookies.get('userId');
    this.assign = this.$cookies.get('assign');
    //this.loadData();
},
  methods:{
src/components/square.vue
@@ -670,9 +670,10 @@
            
            createTopic() {
                let me = this;
                var userId = localStorage.getItem('userId');
                //var userId = localStorage.getItem('userId');
                let userId = this.$cookies.get('userId');
                if(!userId) {
                    this.$router.push('/login');
                    this.$router.push('/login').catch(err => {err});
                }
                this.form.userId = userId;
                let params = this.form;
src/main.ts
@@ -47,11 +47,18 @@
Axios.interceptors.request.use(function (config) {
  let userId_ = localStorage.getItem('userId');
 // let userId_ = localStorage.getItem('userId');
 if(config.url == "/api/user/login") {
 }
 else {
    //let userId_ = Vue.VueCookies.get('userId');//localStorage.getItem('userId');
    let userId_ = Vue.$cookies.get('userId');//localStorage.getItem('userId');
  if (!userId_ && config.url != "/api/user/login") {
      router.replace('/login');
    }
        router.replace('/login');
    }
  config.headers.common['userId'] = userId_;
 }
  return config;
}, function (error) {
 // console.info("error: ");
src/views/Home.vue
@@ -129,11 +129,11 @@
        //this.userName = localStorage.getItem('userName');
        //let departId = localStorage.getItem('departId');
        if (!userId_ || !departId) {
            this.$router.push('/login');
            this.$router.push('/login').catch(err => {err});
        }
        else {
            this.defaultActive = "mine";
            this.$router.push('/mine');
            this.$router.push('/mine').catch(err => {err});
            let type;
            if(departId == "100" || departId == "500") {
                type = departId;
@@ -244,7 +244,7 @@
                        me.$message.error("保存失败!" + data_.data.message);
                    }
                    else {
                        me.$router.push('/login');
                        me.$router.push('/login').catch(err => {err});
                    }
                    //me.$cookies.set('userId', null);
                }).catch(error =>{
@@ -254,14 +254,14 @@
        },
        
        Cancel() {
            this.$router.push('/login');
            //localStorage.setItem('userId', undefined);
            //localStorage.setItem('userId', null);
            this.$cookies.set('userId', null);
            this.$router.push('/login').catch(err => {err});
        },
        menuSelect(index, a){
         let isPage = index.substring(0,2);
         if (isPage != "0_") {
            this.$router.push('/'+ index);
            this.$router.push('/'+ index).catch(err => {err});
         }
        },
        
src/views/Mine.vue
@@ -207,7 +207,7 @@
        },
        
        see_click() {
            this.$router.push('/list');
            this.$router.push('/list').catch(err => {err});
        },
        
        setActiveTableData(currentRow, oldCurrentRow) {
src/views/calendarTask.vue
@@ -102,7 +102,8 @@
                    let iformat = imoment.format('YYYY-MM');
                    let systemDate = iformat + '-01 00:00:00';
                    this.getDatedef(systemDate);
                    this.userId = localStorage.getItem('userId');
                    //this.userId = localStorage.getItem('userId');
                    this.userId = this.$cookies.get('userId');
                },
                
        methods: {
src/views/list.vue
@@ -190,8 +190,11 @@
        },
        mounted() { //组件配置后,页面显示前。用于加载数据
            this.getData();
            this.userId = localStorage.getItem('userId');
            this.assign = localStorage.getItem('assign');
            //this.userId = localStorage.getItem('userId');
            //this.assign = localStorage.getItem('assign');
            this.userId = this.$cookies.get('userId');
            this.assign = this.$cookies.get('assign');
        },
        methods: {
            download() {
src/views/login.vue
@@ -116,6 +116,8 @@
                   localStorage.setItem('departName',data_.data.data.departName); */
                     
                     this.$cookies.set('userId',data_.data.data.id);
                     //localStorage.setItem('userId',data_.data.data.id);
                     this.$cookies.set('userName',data_.data.data.name);
                     this.$cookies.set('roleId',data_.data.data.roleCode);
                     this.$cookies.set('roleName',data_.data.data.roleName);
@@ -123,7 +125,7 @@
                     this.$cookies.set('departName',data_.data.data.departName);
                     this.$cookies.set('password', data_.data.data.password);
                     
                       this.$router.push('/');
                       this.$router.push('/').catch(err => {err});
               }else {
                    this.$message({message:'登陆失败', type: 'warning'});
               }