From 13ae291aafed968248fe0dac58387627593ee074 Mon Sep 17 00:00:00 2001 From: lihuilin Date: Mon, 21 Jul 2025 18:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=AE=E8=B7=A8=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activitylink/.env.development | 1 + activitylink/src/api/manage/gift.js | 2 +- activitylink/src/views/homePage.vue | 39 +- .../src/views/zhongchou/activity/index.vue | 66 +++- activitylink/src/views/zhongchou/gift/index.vue | 2 +- activitylink/src/views/zhongchou/level/index.vue | 436 ++++++++++----------- activitylink/src/views/zhongchou/winning/index.vue | 10 + 7 files changed, 304 insertions(+), 252 deletions(-) diff --git a/activitylink/.env.development b/activitylink/.env.development index 98584d1..40cb689 100644 --- a/activitylink/.env.development +++ b/activitylink/.env.development @@ -3,3 +3,4 @@ VITE_OUTPUT_DIR = 'dev' VITE_PUBLIC_PATH = '/testBack/' VITE_APP_BASE_API = 'https://dbqb.nfdxy.net/devLotApi/' VITE_USE_MOCK = true +VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload \ No newline at end of file diff --git a/activitylink/src/api/manage/gift.js b/activitylink/src/api/manage/gift.js index 9f86622..b8ec0e1 100644 --- a/activitylink/src/api/manage/gift.js +++ b/activitylink/src/api/manage/gift.js @@ -17,7 +17,7 @@ export function deletePrize(id) { return request({ url: '/admin/prize/delete', method: 'post', - params: { pageNum,pageSize } + params: { id } }) } //奖品分页查询 diff --git a/activitylink/src/views/homePage.vue b/activitylink/src/views/homePage.vue index a03962c..636954c 100644 --- a/activitylink/src/views/homePage.vue +++ b/activitylink/src/views/homePage.vue @@ -26,27 +26,26 @@ const username = ref(""); const password = ref(""); // username.value=='90038794' && password.value=='697522'写死的账号密码 const loginHandler = async () => { - // try { - // const response = await adminlogin({ - // username: username.value, - // password: password.value - // }) - router.push('/zhongchou/mainimg') - // 假设后端返回 code == 200 表示成功 -// if (response.code ) { -// const token = response.code + try { + const response = await adminlogin({ + username: username.value, + password: password.value + }) -// // ✅ 保存 token 到 localStorage -// localStorage.setItem('token', token) -// ElMessage.success('登录成功,欢迎您使用本系统') -// router.push('/zhongchou/mainimg') -// } else { -// ElMessage.error(response.message || '登录失败,请检查用户名或密码') -// } - // } catch (error) { - // ElMessage.error('登录失败,请稍后再试') - // console.error('登录错误:', error) - // } + if (response.code===200 ) { + const token = response.code + +// ✅ 保存 token 到 localStorage + localStorage.setItem('token', token) + ElMessage.success('登录成功,欢迎您使用本系统') + router.push('/zhongchou/mainimg') + } else { + ElMessage.error(response.message || '登录失败,请检查用户名或密码') + } + } catch (error) { + ElMessage.error('登录失败,请稍后再试') + console.error('登录错误:', error) + } } \ No newline at end of file diff --git a/activitylink/src/views/zhongchou/winning/index.vue b/activitylink/src/views/zhongchou/winning/index.vue index 4ef7a02..fc985fb 100644 --- a/activitylink/src/views/zhongchou/winning/index.vue +++ b/activitylink/src/views/zhongchou/winning/index.vue @@ -106,6 +106,16 @@ const fetchWinLevelList = async () => { } } +const handleSizeChange = (val) => { + pagination.value.pageSize = val + pagination.value.pageNum = 1 + getPrizes() +} + +const handleCurrentChange = (val) => { + pagination.value.pageNum = val + getPrizes() +} // 获取中奖列表 const fetchWinList = async () => { try {