Ver código fonte

修改登录逻辑

yangg 2 meses atrás
pai
commit
8348af903f

+ 20 - 1
pages/login/login.vue

@@ -38,7 +38,26 @@ export default {
         return;
       }
       
-      this.getWxLoginCode();
+      // 添加确认对话框
+      uni.showModal({
+        title: '微信登录',
+        content: '是否使用微信账号登录?',
+        confirmText: '确认登录',
+        cancelText: '取消',
+        success: (res) => {
+          if (res.confirm) {
+            // 用户点击确认,继续登录流程
+            this.getWxLoginCode();
+          } else {
+            // 用户点击取消,不执行登录
+            console.log('用户取消了登录');
+            uni.showToast({
+              title: '已取消登录',
+              icon: 'none'
+            });
+          }
+        }
+      });
     },
     
     getWxLoginCode() {

+ 17 - 1
unpackage/dist/dev/mp-weixin/pages/login/login.js

@@ -21,7 +21,23 @@ const _sfc_main = {
         });
         return;
       }
-      this.getWxLoginCode();
+      common_vendor.index.showModal({
+        title: "微信登录",
+        content: "是否使用微信账号登录?",
+        confirmText: "确认登录",
+        cancelText: "取消",
+        success: (res) => {
+          if (res.confirm) {
+            this.getWxLoginCode();
+          } else {
+            console.log("用户取消了登录");
+            common_vendor.index.showToast({
+              title: "已取消登录",
+              icon: "none"
+            });
+          }
+        }
+      });
     },
     getWxLoginCode() {
       common_vendor.index.showLoading({ title: "登录中..." });

+ 1 - 1
unpackage/dist/dev/mp-weixin/project.config.json

@@ -8,7 +8,7 @@
     "urlCheck": false,
     "es6": true,
     "postcss": false,
-    "minified": false,
+    "minified": true,
     "newFeature": true,
     "bigPackageSizeSupport": true,
     "babelSetting": {