guhongwei 4 vuotta sitten
vanhempi
commit
16216b9e17

+ 21 - 19
src/store/index.js

@@ -2,21 +2,22 @@ import Vue from 'vue';
 import Vuex from 'vuex';
 import * as ustate from '@common/src/store/user/state';
 import * as umutations from '@common/src/store/user/mutations';
-import login from '@common/src/store/login';
-import news from '@common/src/store/news';
-import openInfo from '@common/src/store/openInfo';
+// 环南湖接口
+import mechanism from '@common/src/store/mechanism';
+import expert from '@common/src/store/expert';
 import product from '@common/src/store/product';
 import patent from '@common/src/store/patent';
-import roadShow from '@common/src/store/roadShow';
-import expert from '@common/src/store/expert';
-import organization from '@common/src/store/organization';
-import mechanism from '@common/src/store/mechanism';
-import code from '@common/src/store/code';
+import news from '@common/src/store/news';
+import openInfo from '@common/src/store/openInfo';
 import online from '@common/src/store/online';
-import policy from '@common/src/store/policy';
-import ticket from '@common/src/store/ticket';
+import code from '@common/src/store/code';
 import achieveApply from '@common/src/store/achieve_apply';
 import statistics from '@common/src/store/statistics';
+// 直播平台接口
+import adminLogin from './live/adminLogin';
+import organization from './live/organization';
+import policy from './live/policy';
+import ticket from './live/ticket';
 
 Vue.use(Vuex);
 
@@ -25,20 +26,21 @@ export default new Vuex.Store({
   mutations: { ...umutations },
   actions: {},
   modules: {
-    login,
-    news,
-    openInfo,
-    product,
-    patent,
-    roadShow,
+    // 环南湖接口
     expert,
-    organization,
     mechanism,
+    product,
+    patent,
+    news,
+    openInfo,
     online,
     code,
-    policy,
-    ticket,
     achieveApply,
     statistics,
+    // 直播平台接口
+    adminLogin,
+    organization,
+    policy,
+    ticket,
   },
 });

+ 57 - 0
src/store/live/adminLogin.js

@@ -0,0 +1,57 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+const jwt = require('jsonwebtoken');
+Vue.use(Vuex);
+const api = {
+  adminLoginInfo: `/api/live/v0/users/admin`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.adminLoginInfo}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.adminLoginInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.adminLoginInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.adminLoginInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.adminLoginInfo}/${payload}`);
+    return res;
+  },
+  async login({ commit }, { user }) {
+    const res = await this.$axios.$post(`${api.adminLoginInfo}/login`, user);
+    if (res.errcode === 0) {
+      localStorage.setItem('token', res.data);
+      localStorage.setItem('type', 'FWJG');
+      user = jwt.decode(res.data);
+      commit('setUser', user, { root: true });
+    }
+    return res;
+  },
+  async updatePwd({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.adminLoginInfo}/password/${id}`, data);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 58 - 0
src/store/live/organization.js

@@ -0,0 +1,58 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+const jwt = require('jsonwebtoken');
+Vue.use(Vuex);
+const api = {
+  organizationInfo: `/api/live/v0/users/organization`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.organizationInfo}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.organizationInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.organizationInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.organizationInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.organizationInfo}/${payload}`);
+    return res;
+  },
+  // 修改密码
+  async updatePassword({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.organizationInfo}/password/${id}`, data);
+    return res;
+  },
+  async orgLogin({ commit }, { user }) {
+    const res = await this.$axios.$post(`${api.organizationInfo}/login`, user);
+    if (res.errcode === 0) {
+      localStorage.setItem('token', res.data);
+      localStorage.setItem('type', 'QY');
+      user = jwt.decode(res.data);
+      commit('setUser', user, { root: true });
+    }
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 53 - 0
src/store/live/policy.js

@@ -0,0 +1,53 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/live/v0/cysci/policy`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.interface}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.interface}/update/${id}`, data);
+    return res;
+  },
+
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.interface}/${payload}`);
+    return res;
+  },
+  // 获取行政区划
+  async xzqh({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/xzqh`, payload);
+    return res;
+  },
+  // 用code换该项
+  async getItemByCode({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}/name`, payload);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 57 - 0
src/store/live/ticket.js

@@ -0,0 +1,57 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+import { registerCoordinateSystem } from 'echarts';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/live/v0/cysci/ticket`,
+  statistics: `/api/m/main/statistics/ticket`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.interface}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.interface}/update/${id}`, data);
+    return res;
+  },
+
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.interface}/${payload}`);
+    return res;
+  },
+  async status({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.interface}/status/${id}`, data);
+    return res;
+  },
+  async record({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}Record`, payload);
+    return res;
+  },
+  async staQuery({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.statistics}`, payload);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 4 - 3
src/views/adminCenter/company/cognizance/detail.vue

@@ -72,6 +72,9 @@ export default {
             qyfr: [],
             yyzz: [],
             qylr: [],
+            qyfr1: [],
+            yyzz1: [],
+            qylr1: [],
           };
           this.$set(this, `form`, data);
         }
@@ -82,9 +85,7 @@ export default {
         if (valid) {
           let data = this.form;
           data.material = this.oneMap();
-          if (this.status == '1') {
-            data.medium_material = this.twoMap();
-          }
+          data.medium_material = this.twoMap();
           if (this.id) {
             data.status = this.searchStatus(data.status);
             let res = await this.update(data);

+ 1 - 1
src/views/adminCenter/company/cognizance/info.vue

@@ -58,7 +58,7 @@
                 <el-timeline>
                   <el-timeline-item v-for="(item, index) in descList" :key="index" :timestamp="item.create_time" placement="top">
                     <el-card>
-                      <p>{{ item.desc }}</p>
+                      <p>{{ item.desc || '暂无' }}</p>
                     </el-card>
                   </el-timeline-item>
                 </el-timeline>

+ 1 - 1
src/views/adminCenter/company/reward/detail.vue

@@ -116,7 +116,7 @@ export default {
       });
     },
     back() {
-      this.$router.push({ path: '/adminCenter/company/subsidy' });
+      this.$router.push({ path: '/adminCenter/company/reward' });
     },
   },
   computed: {

+ 1 - 1
src/views/adminCenter/company/subsidy/detail.vue

@@ -116,7 +116,7 @@ export default {
       });
     },
     back() {
-      this.$router.push({ path: '/adminCenter/company/reward' });
+      this.$router.push({ path: '/adminCenter/company/subsidy' });
     },
   },
   computed: {

+ 3 - 1
src/views/adminCenter/homeIndex/index.vue

@@ -32,7 +32,9 @@ export default {
   data: function () {
     return {};
   },
-  created() {},
+  created() {
+    console.log(this.user);
+  },
   methods: {},
   computed: {
     ...mapState(['user']),

+ 1 - 1
src/views/adminCenter/organization/index.vue

@@ -67,7 +67,7 @@ export default {
   methods: {
     ...organization(['query', 'delete']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      const res = await this.query({ skip, limit, ...info });
+      const res = await this.query({ skip, limit, code: this.user.code, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);

+ 5 - 5
src/views/login.vue

@@ -30,7 +30,7 @@
                         <el-input v-model="form.phone" prefix-icon="el-icon-user-solid" placeholder="请输入企业账号"></el-input>
                       </el-form-item>
                       <el-form-item>
-                        <el-input v-model="form.passwd" prefix-icon="el-icon-lock" placeholder="请输入账号密码" show-password></el-input>
+                        <el-input v-model="form.password" prefix-icon="el-icon-lock" placeholder="请输入账号密码" show-password></el-input>
                       </el-form-item>
                       <el-col :span="24" class="btn">
                         <el-button type="danger" @click="resetBtn">取消登录</el-button>
@@ -83,7 +83,7 @@
 <script>
 const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: adminLogin } = createNamespacedHelpers('login');
+const { mapActions: adminLogin } = createNamespacedHelpers('adminLogin');
 const { mapActions: organization } = createNamespacedHelpers('organization');
 const { mapActions: mechanism } = createNamespacedHelpers('mechanism');
 const { mapActions: expertLogin } = createNamespacedHelpers('expert');
@@ -103,7 +103,7 @@ export default {
     // 管理登录
     ...adminLogin({ adminLogin: 'login' }),
     // 企业
-    ...organization(['login']),
+    ...organization(['orgLogin']),
     // 机构
     ...mechanism({ interLogin: 'login' }),
     // 专家
@@ -112,7 +112,7 @@ export default {
     async thrSubmit() {
       let data = _.get(this, 'form');
       data.code_phone = data.phone;
-      const res = await this.adminLogin(data);
+      let res = await this.adminLogin({ user: this.form });
       if (this.$checkRes(res)) {
         this.$router.push({ path: '/adminCenter/homeIndex' });
       }
@@ -121,7 +121,7 @@ export default {
     async oneSubmit() {
       let data = _.get(this, 'form');
       data.institution_code = data.phone;
-      const res = await this.login(data);
+      let res = await this.orgLogin({ user: this.form });
       if (this.$checkRes(res)) {
         this.$router.push({ path: '/adminCenter/homeIndex' });
       }

+ 4 - 3
src/views/service/register/company.vue

@@ -15,8 +15,8 @@
               <el-form-item label="手机号" prop="phone">
                 <el-input v-model="form.phone" placeholder="请输入手机号"></el-input>
               </el-form-item>
-              <el-form-item label="登录密码" prop="passwd">
-                <el-input v-model="form.passwd" placeholder="请输入登录密码" show-password></el-input>
+              <el-form-item label="登录密码" prop="password">
+                <el-input v-model="form.password" placeholder="请输入登录密码" show-password></el-input>
               </el-form-item>
               <el-form-item label="电子邮箱" prop="email">
                 <el-input v-model="form.email" placeholder="请输入电子邮箱"></el-input>
@@ -121,7 +121,7 @@ export default {
           { required: true, message: '请输入手机号', trigger: 'blur' },
           { max: 11, message: '不得超过11' },
         ],
-        passwd: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
+        password: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
         email: [{ required: true, message: '请输入电子邮箱', trigger: 'blur' }],
         addr: [{ required: true, message: '请输入联系地址', trigger: 'blur' }],
         office_phone: [{ required: true, message: '请输入办公电话', trigger: 'blur' }],
@@ -140,6 +140,7 @@ export default {
         if (valid) {
           let data = this.form;
           data.status = '0';
+          data.code = 'HNHGLY';
           let res = await this.create(data);
           if (this.$checkRes(res)) {
             this.$message({

+ 6 - 1
vue.config.js

@@ -22,8 +22,13 @@ module.exports = {
       '/files': {
         target: 'http://broadcast.waityou24.cn',
       },
+      '/api/live': {
+        target: 'http://192.168.1.19:9101', //http://192.168.1.19:9101//http://broadcast.waityou24.cn
+        changeOrigin: true,
+        ws: false,
+      },
       '/api': {
-        target: 'http://192.168.1.19:9200', //http://192.168.1.19:9200//http://broadcast.waityou24.cn
+        target: 'http://192.168.1.19:9200', //http://192.168.1.19:9200//http://cccysci.waityou24.cn
         changeOrigin: true,
         ws: false,
       },