Browse Source

Merge branch 'master' of http://git.cc-lotus.info/smart-jobs/web-portal

guhongwei 5 years ago
parent
commit
cc950bac8c
3 changed files with 21 additions and 3 deletions
  1. 4 2
      src/plugins/var.js
  2. 7 0
      src/store.js
  3. 10 1
      src/views/index/index.vue

+ 4 - 2
src/plugins/var.js

@@ -2,12 +2,14 @@ import Vue from 'vue';
 import _ from 'lodash';
 
 const getSiteId = () => {
-  let host = `${window.location.hostname}`; //`999991.smart.jilinjobswx.cn`
+  let host = `${window.location.hostname}`; //`999991.smart.jilinjobswx.cn ${window.location.hostname}`
   let schId;
+  host = host.replace('http://', '');
   let arr = host.split('.');
   if (arr.length > 0) {
     schId = arr[0];
-    `${schId}`.includes('localhost') || `${schId}`.includes('127.0.0.1') ? (schId = '99991') : '';
+    if (schId === 'smart') schId = 'master';
+    else `${schId}`.includes('localhost') || `${schId}`.includes('127.0.0.1') ? (schId = '99991') : '';
     sessionStorage.setItem('schId', `${schId}`.includes('localhost') || `${schId}`.includes('127.0.0.1') ? '99991' : schId);
   }
   return schId;

+ 7 - 0
src/store.js

@@ -60,6 +60,8 @@ const api = {
   stucorplist: '/api/stud/studentcorp',
   stucorpdelete: '/api/stud/studentcorp/{id}',
   //测试前缀${process.env.NODE_ENV === 'development' ? '/adminapi' : '${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}'}
+  //审核过的企业(主站用)
+  getCorps: `/api/corp/corps/`,
 };
 
 export default new Vuex.Store({
@@ -388,6 +390,11 @@ export default new Vuex.Store({
       }
       return result;
     },
+    //查询入驻的企业
+    async corpListOperation({ state }) {
+      let result = await this.$axios.$get(api.getCorps, {}, { status: '已认证', skip: 0, limit: 8 });
+      return result;
+    },
   },
 });
 

+ 10 - 1
src/views/index/index.vue

@@ -43,6 +43,7 @@
         :contactinfo="master.contactinfo"
         :content="site.content"
         :companytop="master.companytop"
+        :companylist="corpList"
         :unittop="master.unittop"
         :unitlist="coopList"
         :footinfo="site"
@@ -99,6 +100,7 @@ export default {
     linkList: [],
     //master数据
     master: { ...masterInfo },
+    corpList: [],
   }),
   async created() {
     await this.checkUser();
@@ -122,6 +124,7 @@ export default {
       'columnOperation',
       'linkOperation',
       'menuOperation',
+      'corpListOperation',
     ]),
     //检查用户身份
     checkUser() {
@@ -319,8 +322,14 @@ export default {
       }
     },
     //主站信息组合
-    masterData() {
+    async masterData() {
       this.$set(this.master, `bannerinfo`, { banner: this.site.banner });
+      //获取入驻企业
+      let result = await this.corpListOperation();
+      console.log(result);
+      if (`${result.errcode}` === '0') {
+        this.$set(this, `corpList`, result.data);
+      }
     },
   },
 };