fix: 抽奖页面查看不需要登录,仅报名需要登录
This commit is contained in:
@@ -36,13 +36,6 @@ function formatDate(date: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fetchLotteries() {
|
async function fetchLotteries() {
|
||||||
// 检查是否登录
|
|
||||||
const token = localStorage.getItem('token')
|
|
||||||
if (!token) {
|
|
||||||
loading.value = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const res: any = await lotteryApi.list()
|
const res: any = await lotteryApi.list()
|
||||||
|
|||||||
@@ -46,13 +46,6 @@ function formatDate(date: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 检查是否登录
|
|
||||||
const token = localStorage.getItem('token')
|
|
||||||
if (!token) {
|
|
||||||
ElMessage.warning('请先登录后再查看抽奖详情')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res: any = await lotteryApi.getById(Number(route.params.id))
|
const res: any = await lotteryApi.getById(Number(route.params.id))
|
||||||
lottery.value = res.data
|
lottery.value = res.data
|
||||||
|
|||||||
Reference in New Issue
Block a user