lrf402788946 5 年之前
父節點
當前提交
df5ba526f6

二進制
assets/home/bg.jpg


二進制
assets/home/gk1.png


二進制
assets/home/gk2.png


二進制
assets/home/gk3.png


二進制
assets/home/gk4.png


二進制
assets/home/gk5.png


二進制
assets/home/gk6.png


二進制
assets/home/logo.png


二進制
assets/home/zw1.jpg


二進制
assets/home/zw1.png


二進制
assets/home/zw2.png


二進制
assets/home/zw3.png


二進制
assets/home/zw4.png


二進制
assets/home/zw5.png


二進制
assets/home/zw6.png


二進制
assets/home/zw7.png


二進制
assets/home/zw8.png


二進制
assets/home/更多.png


+ 49 - 0
layout/home/foot.vue

@@ -0,0 +1,49 @@
+<template>
+  <div id="foot">
+    <el-row>
+      <el-col :span="24" class="foot">
+        <div class="div">
+          <p v-if="info" v-html="info.content"></p>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'foot',
+  props: {
+    info: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.foot p p {
+  padding: 0;
+  margin: 0;
+}
+.foot {
+  width: 100%;
+  min-height: 120px;
+  background-color: rgba(0, 0, 0, 0.4);
+  overflow: hidden;
+}
+.foot .div {
+  width: 650px;
+  margin: 0 auto;
+}
+.foot p {
+  float: left;
+  color: #858f9b;
+  font-size: 14px;
+  margin-right: 24px;
+  line-height: 30px;
+}
+</style>

+ 165 - 0
layout/home/government.vue

@@ -0,0 +1,165 @@
+<template>
+  <div id="government">
+    <el-row>
+      <el-col :span="24" class="top">
+        <top></top>
+      </el-col>
+      <el-col :span="24" class="logo">
+        <div class="w_1200">
+          <logo :info="info"></logo>
+        </div>
+      </el-col>
+      <el-col :span="24" class="menu">
+        <div class="w_1200">
+          <menuInfo></menuInfo>
+        </div>
+      </el-col>
+      <el-col :span="24" class="main">
+        <!-- <div class="w_1200">
+          <el-col :span="12" class="phontoNews">
+            <photoNews :photoNews="photoNews"> </photoNews>
+          </el-col>
+          <el-col :span="12" class="news">
+            <news :chuangxinList="chuangxinList" :guoneiList="guoneiList" :zhengwuList="zhengwuList" :meitiList="meitiList"></news>
+          </el-col>
+          <el-col :span="8" class="notice">
+            <notice :tongzhiList="tongzhiList"></notice>
+          </el-col>
+          <el-col :span="16" class="zhengwu">
+            <zhengwu :zhengwu="zhengwu"></zhengwu>
+          </el-col>
+          <el-col :span="24" class="gongzhong">
+            <gongzhong :gongzhongList="gongzhongList"></gongzhong>
+          </el-col>
+          <el-col :span="24" class="link">
+            <linkInfo :linkList="linkList"></linkInfo>
+          </el-col>
+        </div> -->
+      </el-col>
+      <el-col :span="24" class="foot">
+        <div class="w_1200">
+          <foot :info="info"></foot>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from '@/layout/index/top.vue';
+import logo from '@/layout/index/logo.vue';
+import menuInfo from '@/layout/index/menuInfo.vue';
+import foot from '@/layout/index/foot.vue';
+import photoNews from '@/layout/government/photoNews.vue';
+import news from '@/layout/government/news.vue';
+import notice from '@/layout/government/notice.vue';
+import zhengwu from '@/layout/government/zhengwu.vue';
+import gongzhong from '@/layout/government/gongzhong.vue';
+import linkInfo from '@/layout/index/linkInfo.vue';
+export default {
+  name: 'government',
+  props: {
+    info: null, //站点信息
+    photoNews: null, //图片新闻
+    chuangxinList: null, //科技政务图片旁边新闻
+    guoneiList: null, //科技政务图片旁边国内动态
+    zhengwuList: null, //科技政务图片旁边政务活动
+    meitiList: null, //科技政务图片旁边媒体焦距
+    tongzhiList: null, //通知公告
+    zhengwu: null, //政务公开
+    gongzhongList: null, //公众参与
+    linkList: null, //友情链接
+  },
+  components: {
+    top, //头部
+    logo, //logo
+    menuInfo, //导航
+    foot, //底部
+    // photoNews, //科技政务下的图片新闻照片
+    // news, //科技政务图片旁边新闻
+    // notice, //通知公告
+    // zhengwu, //政务公告
+    // gongzhong, //公众参与
+    // linkInfo, //相关链接
+  },
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+.w_1200 {
+  width: 1200px;
+  margin: 0 auto;
+}
+.top {
+  height: 40px;
+  overflow: hidden;
+  background-color: rgba(11, 58, 125, 0.8);
+}
+.logo {
+  height: 200px;
+  overflow: hidden;
+}
+.menu {
+  height: 70px;
+  overflow: hidden;
+}
+.main {
+  height: 1080px;
+  overflow: hidden;
+  margin: 10px 0;
+}
+.main .phontoNews {
+  float: left;
+  width: 590px;
+  height: 400px;
+  overflow: hidden;
+  margin: 0 10px 10px 0;
+  background-color: #fff;
+}
+.main .news {
+  float: left;
+  width: 600px;
+  height: 400px;
+  margin: 0 0 10px 0;
+  overflow: hidden;
+  background-color: #fff;
+}
+.main .notice {
+  float: left;
+  width: 390px;
+  height: 320px;
+  margin: 0 10px 10px 0;
+  overflow: hidden;
+  background-color: #fff;
+}
+.main .zhengwu {
+  float: left;
+  width: 800px;
+  height: 320px;
+  margin: 0 0 10px 0;
+  overflow: hidden;
+  background-color: #fff;
+}
+.main .gongzhong {
+  height: 240px;
+  margin: 0 0 10px 0;
+  background-color: #fff;
+}
+.main .link {
+  float: left;
+  width: 100%;
+  height: 100px;
+  overflow: hidden;
+  background-color: #fff;
+}
+.foot {
+  float: left;
+  width: 100%;
+  height: 120px;
+  overflow: hidden;
+}
+</style>

+ 85 - 0
layout/home/layout.vue

@@ -0,0 +1,85 @@
+<template>
+  <div :style="`background:url(${bg}) no-repeat fixed;background-size: 100% 100%;`">
+    <el-row>
+      <el-col :span="24" class="top">
+        <top></top>
+      </el-col>
+      <el-col :span="24" class="logo">
+        <div class="w_1200">
+          <logo :info="info"></logo>
+        </div>
+      </el-col>
+      <el-col :span="24" class="menu">
+        <div class="w_1200">
+          <menuInfo></menuInfo>
+        </div>
+      </el-col>
+      <el-col :span="24" class="main">
+        <div class="w_1200">
+          <router-view />
+        </div>
+      </el-col>
+      <el-col :span="24" class="foot">
+        <div class="w_1200">
+          <foot :info="info"></foot>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from './top.vue';
+import logo from './logo.vue';
+import menuInfo from './menuInfo.vue';
+import foot from './foot.vue';
+export default {
+  name: 'government',
+  props: {
+    info: null, //站点信息
+  },
+  components: {
+    top, //头部
+    logo, //logo
+    menuInfo, //导航
+    foot, //底部
+  },
+  data: () => ({
+    bg: require('@common/assets/home/bg.jpg'),
+  }),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+.w_1200 {
+  width: 1200px;
+  margin: 0 auto;
+}
+.top {
+  height: 40px;
+  overflow: hidden;
+  background-color: rgba(11, 58, 125, 0.8);
+}
+.logo {
+  height: 200px;
+  overflow: hidden;
+}
+.menu {
+  height: 70px;
+  overflow: hidden;
+}
+.main {
+  // height: 1080px;
+  overflow: hidden;
+  margin: 10px 0;
+}
+.foot {
+  float: left;
+  width: 100%;
+  height: 120px;
+  overflow: hidden;
+}
+</style>

+ 40 - 0
layout/home/logo.vue

@@ -0,0 +1,40 @@
+<template>
+  <div id="logo">
+    <el-row>
+      <el-col :span="24" class="logo">
+        <span v-if="info && info.logourl">
+          <el-image style="width:690px;height:66px;" :src="info.logourl">
+            <div slot="error" class="image-slot">
+              <el-image style="width:690px;height:66px;" :src="logourl"></el-image>
+            </div>
+          </el-image>
+        </span>
+        <span v-else>
+          <el-image style="width:690px;height:66px;" :src="logourl"></el-image>
+        </span>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'logo',
+  props: {
+    info: null,
+  },
+  components: {},
+  data: () => ({
+    logourl: require('@/assets/home/logo.png'),
+  }),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+.logo {
+  padding: 65px 0;
+}
+</style>

+ 84 - 0
layout/home/menuInfo.vue

@@ -0,0 +1,84 @@
+<template>
+  <div id="menuInfo">
+    <el-row>
+      <el-col :span="24" class="menu">
+        <el-menu
+          :default-active="thisRouter()"
+          class="el-menu-demo"
+          mode="horizontal"
+          :router="false"
+          :default-openeds="defalutMenu"
+          @select="to"
+          text-color="#fff"
+        >
+          <el-menu-item index="/">网站首页</el-menu-item>
+          <el-menu-item index="/government/government">科技政务</el-menu-item>
+          <el-menu-item index="/policy/policy">科技政策</el-menu-item>
+          <el-menu-item index="/supermaket/supermarket">科技超市</el-menu-item>
+          <el-menu-item index="/shuju/shuju">科技数据</el-menu-item>
+          <el-menu-item index="/service/service">科技服务</el-menu-item>
+          <el-menu-item index="/">
+            <el-link
+              style="padding: 0px 0px;font-size: 22px;"
+              :underline="false"
+              href="http://139.210.167.203/free-technological-management/mapApply/getMap"
+              target="_blank"
+              >科技资源</el-link
+            >
+          </el-menu-item>
+          <el-menu-item index="/personnel/personnel">科技人才</el-menu-item>
+        </el-menu>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'menuInfo',
+  props: {},
+  components: {},
+  data: () => ({
+    defalutMenu: [],
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    thisRouter() {
+      console.log(this.$route.path);
+    },
+    to(index) {
+      this.$router.push({ path: index });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.menu {
+  height: 70px;
+  overflow: hidden;
+  background-color: rgba(0, 0, 0, 0.4);
+}
+/deep/.el-menu {
+  background-color: rgba(0, 0, 0, 0.4);
+}
+/deep/.el-menu--horizontal > .el-menu-item {
+  height: 70px;
+  line-height: 70px;
+  border-right: 1px solid #ccc;
+  padding: 0 30px;
+  font-size: 22px;
+}
+/deep/.el-menu--horizontal > .el-menu-item:last-child {
+  padding: 0 34px;
+}
+/deep/.el-menu--horizontal > .el-menu-item.is-active {
+  border-bottom: none;
+  color: #fff;
+  background-color: #215299;
+}
+/deep/.el-menu--horizontal > .el-menu-item:hover {
+  background-color: #215299;
+}
+</style>

+ 77 - 0
layout/home/top.vue

@@ -0,0 +1,77 @@
+<template>
+  <div id="top">
+    <el-row>
+      <el-col :span="24" class="top">
+        <div class="w_1200">
+          <el-col :span="22" class="date">
+            {{ gettime }}
+          </el-col>
+          <el-col :span="2" class="btn" v-if="user && user.id"> {{ user.name }} | <el-link :underline="false" @click="toLogOut">注销</el-link> </el-col>
+          <el-col :span="2" class="btn">
+            <el-link :underline="false" @click="loginBtn()" target="_blank">注册</el-link>|<el-link :underline="false" @click="loginBtn()" target="_blank"
+              >登录</el-link
+            >
+          </el-col>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'top',
+  props: {},
+  components: {},
+  data: () => ({
+    gettime: '',
+  }),
+  created() {
+    this.currentTime();
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  methods: {
+    currentTime() {
+      setInterval(this.getTime, 500);
+    },
+    getTime: function() {
+      var _this = this;
+      let yy = new Date().getFullYear();
+      let mm = new Date().getMonth() + 1;
+      let dd = new Date().getDate();
+      let day = new Date().getDay();
+      var weekday = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
+      _this.gettime = yy + '-' + mm + '-' + dd + ' ' + weekday[day];
+    },
+    loginBtn() {
+      this.$router.push({ path: '/login' });
+    },
+    toLogOut() {},
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.w_1200 {
+  width: 1200px;
+  margin: 0 auto;
+}
+.date {
+  height: 40px;
+  line-height: 40px;
+  color: #fff;
+  font-size: 16px;
+}
+.btn {
+  height: 40px;
+  line-height: 40px;
+  color: #fff;
+}
+.btn .el-link {
+  color: #fff;
+  margin: 0 5px;
+}
+</style>

+ 74 - 0
layout/subPage/question.vue

@@ -0,0 +1,74 @@
+<template>
+  <div id="question">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="infoTop">
+          <el-image style="width:250px;height:60px;" :src="pic"></el-image>
+        </el-col>
+        <el-col :span="24" class="form">
+          <el-col :span="24" class="image">
+            <el-image :src="formImage" style="width:100px;height:80px;"></el-image>
+          </el-col>
+          <el-form ref="form" :model="form">
+            <el-form-item label="您是否愿意继续关注本平台">
+              <el-radio-group v-model="form.resource">
+                <el-radio label="愿意"></el-radio>
+                <el-radio label="不愿意"></el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit">确认提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'question',
+  props: {},
+  components: {},
+  data: () => ({
+    pic: require('@/assets/diaocha.gif'),
+    formImage: require('@/assets/cha.png'),
+    form: {
+      resource: '',
+    },
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    onSubmit() {
+      console.log('submit!');
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.infoTop {
+  width: 250px;
+  height: 60px;
+  overflow: hidden;
+}
+.image {
+  text-align: center;
+  margin: 20px 0;
+}
+.form .el-form {
+  float: left;
+  width: 100%;
+  text-align: center;
+}
+/deep/.el-radio {
+  color: #000;
+}
+/deep/.el-form-item__label {
+  width: 100%;
+  text-align: center;
+  color: #000;
+}
+</style>

+ 19 - 0
plugins/axios.js

@@ -0,0 +1,19 @@
+import Vue from 'vue';
+import AxiosWrapper from '@/util/axios-wrapper';
+
+const Plugin = {
+  install(vue, options) {
+    // 3. 注入组件
+    vue.mixin({
+      created() {
+        if (this.$store && !this.$store.$axios) {
+          this.$store.$axios = this.$axios;
+        }
+      },
+    });
+    // 4. 添加实例方法
+    vue.prototype.$axios = new AxiosWrapper(options);
+  },
+};
+
+Vue.use(Plugin, { baseUrl: process.env.VUE_APP_AXIOS_BASE_URL });

+ 39 - 0
plugins/check-res.js

@@ -0,0 +1,39 @@
+/* eslint-disable no-underscore-dangle */
+/* eslint-disable no-param-reassign */
+/* eslint-disable no-unused-vars */
+/* eslint-disable no-shadow */
+import Vue from 'vue';
+import _ from 'lodash';
+import { Message } from 'element-ui';
+
+const vm = new Vue({});
+const Plugin = {
+  install(Vue, options) {
+    // 4. 添加实例方法
+    Vue.prototype.$checkRes = (res, okText, errText) => {
+      let _okText = okText;
+      let _errText = errText;
+      if (!_.isFunction(okText) && _.isObject(okText) && okText != null) {
+        ({ okText: _okText, errText: _errText } = okText);
+      }
+      const { errcode = 0, errmsg } = res || {};
+      if (errcode === 0) {
+        if (_.isFunction(_okText)) {
+          return _okText();
+        }
+        if (_okText) {
+          Message.success(_okText);
+        }
+        return true;
+      }
+      if (_.isFunction(_errText)) {
+        return _errText();
+      }
+      Message.error(_errText || errmsg);
+      // Message({ message: _errText || errmsg, duration: 60000 });
+      return false;
+    };
+  },
+};
+
+Vue.use(Plugin);

+ 5 - 0
plugins/element.js

@@ -0,0 +1,5 @@
+import Vue from 'vue';
+import Element from 'element-ui';
+import 'element-ui/lib/theme-chalk/index.css';
+
+Vue.use(Element);

+ 6 - 0
plugins/filters.js

@@ -0,0 +1,6 @@
+import Vue from 'vue';
+import filters from '@/util/filters';
+
+for (const method in filters) {
+  Vue.filter(method, filters[method]);
+}

+ 27 - 0
plugins/loading.js

@@ -0,0 +1,27 @@
+/* eslint-disable no-console */
+/* eslint-disable no-param-reassign */
+
+import Vue from 'vue';
+
+const Plugin = {
+  // eslint-disable-next-line no-unused-vars
+  install(vue, options) {
+    // 3. 注入组件
+    vue.mixin({
+      created() {
+        // eslint-disable-next-line no-underscore-dangle
+        const isRoot = this.constructor === Vue;
+        // console.log(`rootId:${rootVue_uid}; thisId:${this._uid}`);
+        // if (rootVue_uid !== 3) {
+        //   console.log(this);
+        // }
+        if (isRoot) {
+          const el = document.getElementById('loading');
+          if (el) el.style.display = 'none';
+        }
+      },
+    });
+  },
+};
+
+Vue.use(Plugin, { baseUrl: process.env.VUE_APP_AXIOS_BASE_URL });

+ 4 - 0
plugins/meta.js

@@ -0,0 +1,4 @@
+import Vue from 'vue';
+import Meta from 'vue-meta';
+
+Vue.use(Meta);

+ 20 - 0
plugins/setting.js

@@ -0,0 +1,20 @@
+import Vue from 'vue';
+
+Vue.config.weixin = {
+  // baseUrl: process.env.BASE_URL + 'weixin',
+  baseUrl: 'http://10.16.8.209:9005',
+};
+
+Vue.config.stomp = {
+  // brokerURL: 'ws://http://free.liaoningdoupo.com/ws',
+  brokerURL: '/ws', // ws://${location.host}/ws
+  connectHeaders: {
+    host: 'visit',
+    login: 'visit', //visit
+    passcode: 'visit', //visit123
+  },
+  // debug: true,
+  reconnectDelay: 5000,
+  heartbeatIncoming: 4000,
+  heartbeatOutgoing: 4000,
+};

+ 65 - 0
plugins/stomp.js

@@ -0,0 +1,65 @@
+/**
+ * 基于WebStomp的消息处理插件
+ */
+
+import Vue from 'vue';
+import _ from 'lodash';
+import assert from 'assert';
+import { Client } from '@stomp/stompjs/esm5/client';
+
+const Plugin = {
+  install(Vue, options) {
+    assert(_.isObject(options));
+    if (options.debug && !_.isFunction(options.debug)) {
+      options.debug = str => {
+        console.log(str);
+      };
+    }
+    assert(_.isString(options.brokerURL));
+    if (!options.brokerURL.startsWith('ws://')) {
+      options.brokerURL = `ws://${location.host}${options.brokerURL}`;
+    }
+
+    // 3. 注入组件
+    Vue.mixin({
+      beforeDestroy: function() {
+        if (this.$stompClient) {
+          this.$stompClient.deactivate();
+          delete this.$stompClient;
+        }
+      },
+    });
+
+    // 4. 添加实例方法
+    Vue.prototype.$stomp = function(subscribes = {}) {
+      // connect to mq
+      const client = new Client(options);
+      client.onConnect = frame => {
+        // Do something, all subscribes must be done is this callback
+        // This is needed because this will be executed after a (re)connect
+        console.log('[stomp] connected');
+        Object.keys(subscribes)
+          .filter(p => _.isFunction(subscribes[p]))
+          .forEach(key => {
+            client.subscribe(key, subscribes[key]);
+          });
+      };
+
+      client.onStompError = frame => {
+        // Will be invoked in case of error encountered at Broker
+        // Bad login/passcode typically will cause an error
+        // Complaint brokers will set `message` header with a brief message. Body may contain details.
+        // Compliant brokers will terminate the connection after any error
+        console.log('Broker reported error: ' + frame.headers['message']);
+        console.log('Additional details: ' + frame.body);
+      };
+
+      client.activate();
+
+      this.$stompClient = client;
+    };
+  },
+};
+export default () => {
+  Vue.use(Plugin, Vue.config.stomp);
+};

+ 19 - 0
router/before.js

@@ -0,0 +1,19 @@
+import store from '@/store/index';
+
+const checkLogin = router => {
+  router.beforeEach((to, form, next) => {
+    store.commit('setUser');
+    // if (to.name === 'login') {
+    //   next();
+    //   return;
+    // }
+    // let user = store.state.user;
+    // if (user) {
+    //   next();
+    // }
+    // //下面是没登录的情况,需要跳转页面到用户未登录页
+    // else next({ name: 'login' });
+    next();
+  });
+};
+export default checkLogin;

+ 38 - 0
store/gov/affairsColumn.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  columnInfo: `/api/affairs/column`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.columnInfo}`, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.columnInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.columnInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.columnInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.columnInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 38 - 0
store/gov/affairsNews.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  newsInfo: `/api/affairs/news`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, column_id, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.newsInfo}`, { skip, limit, column_id, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.newsInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.newsInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.newsInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.newsInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 38 - 0
store/gov/link.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  links: `/api/setting/link`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.links}`, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.links}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.links}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.links}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.links}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 82 - 0
store/login.js

@@ -0,0 +1,82 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+import { Notification } from 'element-ui';
+const jwt = require('jsonwebtoken');
+Vue.use(Vuex);
+const api = {
+  interface: `/api/market/user/login`,
+  updatePassword: '/api/user/pwd_edit',
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  /**
+    user:Object required 登陆信息 
+    router:router 如果跳转就传
+    path:String 跳转到的路由位置
+    needReturn: Boolean 是否返回结果
+    typeCheck: Boolean 是否检查身份对应匹配的前端项目
+    isWx: Boolean 是否是微信登陆
+    needNotice:Boolean 是否需要提示
+   */
+  async login({ commit }, { user, router, path = '/', needReturn = false, typeCheck = false, isWx = false, needNotice = true }) {
+    let res;
+    //wx登陆,openid存在,user中是openid和qrcode;正常登陆,user中是mobile和passwd
+    if (isWx) res = await this.$axios.$post(`${api.wxLogin}`, user);
+    else res = await this.$axios.$post(`${api.interface}`, user);
+    const setUser = (token, commit) => {
+      localStorage.setItem('token', token);
+      commit('setUser', token, { root: true });
+    };
+    if (res.errcode == '0') {
+      setUser(res.data, commit);
+      // Notification({
+      //   title: '登录成功',
+      //   message: `欢迎,${user.user_name}`,
+      //   type: 'success',
+      //   duration: 2000,
+      // });
+      return res;
+    } else {
+      if (needReturn) return res;
+      else {
+        Notification({
+          title: '登录失败',
+          message: `失败原因:${res.errmsg || '登陆失败'}`,
+          type: 'error',
+        });
+      }
+    }
+  },
+  async update({ commit }, payload) {
+    let res = await this.$axios.$post(`${api.updatePassword}`, { data: payload });
+    return res;
+  },
+  async bind({ commit }, payload) {
+    let res = await this.$axios.$post(`${api.bind}`, payload);
+    return res;
+  },
+  async userBind({ commit }, payload) {
+    let res = await this.$axios.$post(`${api.userBind}`, payload);
+    return res;
+  },
+  async getQrcode({ commit }, payload) {
+    let res = await this.$axios.$get(`${api.connection}`);
+    if (res.errcode === 0) return res.data;
+    else {
+      console.warn('请求qrcode失败');
+    }
+  },
+  async wxCheck({ commit }, payload) {
+    let res = await this.$axios.$post(`${api.wxCheck}`, payload);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 22 - 0
store/site.js

@@ -0,0 +1,22 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  shows: `/api/setting/set/show`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async showInfo({ commit }, { ...info } = {}) {
+    const res = await this.$axios.$get(`${api.shows}`, { ...info });
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};