51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
import request from "@/utils/request.js"
|
|
|
|
export function login(params) {
|
|
return request.post('/member/auth/miniapp/login', params)
|
|
}
|
|
|
|
export function logout() {
|
|
return request.post('/member/auth/logout')
|
|
}
|
|
|
|
export function getQRCode(options = { cache: true, cacheTime: 5 * 60 * 1000 }) {
|
|
return request.get('/checkIn/qrcode', {}, options)
|
|
}
|
|
|
|
export function checkIn(params) {
|
|
return request.post('/checkIn/scan', params)
|
|
}
|
|
|
|
export function getUserInfo(options = { cache: true, cacheTime: 30 * 60 * 1000 }) {
|
|
return request.get('/member/info', {}, options)
|
|
}
|
|
|
|
export function updateUserInfo(params) {
|
|
return request.put('/member/info', params)
|
|
}
|
|
|
|
export function getRecommendCourses(options = { cache: true, cacheTime: 10 * 60 * 1000 }) {
|
|
return request.get('/course/recommend', {}, options)
|
|
}
|
|
|
|
export function getCourseDetail(id, options = { cache: true, cacheTime: 15 * 60 * 1000 }) {
|
|
return request.get(`/course/${id}`, {}, options)
|
|
}
|
|
|
|
export function getGroupCoursePage(params = {}, options = { cache: true, cacheTime: 5 * 60 * 1000 }) {
|
|
const { page = 0, size = 10, sort = 'id', order = 'asc', keyword } = params
|
|
return request.post('/groupCourse/page', { page, size, sort, order, keyword }, options)
|
|
}
|
|
|
|
export default {
|
|
login,
|
|
logout,
|
|
getQRCode,
|
|
checkIn,
|
|
getUserInfo,
|
|
updateUserInfo,
|
|
getRecommendCourses,
|
|
getCourseDetail,
|
|
getGroupCoursePage
|
|
}
|