소스 검색

版本号到116
添加忘记密码

wzh 2 년 전
부모
커밋
9e86a9cb33
5개의 변경된 파일60개의 추가작업 그리고 10개의 파일을 삭제
  1. 11 0
      api/login.js
  2. 1 1
      config.js
  3. 5 1
      locale/en.json
  4. 7 7
      manifest.json
  5. 36 1
      pages/login.vue

+ 11 - 0
api/login.js

@@ -17,6 +17,17 @@ export function login(username, password) {
   })
 }
 
+// 忘记密码
+export function forgetPwd(username,locale) {
+  return request({
+    'url': '/forgetPwd?username='+username+"&locale="+locale,
+    headers: {
+      isToken: false
+    },
+    'method': 'post',
+  })
+}
+
 // 注册方法
 export function register(username, password) {
   const data = {

+ 1 - 1
config.js

@@ -2,7 +2,7 @@
 module.exports = {
   //baseUrl: 'https://vue.ruoyi.vip/prod-api',
   baseUrl: 'https://ev.weguyun.com',
-  // baseUrl: 'http://47.110.79.155:5090',
+  // baseUrl: 'http://127.0.0.1:8090',
   socketUrl: 'wss://ev.weguyun.com/websocket',
   imgUrl:'/static/images/new/start',
   // 应用信息

+ 5 - 1
locale/en.json

@@ -164,7 +164,11 @@
     "充电完成": "Charging complete",
     "正在充电": "Charging",
     "找不到设备,请联系管理员": "The device is not found",
-    "配网失败,请检查状态": "Network configuration failed, please check the status."
+    "配网失败,请检查状态": "Network configuration failed, please check the status.",
+    "忘记密码?": "Forget password?",
+    "请输入邮箱": "Please enter your email.",
+    "请查看邮箱进行操作": "Please check your email for instructions on what to do next.",
+    "邮箱不能为空": "The email can not be empty."
 
   },
   "locale.auto": "System",

+ 7 - 7
manifest.json

@@ -2,8 +2,8 @@
     "name" : "WeGoodCharger",
     "appid" : "__UNI__60E8019",
     "description" : "",
-    "versionName" : "1.1.4",
-    "versionCode" : 114,
+    "versionName" : "1.1.6",
+    "versionCode" : 116,
     "transformPx" : false,
     "app-plus" : {
         "usingComponents" : true,
@@ -48,11 +48,11 @@
                 "dSYMs" : false,
                 "idfa" : false,
                 "privacyDescription" : {
-                    "NSLocationWhenInUseUsageDescription" : "To connect the charging cable",
-                    "NSLocationAlwaysUsageDescription" : "To connect the charging cable",
-                    "NSLocationAlwaysAndWhenInUseUsageDescription" : "To connect the charging cable",
-                    "NSBluetoothPeripheralUsageDescription" : "To connect the charging cable",
-                    "NSBluetoothAlwaysUsageDescription" : "To connect the charging cable",
+                    "NSLocationWhenInUseUsageDescription" : "To connect the charging gun for charging the car",
+                    "NSLocationAlwaysUsageDescription" : "To connect the charging gun for charging the car",
+                    "NSLocationAlwaysAndWhenInUseUsageDescription" : "To connect the charging gun for charging the car",
+                    "NSBluetoothPeripheralUsageDescription" : "To connect the charging gun for charging the car",
+                    "NSBluetoothAlwaysUsageDescription" : "To connect the charging gun for charging the car",
                     "NSPhotoLibraryUsageDescription" : "To link the charging gun to your account",
                     "NSPhotoLibraryAddUsageDescription" : "To link the charging gun to your account",
                     "NSCameraUsageDescription" : "To link the charging gun to your account"

+ 36 - 1
pages/login.vue

@@ -53,6 +53,7 @@
         <input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
         <view class="login-code"> <image :src="codeUrl" @click="getCode" class="login-code-img"></image></view  >
       </view> -->
+	  <view class="text-green" style="margin: 5px 0;margin-top:15px;font-size: 12px;;" @click="forgetPwd">{{i18('忘记密码?')}}</view>
       <view class="action-btn" style="z-index: 99;position: relative;">
         <button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">{{ $t('login.tologin') }}</button>
       </view>
@@ -126,7 +127,7 @@
 </template>
 
 <script>
-  import {checkVersion} from '@/api/login'
+  import {checkVersion,forgetPwd} from '@/api/login'
   import {getToken} from "@/utils/auth";
   import i18 from '@/utils/i18.js'
   export default {
@@ -190,6 +191,40 @@
       this.checkLogin();
     },
     methods: {
+      forgetPwd(){
+        let self = this;
+        uni.showModal({
+          editable:true,
+          title: i18('请输入邮箱'),
+          success: function (res) {
+            if (res.confirm) {
+              let mail = res.content;
+              if(!mail){
+                uni.showToast({
+                  title: i18('邮箱不能为空'),
+                  icon: 'none'
+                })
+                return;
+              }
+              forgetPwd(mail,self.locale).then(res=>{
+                    if(res.data){
+                      uni.showToast({
+                        title: i18('请查看邮箱进行操作'),
+                        icon: 'none'
+                      })
+                    }else{
+                      uni.showToast({
+                        title: msg,
+                        icon: 'none'
+                      })
+                    }
+              });
+            } else if (res.cancel) {
+              console.log('用户点击取消');
+            }
+          }
+        });
+      },
       closeCode(){
         this.showCode = false
       },