diff --git a/src/api/task.js b/src/api/task.js new file mode 100644 index 0000000..3905eab --- /dev/null +++ b/src/api/task.js @@ -0,0 +1,37 @@ +import { get, post } from '../utils/http.js' + +// 每日签到奖励列表. +export const apiGetLoginRewards = async (activityType) => { + try { + const response = await get(`/task/check/in/list/award?activityType=${activityType}`) + return response + } catch (error) { + console.error('Failed to get login rewards:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 今天是否已签到. +export const apiGetTodayLoginStatus = async (dailyKey) => { + try { + const response = await get(`/task/check/in/today?dailyKey=${dailyKey}`) + return response + } catch (error) { + console.error('Failed to get today login info:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 打卡-领取奖励. +export const postReceiveLoginReward = async (data) => { + try { + const response = await post(`/task/check/in/receive`, data) + return response + } catch (error) { + console.error('Failed to post receive login reward:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} diff --git a/src/router/index.js b/src/router/index.js index 7140d23..29f94ea 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -371,6 +371,12 @@ const router = createRouter({ }, // 限时活动 + { + path: '/login-reward', + name: 'login-reward', + component: () => import('../views/Activities/LoginReward/index.vue'), + meta: { requiresAuth: true }, + }, //2026年xxxxxx结束 { path: '/lucky-dollars-season3', name: 'lucky-dollars-season3', diff --git a/src/utils/permissionManager.js b/src/utils/permissionManager.js index 2a0caa2..974d5fe 100644 --- a/src/utils/permissionManager.js +++ b/src/utils/permissionManager.js @@ -58,9 +58,10 @@ const ACTIVITIES = [ INVITATION_PAGES.INVITE_USER, //邀请新用户(邀请码) '/recharge-reward', //充值奖励 - '/lucky-dollars-season3', //水果游戏打榜 - '/jack-pot', //水果游戏打榜 - '/new-year', //新年抽奖 + '/login-reward', // 登录奖励 + '/lucky-dollars-season3', // 水果游戏打榜 + '/jack-pot', // 水果游戏打榜 + '/new-year', // 新年抽奖 ] // 🎯 核心改变:基于身份的权限配置 diff --git a/src/utils/routeGuard.js b/src/utils/routeGuard.js index 27e89f3..e81c3b4 100644 --- a/src/utils/routeGuard.js +++ b/src/utils/routeGuard.js @@ -409,6 +409,7 @@ class RouteGuard { '/invitation-to-register', //邀请新用户注册页面 '/recharge-reward', //充值奖励 + '/login-reward', // 登录奖励 '/lucky-dollars-season3', //水果游戏打榜 '/jack-pot', //水果游戏打榜 '/new-year', //新年抽奖 diff --git a/src/views/Activities/LoginReward/index.vue b/src/views/Activities/LoginReward/index.vue new file mode 100644 index 0000000..d1cf49f --- /dev/null +++ b/src/views/Activities/LoginReward/index.vue @@ -0,0 +1,359 @@ + + + + +