liude 1 жил өмнө
parent
commit
f48878caae

+ 21 - 13
package-lock.json

@@ -4169,6 +4169,27 @@
         "whatwg-fetch": "^3.6.2"
       },
       "dependencies": {
+        "@vue/vue-loader-v15": {
+          "version": "npm:vue-loader@15.11.1",
+          "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
+          "integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
+          "dev": true,
+          "requires": {
+            "@vue/component-compiler-utils": "^3.1.0",
+            "hash-sum": "^1.0.2",
+            "loader-utils": "^1.1.0",
+            "vue-hot-reload-api": "^2.3.0",
+            "vue-style-loader": "^4.1.0"
+          },
+          "dependencies": {
+            "hash-sum": {
+              "version": "1.0.2",
+              "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
+              "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
+              "dev": true
+            }
+          }
+        },
         "acorn": {
           "version": "8.8.2",
           "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.8.2.tgz",
@@ -4304,19 +4325,6 @@
       "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.4.tgz",
       "integrity": "sha512-abSgiVRhfjfl3JALR/cSuBl74hGJ3SePgf1mKzodf1eMWLwHZbfEGxT2cNJSsNiw44jEgrO7bNkhchaWA7RwNw=="
     },
-    "@vue/vue-loader-v15": {
-      "version": "npm:vue-loader@15.11.1",
-      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
-      "integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
-      "dev": true,
-      "requires": {
-        "@vue/component-compiler-utils": "^3.1.0",
-        "hash-sum": "^1.0.2",
-        "loader-utils": "^1.1.0",
-        "vue-hot-reload-api": "^2.3.0",
-        "vue-style-loader": "^4.1.0"
-      }
-    },
     "@vue/web-component-wrapper": {
       "version": "1.3.0",
       "resolved": false,

+ 29 - 13
src/pages/login/phoneLogin.vue

@@ -75,6 +75,13 @@ export default {
       show: false,
       tips: '',
       seconds: 10,
+      form: {
+        client_id: 'chelvc_client',
+        client_secret: 'qWBe6jD%GCuPPTkP',
+        grant_type: 'password',
+        password:'313545',
+        username:'18380313545'
+      },
     };
   },
   methods: {
@@ -89,20 +96,29 @@ export default {
     },
 
     login() {
-      if (!this.phone) {
-        uni.showToast({ title: '请输入手机号', icon: 'none' });
-        return;
-      }
-      if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.phone)) {
-        uni.showToast({ title: '请输入正确手机号', icon: 'none' });
-        return;
-      }
-      if (!this.yzm) {
-        uni.showToast({ title: '请输入验证码', icon: 'none' });
-        return;
-      }
+      // if (!this.phone) {
+      //   uni.showToast({ title: '请输入手机号', icon: 'none' });
+      //   return;
+      // }
+      // if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.phone)) {
+      //   uni.showToast({ title: '请输入正确手机号', icon: 'none' });
+      //   return;
+      // }
+      // if (!this.yzm) {
+      //   uni.showToast({ title: '请输入验证码', icon: 'none' });
+      //   return;
+      // }
+      this.$store.dispatch('LoginByWxCode', this.form).then(() => {
+          uni.setStorageSync('tabbar_type', true);
+          this.$Router.pushTab('/pages/client/tabBar/home/index');
+          this.loading = false;
+          uni.$u.toast('登录成功');
+        })
+        .catch(() => {
+          this.loading = false;
+          uni.$u.toast('登录失败');
+        });
       //....此处省略,这里需要调用后台验证一下验证码是否正确,根据您的需求来
-      uni.showToast({ title: '登录成功!', icon: 'none' });
     },
 
     codeChange(text) {

+ 1 - 0
src/utils/request.js

@@ -3,6 +3,7 @@ import {
 } from '@/utils/system';
 import store from '@/store';
 
+// const BASE_URL = 'http://192.168.68.77:11000';
 const BASE_URL = 'https://test.api.chelvc.com';
 const TIME_OUT = 60000;
 const errStatus = {