瀏覽代碼

平台信息配置

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

+ 17 - 17
build/webpack.dev.conf.js

@ -10,17 +10,17 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
10 10
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11 11
const portfinder = require('portfinder')
12 12
13
// 通过express导入路由
14
const express = require('express')
15
const app = express()
13
// // 通过express导入路由
14
// const express = require('express')
15
// const app = express()
16 16
17
//模拟服务器返回数据--开始
18
var appData = require('../plat-info.json')
19
var plat = appData.plat
20
// 编写路由
21
var apiRoutes = express.Router()
17
// //模拟服务器返回数据--开始
18
// var appData = require('../static/plat-info.json')
19
// var plat = appData.plat
20
// // 编写路由
21
// var apiRoutes = express.Router()
22 22
23
app.use('/api', apiRoutes)
23
// app.use('/api', apiRoutes)
24 24
25 25
const HOST = process.env.HOST
26 26
const PORT = process.env.PORT && Number(process.env.PORT)
@ -54,15 +54,15 @@ const devWebpackConfig = merge(baseWebpackConfig, {
54 54
    quiet: true, // necessary for FriendlyErrorsPlugin
55 55
    watchOptions: {
56 56
      poll: config.dev.poll,
57
    },
58
    before(app) {
59
      app.get('/api/plat', function (req, res) {
60
        res.json({
61
          errno: 0,
62
          data: plat
63
        });
64
      });
65 57
    }
58
    // before(app) {
59
    //   app.get('/api/plat', function (req, res) {
60
    //     res.json({
61
    //       errno: 0,
62
    //       data: plat
63
    //     });
64
    //   });
65
    // }
66 66
  },
67 67
  plugins: [
68 68
    new webpack.DefinePlugin({

+ 0 - 22
plat-info.json

@ -1,22 +0,0 @@
1
{
2
  "plat": {
3
  	"id":"9619237FAF5E4B908F0F88A5845C8C9F",
4
    "source":"xttjpt",
5
    "name": "邢台经济开发区",
6
    "website": "http://www.xtkfq.gov.cn",
7
    "address": "中国河北省邢台市中兴东大街1888号",
8
    "tel": "86-319-3636000",
9
    "fax": "86-319-3636111 ",
10
    "zipcode": "054001",
11
    "mailbox": "xtkfqbgs@sohu.com",
12
    "logourl": "/static/xtkfq/icon-logo.png",
13
    "bannerurl": "/static/xtkfq/banner.jpg",
14
    "platimgurl": "/static/xtkfq/platimg.jpg",
15
    "adinfo":[
16
      {
17
        "adUrl": "http://www.ecorr.org",
18
        "imgUrl": "/static/xtkfq/ad/fengying.jpg"
19
      }
20
    ]
21
  }
22
}

+ 8 - 15
src/components/Main.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <div class="main Site">
3
    <TheHeader :plat="plat"></TheHeader>
3
    <TheHeader></TheHeader>
4 4
    <div class="Site-content">
5 5
      <div class="contain-wrapper">
6 6
        <transition name="router-fade" mode="out-in">
@ -8,7 +8,7 @@
8 8
        </transition>
9 9
      </div>
10 10
    </div>
11
    <TheFooter :plat="plat"></TheFooter>
11
    <TheFooter></TheFooter>
12 12
  </div>
13 13
</template>
14 14
@ -16,25 +16,18 @@
16 16
  import TheHeader from './main-views/TheHeader.vue';
17 17
  import TheFooter from './main-views/TheFooter.vue';
18 18
  import Cookies from 'js-cookie';
19
  import httpUrl from '@/libs/http';
20
21
  const ERR_OK = 0;
19
  import PLAT from '../../static/plat-info';
22 20
23 21
  export default {
24 22
    data() {
25 23
      return {
26
        plat: {}
24
        plat: ''
27 25
      };
28 26
    },
29
    created() {
30
      this.$axios.get(httpUrl.webbase).then(res => {
31
        console.log(res);
32
        if (res.errno === ERR_OK) {
33
          this.plat = res.data;
34
          Cookies.set('platId', res.data.id);
35
          Cookies.set('platSource', res.data.source);
36
        };
37
      });
27
    mounted() {
28
      this.plat = PLAT.info;
29
      Cookies.set('platId', this.plat.id);
30
      Cookies.set('platSource', this.plat.source);
38 31
    },
39 32
    components: {
40 33
      TheHeader,

+ 5 - 12
src/components/bench-views/WorkCommon.vue

@ -4,7 +4,7 @@
4 4
    <div class="Site-content paddingTop">
5 5
      <div class="contain-wrapper">
6 6
        <transition name="router-fade" mode="out-in">
7
          <router-view :plat="plat"></router-view>
7
          <router-view></router-view>
8 8
        </transition>
9 9
      </div>
10 10
    </div>
@ -15,23 +15,16 @@
15 15
<script type="text/ecmascript-6">
16 16
  import TheHeader from './WorkHead.vue';
17 17
  import TheFooter from '../main-views/TheFooter.vue';
18
  import httpUrl from '@/libs/http';
19

20
  const ERR_OK = 0;
18
  import PLAT from '../../../static/plat-info';
21 19

22 20
  export default {
23 21
    data() {
24 22
      return {
25
        plat: {}
23
        plat: ''
26 24
      };
27 25
    },
28
    created() {
29
      this.$axios.get(httpUrl.webbase).then(res => {
30
        console.log(res);
31
        if (res.errno === ERR_OK) {
32
          this.plat = res.data;
33
        };
34
      });
26
    mounted() {
27
      this.plat = PLAT.info;
35 28
    },
36 29
    components: {
37 30
      TheHeader,

+ 1 - 1
src/components/form-views/findPwd.vue

@ -131,7 +131,7 @@
131 131
            this.$axios.post(httpUrl.hQuery.sign.reqResetPw, {
132 132
              id: this.platId,
133 133
              mail: this.ruleForm.mail,
134
              url: httpUrl.platUrl + '/findPwd?step=2&sc'
134
              url: httpUrl.platUrl + '/#/findPwd?step=2&sc'
135 135
            }).then(res => {
136 136
              console.log(res);
137 137
              if (res.success) {

+ 1 - 1
src/components/form-views/upMail.vue

@ -55,7 +55,7 @@
55 55
                  type: 'success',
56 56
                  confirmButtonText: '重新登录',
57 57
                  callback: action => {
58
                    this.$router.push({path: '/loginPlat'});
58
                    this.$router.push({path: '/#/loginPlat'});
59 59
                  }
60 60
                });
61 61
              } else {

+ 4 - 6
src/components/main-views/TheFooter.vue

@ -30,17 +30,14 @@
30 30
<script type="text/javascript">
31 31
  import Cookies from 'js-cookie';
32 32
  import util from '@/libs/util';
33
  import PLAT from '../../../static/plat-info';
33 34
34 35
  export default {
35
    props: {
36
      plat: {
37
        type: Object
38
      }
39
    },
40 36
    data() {
41 37
      return {
42 38
        kexiuLink: util.ekexiuUrl,
43
        plf_user: ''
39
        plf_user: '',
40
        plat: ''
44 41
      };
45 42
    },
46 43
    methods: {
@ -56,6 +53,7 @@
56 53
      }
57 54
    },
58 55
    mounted () {
56
      this.plat = PLAT.info;
59 57
      this.init();
60 58
    }
61 59
  };

+ 6 - 6
src/components/main-views/TheHeader.vue

@ -33,17 +33,17 @@
33 33
34 34
<script type="text/javascript">
35 35
  import util from '@/libs/util';
36
  import PLAT from '../../../static/plat-info';
36 37
37 38
  export default {
38
    props: {
39
      plat: {
40
        type: Object
41
      }
42
    },
43 39
    data() {
44 40
      return {
45
        kexiuLink: util.ekexiuUrl
41
        kexiuLink: util.ekexiuUrl,
42
        plat: ''
46 43
      };
44
    },
45
    mounted() {
46
      this.plat = PLAT.info;
47 47
    }
48 48
  };
49 49
</script>

+ 5 - 2
src/libs/http.js

@ -1,10 +1,13 @@
1 1
2 2
let http = { };
3 3
4
// const kexiuUrl = 'https://www.ekexiu.com';
5 4
const kexiuUrl = 'http://192.168.3.233:81';
6 5
const platUrl = 'http://localhost:7070';
7
const utilUrl = platUrl + '/ajax';
6
7
// const kexiuUrl = 'http://192.168.3.233'; // 跳转科袖链接地址、图片访问路径
8
// const platUrl = 'http://192.168.3.233:2080'; // 邮箱配置的地址
9
10
const utilUrl = platUrl + '/ajax'; // 平台访问的接口地址
8 11
9 12
http.platUrl = platUrl;
10 13
http.utilUrl = utilUrl;

+ 2 - 2
src/router/index.js

@ -7,8 +7,8 @@ Vue.use(VueRouter);
7 7
8 8
// 路由配置
9 9
const RouterConfig = {
10
		hashbang: false,
11
    mode: 'history',
10
		// hashbang: false,
11
  //   mode: 'history',
12 12
    routes: routers
13 13
};
14 14

+ 24 - 0
static/plat-info.js

@ -0,0 +1,24 @@
1
var PLAT = {}
2
3
PLAT.info = {
4
  "id":"9619237FAF5E4B908F0F88A5845C8C9F",
5
  "source":"xttjpt",
6
  "name": "邢台经济开发区",
7
  "website": "http://www.xtkfq.gov.cn",
8
  "address": "中国河北省邢台市中兴东大街1888号",
9
  "tel": "86-319-3636000",
10
  "fax": "86-319-3636111 ",
11
  "zipcode": "054001",
12
  "mailbox": "xtkfqbgs@sohu.com",
13
  "logourl": "/static/xtkfq/icon-logo.png",
14
  "bannerurl": "/static/xtkfq/banner.jpg",
15
  "platimgurl": "/static/xtkfq/platimg.jpg",
16
  "adinfo":[
17
    {
18
      "adUrl": "http://www.ecorr.org",
19
      "imgUrl": "/static/xtkfq/ad/fengying.jpg"
20
    }
21
  ]
22
};
23
24
export default PLAT;