luyanan преди 6 години
родител
ревизия
a3a7ae4b2b

+ 0 - 1
config/dev.env.js

@ -5,7 +5,6 @@ const prodEnv = require('./prod.env')
5 5
module.exports = merge(prodEnv, {
6 6
  NODE_ENV: '"development"',
7 7
  ENV_CONFIG:'"dev"',
8
  PLAT_ID: '"9619237FAF5E4B908F0F88A5845C8C9F"',
9 8
  BASE_API: '""',
10 9
  KX_API: '"http://192.168.3.233:81"'
11 10
})

+ 0 - 1
config/prod.env.js

@ -2,7 +2,6 @@
2 2
module.exports = {
3 3
  NODE_ENV: '"production"',
4 4
  ENV_CONFIG:'"prod"',
5
  PLAT_ID: '"F5DEA8EDB12E421A9FC4B701BB6176A6"',
6 5
  BASE_API: '"http://xttjpt.cn"',
7 6
  KX_API: '"https://www.ekexiu.com"'
8 7
}

+ 0 - 1
config/test.env.js

@ -2,7 +2,6 @@
2 2
module.exports = {
3 3
  NODE_ENV: '"testing"',
4 4
  ENV_CONFIG:'"test"',
5
  PLAT_ID: '"9619237FAF5E4B908F0F88A5845C8C9F"',
6 5
  BASE_API: '"http://192.168.3.233:2080"',
7 6
  KX_API: '"http://192.168.3.233"'
8 7
}

+ 10 - 1
src/components/ShareOut/index.vue

@ -28,6 +28,11 @@
28 28
        default: 'bottom-start'
29 29
      }
30 30
    },
31
    data() {
32
      return {
33
        qrcode: ''
34
      }
35
    },
31 36
    mounted() {
32 37
      this.$nextTick(function() {
33 38
        this._makeCode();
@ -35,13 +40,17 @@
35 40
    },
36 41
    methods: {
37 42
      _makeCode() {
38
        let qrcode = new QRCode('qrcode', {
43
        let qrcode = this.qrcode
44
        qrcode = new QRCode('qrcode', {
39 45
          width: 120,
40 46
          height: 120
41 47
        });
42 48
        qrcode.clear();
43 49
        qrcode.makeCode(this.tUrl);
44 50
      }
51
    },
52
    beforeDestroy() {
53
      this.qrcode.clear()
45 54
    }
46 55
  };
47 56
</script>

+ 0 - 1
src/pages/expert/show.vue

@ -374,7 +374,6 @@
374 374
            if ($info.length === 0 && liLen === 0) {
375 375
              this.ifDefault2 = true;
376 376
            };
377
            
378 377
          };
379 378
        });
380 379
      },

+ 1 - 0
src/pages/index/router/index.js

@ -23,6 +23,7 @@ const constantRouterMap = [
23 23
  {
24 24
    path: '/',
25 25
    component: Layout,
26
    redirect: '/home',
26 27
    children: [{
27 28
      path: '/home',
28 29
      name: 'home',

+ 5 - 0
src/pages/index/views/Dashboard/index.vue

@ -429,6 +429,11 @@
429 429
      expItem
430 430
      // demandIssue,
431 431
      // demandIssueLogin
432
    },
433
    beforeDestroy() {
434
      this.latestCmpSwiper.destroy()
435
      this.findServiceSwiper.destroy()
436
      this.findResourceSwiper.destroy()
432 437
    }
433 438
  };
434 439
</script>

+ 7 - 7
src/store/getters.js

@ -1,7 +1,7 @@
1
const getters = {
2
  pinfo: state => state.plat.pinfo,
3
  account: state => state.user.account,
4
  bindCompany: state => state.user.bindCompany,
5
  headPhoto: state => state.user.headPhoto
6
 };
7
export default getters;
1
export default() => {
2
  return {
3
    account: state => state.user.account,
4
    bindCompany: state => state.user.bindCompany,
5
    headPhoto: state => state.user.headPhoto
6
   }
7
}

+ 8 - 10
src/store/index.js

@ -1,17 +1,15 @@
1 1
import Vue from 'vue';
2 2
import Vuex from 'vuex';
3
import plat from './modules/plat';
4 3
import user from './modules/user';
5 4
import getters from './getters';
6 5
7 6
Vue.use(Vuex);
8 7
9
const store = new Vuex.Store({
10
  modules: {
11
    plat,
12
    user
13
  },
14
  getters
15
});
16
17
export default store;
8
export default () => {
9
  return new Vuex.Store({
10
    modules: {
11
      user
12
    },
13
    getters
14
  });
15
}

+ 0 - 23
src/store/modules/plat.js

@ -1,23 +0,0 @@
1
import Vue from 'vue';
2
3
const plat = {
4
  state: {
5
    pinfo: ''
6
  },
7
  mutations: {
8
    SET_PINFO: (state, pinfo) => {
9
      state.pinfo = pinfo
10
    }
11
  },
12
  actions: {
13
    // 获取plat配置信息
14
    getPlatInfo({ commit }) {
15
        Vue.$axios.get('../../../static/plat-info.js', { }).then((res) => {
16
          console.log(res)
17
          commit('SET_PINFO', res);
18
        })
19
    }
20
  }
21
};
22
23
export default plat;

+ 63 - 64
src/store/modules/user.js

@ -1,62 +1,79 @@
1 1
import http from '@/libs/axios'
2 2
import Cookies from 'js-cookie'
3 3
import { defaultSet } from '@/libs/util';
4
5
const user = {
6
  state: {
7
    account: '',
8
    userid: '',
9
    bindCompany: '',
10
    headPhoto: ''
11
  },
12
  mutations: {
13
    SET_ACCOUNT: (state, account) => {
14
      state.account = account
15
    },
16
    SET_USERID: (state, userid) => {
17
      state.userid = userid
4
export default() => {
5
  return {
6
    state: {
7
      account: '',
8
      userid: '',
9
      bindCompany: '',
10
      headPhoto: ''
18 11
    },
19
    SET_BINDCOMPANY: (state, bindCompany) => {
20
      state.bindCompany = bindCompany
12
    mutations: {
13
      SET_ACCOUNT: (state, account) => {
14
        state.account = account
15
      },
16
      SET_USERID: (state, userid) => {
17
        state.userid = userid
18
      },
19
      SET_BINDCOMPANY: (state, bindCompany) => {
20
        state.bindCompany = bindCompany
21
      },
22
      SET_HEADPHOTO: (state, headPhoto) => {
23
        state.headPhoto = headPhoto || defaultSet.img.expert;
24
      }
21 25
    },
22
    SET_HEADPHOTO: (state, headPhoto) => {
23
      state.headPhoto = headPhoto || defaultSet.img.expert;
24
    }
25
  },
26 26
27
  actions: {
28
    // 获取用户信息
29
    GetUserInfo({ commit, state }) {
30
      return new Promise((resolve, reject) => {
31
        http.get('/ajax/sys/user').then(response => {
32
          if (response.data) {
33
            const dataS = response.data
34
            commit('SET_USERID', dataS.id);
35
            commit('SET_ACCOUNT', dataS.account);
36
            commit('SET_HEADPHOTO', dataS.head);
37
            commit('SET_BINDCOMPANY', dataS.bindCompany);
38
            Cookies.set('userid', dataS.id);
39
            Cookies.set('uaccount', dataS.account);
40
            Cookies.set('bcid', dataS.bindCompany);
41
          } else {
27
    actions: {
28
      // 获取用户信息
29
      GetUserInfo({ commit, state }) {
30
        return new Promise((resolve, reject) => {
31
          http.get('/ajax/sys/user').then(response => {
32
            if (response.data) {
33
              const dataS = response.data
34
              commit('SET_USERID', dataS.id);
35
              commit('SET_ACCOUNT', dataS.account);
36
              commit('SET_HEADPHOTO', dataS.head);
37
              commit('SET_BINDCOMPANY', dataS.bindCompany);
38
              Cookies.set('userid', dataS.id);
39
              Cookies.set('uaccount', dataS.account);
40
              Cookies.set('bcid', dataS.bindCompany);
41
            } else {
42
              commit('SET_USERID', '')
43
              commit('SET_ACCOUNT', '')
44
              commit('SET_HEADPHOTO', '');
45
              Cookies.remove('userid')
46
              Cookies.remove('uaccount');
47
              Cookies.remove('bcid')
48
            }
49
            resolve(response)
50
          }).catch(error => {
51
            reject(error)
52
          })
53
        })
54
      },
55
56
      // 登出
57
      LogOut({ commit, state }) {
58
        return new Promise((resolve, reject) => {
59
          http.get('/ajax/sys/logout').then(() => {
42 60
            commit('SET_USERID', '')
43 61
            commit('SET_ACCOUNT', '')
62
            commit('SET_BINDCOMPANY', '')
44 63
            commit('SET_HEADPHOTO', '');
45 64
            Cookies.remove('userid')
46 65
            Cookies.remove('uaccount');
47 66
            Cookies.remove('bcid')
48
          }
49
          resolve(response)
50
        }).catch(error => {
51
          reject(error)
67
            resolve()
68
          }).catch(error => {
69
            reject(error)
70
          })
52 71
        })
53
      })
54
    },
72
      },
55 73
56
    // 登出
57
    LogOut({ commit, state }) {
58
      return new Promise((resolve, reject) => {
59
        http.get('/ajax/sys/logout').then(() => {
74
      // 前端 登出
75
      FedLogOut({ commit }) {
76
        return new Promise(resolve => {
60 77
          commit('SET_USERID', '')
61 78
          commit('SET_ACCOUNT', '')
62 79
          commit('SET_BINDCOMPANY', '')
@ -65,26 +82,8 @@ const user = {
65 82
          Cookies.remove('uaccount');
66 83
          Cookies.remove('bcid')
67 84
          resolve()
68
        }).catch(error => {
69
          reject(error)
70 85
        })
71
      })
72
    },
73
74
    // 前端 登出
75
    FedLogOut({ commit }) {
76
      return new Promise(resolve => {
77
        commit('SET_USERID', '')
78
        commit('SET_ACCOUNT', '')
79
        commit('SET_BINDCOMPANY', '')
80
        commit('SET_HEADPHOTO', '');
81
        Cookies.remove('userid')
82
        Cookies.remove('uaccount');
83
        Cookies.remove('bcid')
84
        resolve()
85
      })
86
      }
86 87
    }
87 88
  }
88 89
}
89
90
export default user