Kaynağa Gözat

fix: 许愿页增加登录前置校验,优化退出登录确认弹窗样式

- MakeWishView 进入页面时先检查登录状态,未登录跳转登录页
- UserView 退出确认弹窗增加标题、提示文案和自定义按钮样式

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
tanlie 3 hafta önce
ebeveyn
işleme
8f8e1d8c06

+ 1 - 1
wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/mobile/service/impl/LoginServiceImpl.java

@@ -56,7 +56,7 @@ public class LoginServiceImpl extends AbstractLoginService implements LoginServi
         userInfo.setUsername(user.getNickname());
         userInfo.setWxId(wxId);
         this.setLoginUserInfo(userInfo, token);
-        this.kicKOut(wxId);  // 踢人下线
+        //this.kicKOut(wxId);  // 踢人下线
         this.recordToken(wxId, token);
         // 返回前端
         LoginResp resp = new LoginResp();

+ 4 - 0
wishing-platform/platform-service/platform-service-mobile/src/main/resources/application-dev.yml

@@ -35,3 +35,7 @@ mybatis-plus:
       logic-delete-value: 1
       logic-not-delete-value: 0
 
+
+system:
+  base-url: https://wish.qinys.cn/dgapi/mobile/ext/file/
+  file-directory: /file/

+ 5 - 0
wishing-tree-h5/src/views/MakeWishView.vue

@@ -123,6 +123,11 @@ async function submitWish() {
 }
 
 onMounted(async () => {
+  if (!userStore.isLoggedIn) {
+    showToast('请先登录')
+    router.replace('/login')
+    return
+  }
   const id = Number(route.query.treeId)
   if (id) {
     if (!locationStore.located) {

+ 7 - 1
wishing-tree-h5/src/views/UserView.vue

@@ -66,7 +66,13 @@ const wishCount = ref(0)
 const totalLikes = ref(0)
 
 async function handleLogout() {
-  await showConfirmDialog({ title: '确定退出登录?' })
+  await showConfirmDialog({
+    title: '退出登录',
+    message: '确定要退出当前账号吗?',
+    confirmButtonText: '退出',
+    confirmButtonColor: '#ee0a24',
+    cancelButtonText: '取消',
+  })
   try { await logoutApi() } catch { /* 即使后端调用失败也清除本地状态 */ }
   userStore.logout()
   router.push('/')

BIN
wishing-tree-h5/wish.zip