luyanan 6 年之前
父節點
當前提交
a3a7ae4b2b

+ 0 - 1
config/dev.env.js

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

+ 0 - 1
config/prod.env.js

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

+ 0 - 1
config/test.env.js

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

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

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

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

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

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

23
  {
23
  {
24
    path: '/',
24
    path: '/',
25
    component: Layout,
25
    component: Layout,
26
    redirect: '/home',
26
    children: [{
27
    children: [{
27
      path: '/home',
28
      path: '/home',
28
      name: 'home',
29
      name: 'home',

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

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

+ 7 - 7
src/store/getters.js

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
import Vue from 'vue';
1
import Vue from 'vue';
2
import Vuex from 'vuex';
2
import Vuex from 'vuex';
3
import plat from './modules/plat';
4
import user from './modules/user';
3
import user from './modules/user';
5
import getters from './getters';
4
import getters from './getters';
6
5
7
Vue.use(Vuex);
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
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
import http from '@/libs/axios'
1
import http from '@/libs/axios'
2
import Cookies from 'js-cookie'
2
import Cookies from 'js-cookie'
3
import { defaultSet } from '@/libs/util';
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
            commit('SET_USERID', '')
60
            commit('SET_USERID', '')
43
            commit('SET_ACCOUNT', '')
61
            commit('SET_ACCOUNT', '')
62
            commit('SET_BINDCOMPANY', '')
44
            commit('SET_HEADPHOTO', '');
63
            commit('SET_HEADPHOTO', '');
45
            Cookies.remove('userid')
64
            Cookies.remove('userid')
46
            Cookies.remove('uaccount');
65
            Cookies.remove('uaccount');
47
            Cookies.remove('bcid')
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
          commit('SET_USERID', '')
77
          commit('SET_USERID', '')
61
          commit('SET_ACCOUNT', '')
78
          commit('SET_ACCOUNT', '')
62
          commit('SET_BINDCOMPANY', '')
79
          commit('SET_BINDCOMPANY', '')
65
          Cookies.remove('uaccount');
82
          Cookies.remove('uaccount');
66
          Cookies.remove('bcid')
83
          Cookies.remove('bcid')
67
          resolve()
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