From c97af50822ba410b660b9e3f3f2bd9e06b1bc4dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cgrape=E2=80=9D?= <18746553572@163.com>
Date: Tue, 16 Aug 2022 15:43:12 +0800
Subject: [PATCH] 2022/8/16

---
 package.json                             |  20 +--
 src/constants/api/login/login-mgt.api.ts |   4 +-
 src/public/ts/SMEncryt.ts                |   4 +-
 src/services/api.service.ts              |  10 +-
 src/views/authentication/LoginView.vue   |   3 +-
 src/views/login/ForgetPassView.vue       | 154 +++++++++++++++--------
 src/views/login/Register.vue             |  24 ++--
 7 files changed, 144 insertions(+), 75 deletions(-)

diff --git a/package.json b/package.json
index 50d6b92..3900791 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
     "better-scroll": "^2.4.2",
     "core-js": "^3.6.5",
     "echarts": "^5.3.0",
+    "element-ui": "^2.4.6",
     "express": "^4.17.1",
     "mathjs": "^9.4.4",
     "sm-crypto": "^0.3.7",
@@ -28,27 +29,26 @@
     "vant": "^2.12.29",
     "vconsole": "^3.12.0",
     "vue": "^2.6.11",
-    "vue-awesome-swiper": "^4.1.1",
+    "vue-awesome-swiper": "^5.0.1",
     "vue-axios": "^3.2.5",
-    "vue-baidu-map": "^0.21.22",
+    "vue-baidu-map": "^0.18.7",
     "vue-class-component": "^7.2.3",
     "vue-esign": "^1.0.5",
     "vue-jsonp": "^2.0.0",
     "vue-property-decorator": "^9.1.2",
     "vue-qr": "^3.2.4",
     "vue-router": "^3.2.0",
-    "vuex": "^3.5.1",
-    "element-ui": "^2.4.6"
+    "vuex": "^3.5.1"
   },
   "devDependencies": {
     "@typescript-eslint/eslint-plugin": "^4.18.0",
     "@typescript-eslint/parser": "^4.18.0",
-    "@vue/cli-plugin-babel": "~4.5.0",
-    "@vue/cli-plugin-eslint": "~4.5.0",
-    "@vue/cli-plugin-router": "~4.5.0",
-    "@vue/cli-plugin-typescript": "~4.5.0",
-    "@vue/cli-plugin-vuex": "~4.3.0",
-    "@vue/cli-service": "~4.5.0",
+    "@vue/cli-plugin-babel": "^5.0.8",
+    "@vue/cli-plugin-eslint": "^5.0.8",
+    "@vue/cli-plugin-router": "^5.0.8",
+    "@vue/cli-plugin-typescript": "^5.0.8",
+    "@vue/cli-plugin-vuex": "^5.0.8",
+    "@vue/cli-service": "^5.0.8",
     "@vue/eslint-config-prettier": "^6.0.0",
     "@vue/eslint-config-typescript": "^7.0.0",
     "babel-plugin-import": "^1.13.3",
diff --git a/src/constants/api/login/login-mgt.api.ts b/src/constants/api/login/login-mgt.api.ts
index 395f34e..d8a549f 100644
--- a/src/constants/api/login/login-mgt.api.ts
+++ b/src/constants/api/login/login-mgt.api.ts
@@ -8,8 +8,8 @@
  */
 import { MethodType } from "@/constants/enum/general/method-type.enum";
 import { HeaderType } from "@/constants/enum/general/header-type.enum";
-
-const prefix = "http://10.0.0.118:9130/ms-system/api/v1/sysCustInfo/permit_endpoint"
+// http://10.0.1.9:9130
+const prefix = "http://localhost:9135//ms-system/api/v1/sysCustInfo/permit_endpoint"
                                                         
 const loginApi = {
   updatePicCode: {
diff --git a/src/public/ts/SMEncryt.ts b/src/public/ts/SMEncryt.ts
index 3eb0e52..cff30a1 100644
--- a/src/public/ts/SMEncryt.ts
+++ b/src/public/ts/SMEncryt.ts
@@ -11,7 +11,6 @@ export default {
    * @return {Object} jsonstr 返回加密后的json数据
    */
   encryptData(jsonstr: any) {
-    debugger
     let encryData = {};
     try {
       // SM2 加密秘钥
@@ -57,11 +56,10 @@ export default {
       jsonData = JSON.parse(jsonData);
     }
     try {
-      debugger
       let sm2 = require('sm-crypto').sm2,
         sm3 = require('sm-crypto').sm3,
         sm4 = require('sm-crypto').sm4,
-        privateKey = '0494FEF4897CF4E9C9CB994B66B29E9B3EAF2C5C59EBEDB703B0F980199CEA7BDBF177AB3E65A17F3E96227977C55423929975CE535B715AC21E0AB23B9858AB4F', //SM2公钥
+        privateKey = '7666A8CA12A27CF6C440A1CFECB4B1BB7055F2FB3435E957EB35142FAB881EFB', //SM2公钥
         sm4Key = '',
         orSm4Key = jsonData.sm4key;
       orSm4Key = orSm4Key.substr(2, orSm4Key.length - 2);
diff --git a/src/services/api.service.ts b/src/services/api.service.ts
index 266e155..501668f 100644
--- a/src/services/api.service.ts
+++ b/src/services/api.service.ts
@@ -32,7 +32,8 @@ class ApiService {
     Vue.axios.interceptors.request.use(
       config => {
         config.headers['Access-Control-Allow-Origin'] = '*';
-        config.headers['MCEP'] = 'MCEP';
+        //开启
+        // config.headers['MCEP'] = 'MCEP';
         if(!config.headers['Content-Type']){
           config.headers['Content-Type'] = 'application/json; charset=utf-8';
         }
@@ -175,7 +176,12 @@ class ApiService {
 
     path = query != null ? this.urlQueryConvert(path, query) : path;
     console.log("服务调用--" + path);
-    return Vue.axios.post(`${path}`, params, requestConfig).then(this.createBusCodeHandler(query)).catch(this.createErrorHandler())
+    return Vue.axios.post(`${path}`, params, requestConfig).then(res=>{
+      //TODO
+      console.log(res);
+      
+      return res.data
+    });
   }
   /**
    * POST请求 文件上传
diff --git a/src/views/authentication/LoginView.vue b/src/views/authentication/LoginView.vue
index 815a533..4375e69 100644
--- a/src/views/authentication/LoginView.vue
+++ b/src/views/authentication/LoginView.vue
@@ -105,7 +105,6 @@ export default class LoginView extends Vue {
   //获取图形验证码
   _updatePicCode() {
     //请求图形验证码
-     debugger
     apiService.general(loginApi.updatePicCode, undefined, undefined, undefined).then((response: RestfulResponse) => {
       //console.log(response);
      
@@ -153,7 +152,7 @@ export default class LoginView extends Vue {
       //图形验证码
       imageVerifyKey: this.imageSrcValue, 
       //渠道
-      loginType: "3",
+      loginType: "2",
       //手机验证码
       messCode: this.sms,
       //密码
diff --git a/src/views/login/ForgetPassView.vue b/src/views/login/ForgetPassView.vue
index 70db62b..c3c4837 100644
--- a/src/views/login/ForgetPassView.vue
+++ b/src/views/login/ForgetPassView.vue
@@ -13,46 +13,99 @@
     </div>
 
     <div class="login">
-      <van-row  style="padding: 10% 0%;">
+      <van-row style="padding: 10% 0%">
         <van-col span="24">
-          <p class="polog"><span class="font-size-18-dhc" style="padding: 2% 0%;font-weight: 600;">密码重置</span> </p>
+          <p class="polog">
+            <span
+              class="font-size-18-dhc"
+              style="padding: 2% 0%; font-weight: 600"
+              >密码重置</span
+            >
+          </p>
         </van-col>
-        <van-col span="24"><span class="font-size-12-dhc" style="font-weight: 400; font-family: 'Arial Normal', 'Arial';
-}">请使用注册手机号进行密码重置</span></van-col>
+        <van-col span="24"
+          ><span
+            class="font-size-12-dhc"
+            style="font-weight: 400; font-family: 'Arial Normal', 'Arial';
+}"
+            >请使用注册手机号进行密码重置</span
+          ></van-col
+        >
       </van-row>
       <van-form @submit="onSubmit">
         <div class="logindiv">
           <span class="sopan">手机号码</span>
-          <van-field v-model="phone" label="+86   |" :border="true" placeholder="请输入手机号" />
+          <van-field
+            v-model="phone"
+            label="+86   |"
+            :border="true"
+            placeholder="请输入手机号"
+          />
           <van-divider />
         </div>
 
         <div class="logindiv">
           <span class="sopan">新密码</span>
-          <van-field v-model="newpassword" type="password" center clearable placeholder="请填写新密码" />
+          <van-field
+            v-model="newpassword"
+            :type="passwordType"
+            clickable
+            center
+            clearable
+            placeholder="请填写新密码"
+            
+          >
+            <template slot="right-icon">
+              <span class="solts" @click="switchPasswordType">
+                <van-icon name="eye" v-if="passwordType === 'password'" />
+                <van-icon name="closed-eye" v-else />
+              </span>
+            </template>
+          </van-field>
           <!-- <van-divider /> -->
         </div>
-       <div class="logindiv">
+        <div class="logindiv">
           <span class="sopan">新密码</span>
-          <van-field v-model="restpassword" type="password" center clearable placeholder="请确认新密码" />
+          <van-field
+            v-model="restpassword"
+            :type="password"
+            clickable
+            center
+            clearable
+            placeholder="请确认新密码"
+            
+          >
+          <template slot="right-icon">
+              <span class="solts" @click="switchPasswordType">
+                <van-icon name="eye" v-if="passwordType === 'password'" />
+                <van-icon name="closed-eye" v-else />
+              </span>
+            </template>
+          </van-field>
           <!-- <van-divider /> -->
         </div>
         <span class="sopan">短信验证码</span>
         <div>
-
-          <van-row >
+          <van-row>
             <van-col span="16">
-              <van-field v-model="sms" center clearable placeholder="请输入短信验证码">
+              <van-field
+                v-model="sms"
+                center
+                clearable
+                placeholder="请输入短信验证码"
+              >
                 <!-- <van-divider /> -->
               </van-field>
             </van-col>
-            <van-col span="8"><a href="#" @click="getPhonePost()">获取短信验证码</a></van-col>
+            <van-col span="8"
+              ><a href="#" @click="getPhonePost()">获取短信验证码</a></van-col
+            >
           </van-row>
-
-
         </div>
-        <div style="margin: 16px;">
-          <van-button square block type="info" native-type="submit">登录</van-button>
+        <div style="margin: 16px">
+          <van-button square block type="info" native-type="submit"
+            >登录</van-button
+          >
         </div>
       </van-form>
     </div>
@@ -60,34 +113,39 @@
 </template>
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
-import { Image as VanImage, Toast } from 'vant';
+import { Image as VanImage, Toast } from "vant";
 import apiService from "@/services/api.service";
 import { Code } from "@/constants/enum/general/code.enum";
 import { RestfulResponse } from "@/model/domain/RestfulResponse";
 import commonApi from "@/constants/api/login/common.api";
 
-
 @Component({
   name: "ForgetPassView",
   [VanImage.name]: VanImage,
 })
 export default class ForgetPassView extends Vue {
+  password = "password";
+  passwordType="password"
   getCmstotal = "获取短信验证码";
-  tatleName = "密码重置"
-  phone: string = "" //电话
-  newpassword: string = ""//密码
-  restpassword:string = ""//密码
-  imageSrc: string = ""//图形
-  sms: string = ""//短信
-  timer: any = "";//定时器
-  time: number = 60;//计数
-  radio: string = "0"
+  tatleName = "密码重置";
+  phone: string = ""; //电话
+  newpassword: string = ""; //密码
+  restpassword: string = ""; //密码
+  imageSrc: string = ""; //图形
+  sms: string = ""; //短信
+  timer: any = ""; //定时器
+  time: number = 60; //计数
+  radio: string = "0";
   //获取图形验证码
   _updatePicCode() {
     //请求图形验证码
-    this.imageSrc = 'http://localhost:8080/users/sendPicCode?=' + Math.random();
+    this.imageSrc = "http://localhost:8080/users/sendPicCode?=" + Math.random();
     //this.imageSrc = 'D:\GitClone\H5\mcep-h5\src\assets\images\ZYXTimg.png' + Math.random()
   }
+  //方法
+   switchPasswordType() {
+      this.passwordType = this.passwordType === 'password' ? 'text' : 'password'
+    }
   //计时器
   changeCmstotal() {
     this.getCmstotal = this.time + "s重发验证码";
@@ -95,31 +153,31 @@ export default class ForgetPassView extends Vue {
       this.time--;
       this.getCmstotal = this.time + "s重发验证码";
       if (this.time < 0) {
-        clearInterval(this.time)
+        clearInterval(this.time);
         this.getCmstotal = "获取短信验证码";
       }
-    }, 1000)
-
+    }, 1000);
   }
-getPhonePost(){
- let param={
-    phoneCode:this.phone
- }
- apiService.general(commonApi.getPicCode,param,undefined,undefined).then((response: RestfulResponse) => {
-       
+  getPhonePost() {
+    let param = {
+      phoneCode: this.phone,
+    };
+    apiService
+      .general(commonApi.getPicCode, param, undefined, undefined)
+      .then((response: RestfulResponse) => {
         if (response.code == Code.SUCCESS.code) {
-          Toast('短信发送成功,5分钟有效');
-          this.changeCmstotal()
-        }else{
-           Toast('短信发送失败,请重试');
+          Toast("短信发送成功,5分钟有效");
+          this.changeCmstotal();
+        } else {
+          Toast("短信发送失败,请重试");
         }
-    })
-}
+      });
+  }
   onSubmit(values: any) {
-    console.log('submit', values);
+    console.log("submit", values);
   }
   created() {
-    this.$nextTick(() => this._updatePicCode())
+    this.$nextTick(() => this._updatePicCode());
   }
 }
 </script>
@@ -147,8 +205,6 @@ getPhonePost(){
   font-kerning: normal;
 }
 
-
-
 .van-col--15 {
   margin-top: 2%;
 }
@@ -157,10 +213,10 @@ getPhonePost(){
   margin-left: 6%;
 }
 
-.forget {}
+.forget {
+}
 
 .sopan {
-
   margin-top: 5px;
   margin-left: 6%;
 }
diff --git a/src/views/login/Register.vue b/src/views/login/Register.vue
index a1de9f3..f77b828 100644
--- a/src/views/login/Register.vue
+++ b/src/views/login/Register.vue
@@ -24,37 +24,46 @@
         <div class="logindiv">
           <span class="sopan">手机号码</span>
           <van-field v-model="phone" label="+86   |" :border="true" placeholder="请输入手机号" />
-          <van-divider />
-        <span class="sopan">身份证号</span>
+          <van-divider :style="{margin :0 }"></van-divider>
+        </div>
+
+        <div class="logindiv">
+           <span class="sopan">身份证号</span>
           <van-field v-model="idCard" :border="true" placeholder="请输入身份证号" />
-          <van-divider />
+          <!-- <van-divider /> -->
+          <van-divider :style="{margin :0 }"></van-divider>
         </div>
-        <span class="sopan">短信验证码</span>
-        <div>
 
+        
+        <div class="logindiv"><span  class="sopan">短信验证码</span>
           <van-row >
             <van-col span="16">
               <van-field v-model="sms" center clearable placeholder="请输入短信验证码">
                 <!-- <van-divider /> -->
               </van-field>
             </van-col>
-            <van-col span="8"><a @click="getPhonePost()">{{getCmstotal}}</a></van-col>
+            <van-col  span="8"><span style="color:blue" @click="getPhonePost()">{{getCmstotal}}</span></van-col>
+            
           </van-row>
+           <van-divider :style="{margin :0 }"></van-divider>
+         </div>
 
           <div class="logindiv">
             <span class="sopan">设置密码</span>
             <van-field v-model="password" type="password" center clearable placeholder="请填写新密码" />
             <!-- <van-divider /> -->
+              <van-divider :style="{margin :0 }"></van-divider>
           </div>
           <div class="logindiv">
             <span class="sopan">确认密码</span>
             <van-field v-model="restpassword" type="password" center clearable placeholder="请确认新密码" />
             <!-- <van-divider /> -->
+              <van-divider :style="{margin :0 }"></van-divider>
           </div>
 
 
 
-        </div>
+       
         <div style="margin: 16px;">
           <van-button square block type="info" native-type="submit" @click="registSystem()">注册</van-button>
         </div>
@@ -168,6 +177,7 @@ getPhonePost(){
 
 .logindiv {
   line-height: 20px;
+  margin-bottom: 10px;
 }
 
 .van-button {
-- 
2.22.0