@@ -39,11 +39,11 @@ export const devMenu = [
name: '寝室管理',
module: 'center',
},
- {
- path: '/classes/index',
- name: '班级管理',
- module: 'center',
- },
+ // {
+ // path: '/classes/index',
+ // name: '班级管理',
+ // module: 'center',
+ // },
{
path: '/subject/index',
name: '科目管理',
@@ -77,11 +77,11 @@ export const devMenu = [
name: '作业管理',
- path: '/timeTable/index',
- name: '课表管理',
+ // path: '/timeTable/index',
+ // name: '课表管理',
path: '',
name: '调查问卷',
@@ -0,0 +1,28 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+const jwt = require('jsonwebtoken');
+Vue.use(Vuex);
+const api = {
+ interface: `/api/train/login`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+ async login({ commit }, payload) {
+ const res = await this.$axios.$post(`${api.interface}`, payload);
+ let result = true;
+ if (res.errcode === 0) {
+ let info = jwt.decode(res.data);
+ commit('setUser', info, { root: true });
+ } else result = res;
+ return result;
+ },
+export default {
+ namespaced: true,
+ state,
+ mutations,
+ actions,
@@ -18,7 +18,7 @@ const actions = {
return res;
async fetch({ commit }, payload) {
- const res = await this.$axios.$get(`${api.interface}/show/${payload}`);
+ const res = await this.$axios.$get(`${api.interface}/${payload}`);
async update({ commit }, { id, ...data }) {