Przeglądaj źródła

```
fix(config): 更新开发环境API配置

更新.env.development文件中的API基础URL配置,
注释掉高运甲的IP地址配置项

fix(login): 移除路由条件判断并统一页面刷新逻辑

移除LoginDialog组件中针对特定路由路径的条件判断,
改为无条件执行window.location.reload()页面刷新

feat(order): 支付成功后添加返回回调功能

在orderConfirm页面的支付成功处理中添加callback参数,
传入router.back方法以便支付成功后返回上一页
```

zhangningning 4 tygodni temu
rodzic
commit
5f05f1f325

+ 1 - 1
.env.development

@@ -1,6 +1,6 @@
 # 乔功
 VITE_API_BASE_URL=http://192.168.100.134:8080/api
 # 高运甲
-VITE_API_BASE_URL=http://192.168.100.89:8080/api
+# VITE_API_BASE_URL=http://192.168.100.89:8080/api
 
 

+ 8 - 7
src/components/LoginDialog.vue

@@ -537,13 +537,14 @@ const setToken = (token) => {
   appStore.UPDATE_TOKEN(token);
   //获取当前路由 ,路由是/learn-note
   console.log(route.path)
-  if(
-    route.path.startsWith('/learn-note') ||
-    route.path.startsWith('/mibi-shop')
-  ){
-    // 刷新当前页
-    window.location.reload();
-  }
+  // if(
+  //   route.path.startsWith('/learn-note') ||
+  //   route.path.startsWith('/mibi-shop')
+  // ){
+  //   // 刷新当前页
+  //   window.location.reload();
+  // }
+  window.location.reload();
 }
 
 

+ 2 - 2
src/pages/order/orderConfirm.vue

@@ -331,7 +331,7 @@ const startPolling = () => {
       if (res.code == 200 && res.data) {
         // DGTMessage.success('支付成功!');
         // 确认弹框
-        paySuccess({t});
+        paySuccess({t,callback:router.back});
         appStore.USERINFO();
         stopPolling()
       }
@@ -358,7 +358,7 @@ const pay_paypal = () => {
     },
     onApprove: (data, actions) => {
       return actions.order.capture().then((details) => {
-        paySuccess({t});
+        paySuccess({t,callback:router.back});
         stopPolling()
       });
     }