zhiyuan007 1 tahun lalu
induk
melakukan
4f4cebda2b
4 mengubah file dengan 36 tambahan dan 5 penghapusan
  1. 2 2
      .env.production
  2. 2 1
      src/service/login.js
  3. 29 0
      src/views/main/login/LoginRight.vue
  4. 3 2
      vite.config.js

+ 2 - 2
.env.production

@@ -1,2 +1,2 @@
-VITE_BASE_API='http://10.90.7.241:9443/data-business-prod/'
-VITE_OPEN_URL='http://10.90.7.241:9443/data-business-prod/'
+VITE_BASE_API='https://10.90.11.49:2002/data-business-prod/'
+VITE_OPEN_URL='https://10.90.11.49:2002/data-business-prod/'

+ 2 - 1
src/service/login.js

@@ -26,7 +26,8 @@ export function editLoginState(usercode,userkeycode){
             "CODE":usercode,
             "USERKEYCODE":userkeycode,
             "LOGIN_LOCK":"1",
-            "LOGIN_TYPE":"1"
+            "LOGIN_TYPE":"1",
+            "LOGIN_COUNT":"0",
         }
     })
 }

+ 29 - 0
src/views/main/login/LoginRight.vue

@@ -117,6 +117,35 @@ export default {
           var result = data.msg;
 
           var rows = result[0].Rows;
+          if(!rows[0]){
+            showMessage({
+              type:'error',
+              message:'用户名或密码错误'
+            })
+            this.draw()
+            return
+          }
+          var time2 = new Date(rows[0]["GETTIME"]).getTime() - new Date(rows[0]["LAST_TIME"]).getTime();
+          if (time2<=15*60*1000){
+            if (+rows[0].LOGIN_COUNT>0){
+              if (+rows[0].LOGIN_COUNT<5){
+                showMessage({
+                  type:'error',
+                  message:`密码错误${+rows[0].LOGIN_COUNT}次,5次将锁定账号`
+                })
+                this.draw()
+              }else {
+                showMessage({
+                  type:'error',
+                  message:'账号已锁定,请15分钟后重试'
+                })
+              }
+              this.draw()
+              return;
+            }
+          }
+
+
           if (result.length == 0) {
             showMessage({
               type:'error',

+ 3 - 2
vite.config.js

@@ -16,8 +16,8 @@ export default defineConfig({
       // 代理所有 /api 的请求,该求情将被代理到 target 中
       '/api': {
         // 代理请求之后的请求地址(你的真实接口地址)
-        target: 'http://10.90.7.241:9443/data-business-prod/',
-        secure: true,
+        target: 'https://10.90.11.49:2002/data-business-prod/',
+        secure: false,
         ws: true,
         // 跨域
         changeOrigin: true,
@@ -25,6 +25,7 @@ export default defineConfig({
       }
     },
   },
+  https:true,
   plugins: [vue(), AutoImport({
     resolvers: [ElementPlusResolver()],
   }),