Commit 0578e03f authored by 黄奎's avatar 黄奎

页面修改

parent 76aaac5b
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>
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