You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
4.0 KiB

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