Commit 97a2192c authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/luochao/confucius into master

parents 2b33afc3 d47d90e1
......@@ -32,3 +32,4 @@ yarn-error.log*
*.njsproj
*.sln
yarn.lock
package-lock.json
import request from '../../utils/request'
/**
* 获取学校分页列表
*
*/
export function getschoolpage(data) {
return request({
url: '/user/GetSchoolPageList',
method: 'post',
data: data
})
}
/**
* 获取学校分页列表
*
*/
export function testapi(cmd,msgData) {
return request({
url: cmd,
method: 'post',
data: msgData
})
}
\ No newline at end of file
<template>
<div class="school">
</div>
</template>
<script>
export default {
meta: {
title: '登录 - 麦子教育系统',
},
data() {
return {
DataList: [],
total: 0,
};
},
created() {
},
mounted() {
this.TestApi();
//this.getschool();
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
methods: {
getschool() {
this.$store
.dispatch('GetSchoolPage', {
pageIndex: 1,
pageSize: 10
})
.then(res => {
if (res.Code == 1) {
this.DataList = res.Data.PageData;
this.total = res.Data.Count
}
})
.catch(() => {
})
},
TestApi() {
var cmdStr = "/Public";
var data = {}
cmdStr += "/RemoveRole"
//RemoveAssist
data = {
RoleId: 9,
};
this.$store
.dispatch('TestWebApi', {
cmdStr,
data
})
.then(res => {
console.log("res", res);
})
.catch(() => {
})
}
},
};
</script>
<style scoped>
</style>
const routes = [{
path: '/',
path: '/',
component: () =>
import('pages/user/login.vue')
},
{
path: '/login',
component: () =>
import('pages/user/login.vue')
},
{
path: '/home',
component: () =>
import('layouts/MainLayout.vue'),
children: [{
path: '',
component: () =>
import ('pages/user/login.vue')
},
{
path: '/login',
import('pages/Index.vue')
},
{
path: '/school/manager',
component: () =>
import ('pages/user/login.vue')
},
{
path: '/home',
import('pages/school/manager.vue')
},
{
path: '/school',
component: () =>
import ('layouts/MainLayout.vue'),
children: [{
path: '',
component: () =>
import ('pages/Index.vue')
},
{
path: '/school/manager',
component: () =>
import ('pages/school/manager.vue')
}
]
},
import('pages/school/school.vue')
},
]
},
// Always leave this as last one,
// but you can also remove it
{
path: '*',
component: () =>
import ('pages/Error404.vue')
}
// Always leave this as last one,
// but you can also remove it
{
path: '*',
component: () =>
import('pages/Error404.vue')
}
]
export default routes
\ No newline at end of file
export default routes
......@@ -4,6 +4,8 @@ import user from './modules/user'
import permission from './modules/permission'
import app from './modules/app'
import getters from './getters'
import school from './modules/school'
Vue.use(Vuex)
// export default function( /* { ssrContext } */ ) {
......@@ -25,7 +27,8 @@ const store = new Vuex.Store({
modules: {
user,
permission,
app
app,
school
},
getters,
strict: process.env.DEV
......
import { getschoolpage,testapi } from "../../api/school/school";
import { addAuth, removeAuth } from "../../utils/auth";
import Lockr from "lockr";
const school = {
state: {
userInfo: null, // 用户信息
//TODO 用户权限
allAuth: ['/home'],
},
mutations: {
SET_USERINFO: (state, userInfo) => {
state.userInfo = userInfo;
},
SET_ALLAUTH: (state, allAuth) => {
state.allAuth = allAuth
},
//TODO 用户权限
},
actions: {
// 获取权限
GetSchoolPage({ commit },data) {
return new Promise((resolve, reject) => {
getschoolpage(data)
.then(res => {
resolve(res);
})
.catch(error => {
console.log(error)
reject(error);
});
});
},
//测试Api
TestWebApi({commit},postData)
{
return new Promise((resolve, reject) => {
testapi(postData.cmdStr,postData.data)
.then(res => {
resolve(res);
})
.catch(error => {
console.log(error)
reject(error);
});
});
},
}
};
export default school;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment