lrf402788946 4 years ago
parent
commit
3af87eae8b
5 changed files with 135 additions and 0 deletions
  1. 5 0
      dict/index.js
  2. 2 0
      src/components/adminCommon/frame.vue
  3. 14 0
      src/store/expert.js
  4. 57 0
      src/store/mechanism.js
  5. 57 0
      src/store/organization.js

+ 5 - 0
dict/index.js

@@ -4,4 +4,9 @@ export const productType = [
   { label: '技术成果', value: '1' },
   { label: '商务服务', value: '2' },
 ];
+export const status = [
+  { label: '注册', value: '0' },
+  { label: '通过', value: '1' },
+  { label: '拒绝', value: '2' },
+];
 // export default ['政务动态', '通知通告', '科技新闻', '媒体聚焦', '信息公开'];

+ 2 - 0
src/components/adminCommon/frame.vue

@@ -28,6 +28,8 @@
             <el-menu-item index="/adminCenter/patent">专利管理</el-menu-item>
             <el-menu-item index="/adminCenter/roadShow">路演管理</el-menu-item>
             <el-menu-item index="/adminCenter/expert">专家管理</el-menu-item>
+            <el-menu-item index="/adminCenter/organization">企业管理</el-menu-item>
+            <el-menu-item index="/adminCenter/mechanism">机构管理</el-menu-item>
           </el-menu>
         </el-aside>
         <el-main class="main">

+ 14 - 0
src/store/expert.js

@@ -34,6 +34,20 @@ const actions = {
     const res = await this.$axios.$delete(`${api.interface}/${payload}`);
     return res;
   },
+  async password({ commit }, { id, passwd }) {
+    const res = await this.$axios.$post(`${api.interface}/password/${id}`, { passwd });
+    return res;
+  },
+  async login({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}/login`, payload);
+    const jwt = require('jsonwebtoken');
+    if (res.errcode === 0) {
+      localStorage.setItem('token', res.data);
+      const user = jwt.decode(res.data);
+      commit('setUser', user, { root: true });
+    }
+    return res;
+  },
 };
 export default {
   namespaced: true,

+ 57 - 0
src/store/mechanism.js

@@ -0,0 +1,57 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/m/main/mechanism`,
+};
+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 password({ commit }, { id, passwd }) {
+    const res = await this.$axios.$post(`${api.interface}/password/${id}`, { passwd });
+    return res;
+  },
+  async login({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}/login`, payload);
+    const jwt = require('jsonwebtoken');
+    if (res.errcode === 0) {
+      localStorage.setItem('token', res.data);
+      const user = jwt.decode(res.data);
+      commit('setUser', user, { root: true });
+    }
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 57 - 0
src/store/organization.js

@@ -0,0 +1,57 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/m/main/organization`,
+};
+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 password({ commit }, { id, passwd }) {
+    const res = await this.$axios.$post(`${api.interface}/password/${id}`, { passwd });
+    return res;
+  },
+  async login({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}/login`, payload);
+    const jwt = require('jsonwebtoken');
+    if (res.errcode === 0) {
+      localStorage.setItem('token', res.data);
+      const user = jwt.decode(res.data);
+      commit('setUser', user, { root: true });
+    }
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};