|
|
//api集合
|
|
|
let apiApp = {
|
|
|
parameterShow: '/api/admin/parameter/show',
|
|
|
schoolList: '/api/mobile/school/index',
|
|
|
schoolDetail: '/api/mobile/school/detail',
|
|
|
area: '/api/mobile/school/area',
|
|
|
score: '/api/mobile/school/score',
|
|
|
middleSchoolIndicatorList: '/api/mobile/school/middle-school-indicator',
|
|
|
middleSchoolIndicatorDetail: '/api/mobile/school/middle-school-indicator-detail',
|
|
|
independentRecruitmentsSubmit: '/api/mobile/batch/independent-recruitments-submit',
|
|
|
independentRecruitmentsIndex: '/api/mobile/batch/independent-recruitment-index',
|
|
|
independentRecruitmentsDetail: '/api/mobile/batch/independent-recruitment-detail',
|
|
|
batchIndex: '/api/mobile/batch/index',
|
|
|
batchDetail: '/api/mobile/batch/detail',
|
|
|
batchSubmit: '/api/mobile/batch/user-submit',
|
|
|
batchData: '/api/mobile/user/batch-data',
|
|
|
batchDataDetail: '/api/mobile/user/batch-data-detail',
|
|
|
specialtyList: '/api/mobile/school/specialty',
|
|
|
banners: '/api/mobile/school/banner',
|
|
|
recommendForm: '/api/mobile/batch/recommend-forms-submit'
|
|
|
}
|
|
|
const apiUser = {
|
|
|
appletLogin: '/api/mobile/user/applet-login',
|
|
|
updateUser: '/api/mobile/user/update-user',
|
|
|
getUserInfo: '/api/mobile/user/get-user-info',
|
|
|
mobile: '/api/mobile/user/mobile',
|
|
|
config: '/api/mobile/user/config',
|
|
|
bindMobile: '/api/mobile/user/bind-mobile',
|
|
|
sendSms: '/api/mobile/user/send-sms'
|
|
|
}
|
|
|
|
|
|
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作
|
|
|
const install = (Vue, vm) => {
|
|
|
|
|
|
//api方法
|
|
|
const appletLogin = (params = {}) => vm.$u.get(apiUser.appletLogin, params)
|
|
|
const updateUser = (params = {}) => vm.$u.post(apiUser.updateUser, params)
|
|
|
const getUserInfo = (params = {}) => vm.$u.get(apiUser.getUserInfo, params)
|
|
|
const mobile = (params = {}) => vm.$u.get(apiUser.mobile, params)
|
|
|
const config = (params = {}) => vm.$u.get(apiUser.config, params)
|
|
|
const bindMobile = (params = {}) => vm.$u.post(apiUser.bindMobile, params)
|
|
|
const sendSms = (params = {}) => vm.$u.get(apiUser.sendSms, params)
|
|
|
//
|
|
|
|
|
|
const parameterShow = (params = {}) => vm.$u.get(apiApp.parameterShow, params)
|
|
|
const schoolList = (params = {}) => vm.$u.get(apiApp.schoolList, params)
|
|
|
const schoolDetail = (params = {}) => vm.$u.get(apiApp.schoolDetail, params)
|
|
|
const area = (params = {}) => vm.$u.get(apiApp.area, params)
|
|
|
const score = (params = {}) => vm.$u.get(apiApp.score, params)
|
|
|
const middleSchoolIndicatorList = (params = {}) => vm.$u.get(apiApp.middleSchoolIndicatorList, params)
|
|
|
const middleSchoolIndicatorDetail = (params = {}) => vm.$u.get(apiApp.middleSchoolIndicatorDetail, params)
|
|
|
const independentRecruitmentsSubmit = (params = {}) => vm.$u.post(apiApp.independentRecruitmentsSubmit, params)
|
|
|
const independentRecruitmentsIndex = (params = {}) => vm.$u.get(apiApp.independentRecruitmentsIndex, params)
|
|
|
const independentRecruitmentsDetail = (params = {}) => vm.$u.get(apiApp.independentRecruitmentsDetail, params)
|
|
|
const batchIndex = (params = {}) => vm.$u.get(apiApp.batchIndex, params)
|
|
|
const batchDetail = (params = {}) => vm.$u.get(apiApp.batchDetail, params)
|
|
|
const batchSubmit = (params = {}) => vm.$u.post(apiApp.batchSubmit, params)
|
|
|
const batchData = (params = {}) => vm.$u.get(apiApp.batchData, params)
|
|
|
const batchDataDetail = (params = {}) => vm.$u.get(apiApp.batchDataDetail, params)
|
|
|
const specialtyList = (params = {}) => vm.$u.get(apiApp.specialtyList, params)
|
|
|
const banners = (params = {}) => vm.$u.get(apiApp.banners, params)
|
|
|
const recommendForm = (params = {}) => vm.$u.post(apiApp.recommendForm, params)
|
|
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
|
|
vm.$u.api = {
|
|
|
// 用户相关
|
|
|
appletLogin,
|
|
|
updateUser,
|
|
|
getUserInfo,
|
|
|
mobile,
|
|
|
config,
|
|
|
bindMobile,
|
|
|
sendSms,
|
|
|
//
|
|
|
parameterShow,
|
|
|
schoolList,
|
|
|
schoolDetail,
|
|
|
area,
|
|
|
score,
|
|
|
middleSchoolIndicatorList,
|
|
|
middleSchoolIndicatorDetail,
|
|
|
independentRecruitmentsSubmit,
|
|
|
independentRecruitmentsIndex,
|
|
|
independentRecruitmentsDetail,
|
|
|
batchIndex,
|
|
|
batchDetail,
|
|
|
batchSubmit,
|
|
|
batchData,
|
|
|
batchDataDetail,
|
|
|
specialtyList,
|
|
|
banners,
|
|
|
recommendForm,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
install
|
|
|
}
|