101 lines
2.6 KiB
JavaScript
101 lines
2.6 KiB
JavaScript
import $http from '@/utils/httpRequest.js'
|
|
|
|
export const local_admin = {
|
|
/**
|
|
* 登录
|
|
* @param {object} params LoginParam
|
|
* @param {number} params.type
|
|
* @param {string} params.role
|
|
* @param {string} params.username
|
|
* @param {string} params.password
|
|
* @param {string} params.mobile
|
|
* @param {string} params.code
|
|
* @returns
|
|
*/
|
|
loginByAccount: (params) => {
|
|
return $http.post(`/auth/login`, {
|
|
...params,
|
|
type: 1
|
|
})
|
|
},
|
|
loginByMobile: (params) => {
|
|
return $http.post(`/merchant-api/auth/sms/login`, {
|
|
...params,
|
|
type: 2
|
|
})
|
|
},
|
|
getYZM(mobile) {
|
|
return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`);
|
|
},
|
|
getInfo() {
|
|
return $http.get(`/merchant-api/auth/info`);
|
|
},
|
|
//获取教育局列表
|
|
getEducationBureauList() {
|
|
return $http.get(`/org/area_edu`);
|
|
},
|
|
//获取学校分页
|
|
getSchoolPage: (data) => {
|
|
return $http.request({
|
|
url: `/school/page`,
|
|
method: 'get',
|
|
params: data
|
|
})
|
|
},
|
|
//添加学校
|
|
addSchool: (data) => {
|
|
return $http.post(`/school/add`, data);
|
|
},
|
|
//获取数据字典
|
|
getDictionary: (categoryId) => {
|
|
return $http.get(`/common/dict?categoryId=${categoryId}`);
|
|
},
|
|
//获取省市区
|
|
getArea: () => {
|
|
return $http.get(`/common/pca`);
|
|
},
|
|
//更新年级
|
|
updateGrade: (gradeId,data) => {
|
|
return $http.put(`/grade/update?gradeId=${gradeId}`, data);
|
|
},
|
|
//添加年级
|
|
addGrade: (data) => {
|
|
return $http.post(`/grade/add`, data);
|
|
},
|
|
//获取年级列表
|
|
getGradeList: () => {
|
|
return $http.get(`/grade/list`);
|
|
},
|
|
//删除年级
|
|
removeGrade: (gradeId) => {
|
|
return $http.delete(`/grade/delete?gradeId=${gradeId}`)
|
|
},
|
|
//添加班级
|
|
addClass:(data)=>{
|
|
return $http.post(`/clazz/add`,data);
|
|
},
|
|
//编辑班级
|
|
updateClass:(data)=>{
|
|
return $http.post(`/clazz/update?clazzId=${data.clazzId}`,data)
|
|
},
|
|
//获取班级列表
|
|
getClassList:()=>{
|
|
return $http.get(`/clazz/list`);
|
|
},
|
|
//删除班级
|
|
removeClass:(clazzId)=>{
|
|
return $http.delete(`/clazz/delete?clazzId=${clazzId}`)
|
|
},
|
|
//添加教师
|
|
addTeacher:(data)=>{
|
|
return $http.post(`/teacher/add`,data);
|
|
},
|
|
//获取教师分页
|
|
getTeacherPage:(data)=>{
|
|
return $http.request({
|
|
url:'/teacher/page',
|
|
method:'get',
|
|
params:data
|
|
})
|
|
}
|
|
} |