guhongwei 2 lat temu
rodzic
commit
edb661257f
3 zmienionych plików z 49 dodań i 0 usunięć
  1. 1 0
      .gitignore
  2. 6 0
      src/layout/site.js
  3. 42 0
      src/store/app/videos.js

+ 1 - 0
.gitignore

@@ -22,3 +22,4 @@ pnpm-debug.log*
 *.njsproj
 *.sln
 *.sw?
+*.history

+ 6 - 0
src/layout/site.js

@@ -166,6 +166,12 @@ export const menus = [
           },
         ],
       },
+      {
+        _id: 'me3us_2_6',
+        icon: 'el-icon-user',
+        name: '视频信息',
+        path: '/app/videos',
+      },
     ],
   },
   {

+ 42 - 0
src/store/app/videos.js

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