wangmengwei 1 gün önce
ebeveyn
işleme
d46c560c95

+ 8 - 1
ruoyi-ui/src/api/login.js

@@ -57,4 +57,11 @@ export function getCodeImg() {
     method: 'get',
     timeout: 20000
   })
-}
+}
+
+export function checkDynamicPassword(query) {
+  return request({
+    url: '/manage/common/checkDynamicPassword/' + query,
+    method: 'get',
+  })
+}

+ 8 - 0
ruoyi-ui/src/api/system/config.js

@@ -9,6 +9,14 @@ export function listConfig(query) {
   })
 }
 
+export function getDynamicPassword(query) {
+  return request({
+    url: '/manage/common/getDynamicPassword',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询参数详细
 export function getConfig(configId) {
   return request({

BIN
ruoyi-ui/src/assets/images/icon_gjgl_qztc.png


BIN
ruoyi-ui/src/assets/images/icon_spgj_rl_jjr.png


BIN
ruoyi-ui/src/assets/images/pic_htgl_bgs.png


BIN
ruoyi-ui/src/assets/images/pic_htgl_dl_logo_yj.png


BIN
ruoyi-ui/src/assets/images/pic_htgl_srbg_yj.png


+ 62 - 10
ruoyi-ui/src/views/login.vue

@@ -1,6 +1,31 @@
 <template>
-  <div class="login shoue">
-    <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
+
+  <div :class="showe == true? 'login shoue' : 'login-formyi shoue'" >
+    <div class="login-form  login-formba" v-if="!showe" style="height: 330px;">
+          <img src="../assets/images/pic_htgl_dl_logo_yj.png" alt="" style="margin-left: 50%; transform: translateX(-50%);">
+          <h3 class="title" style="margin-bottom: 40px;">登录</h3>
+          <el-input
+            v-model="valhpos"
+            type="password"
+            auto-complete="off"
+            placeholder="密码"
+            show-password
+            @keyup.enter.native="handleLogin"
+          >
+            <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
+          </el-input>
+          <el-button
+            :loading="loading"
+            size="medium"
+            type="primary"
+            style="width:100%;background-color: #46A5D6; border-color: #46A5D6; margin-top: 40px; margin-bottom: 20px;"
+            @click.native.prevent="handleLogindt"
+          >
+            <span v-if="!loading">登 录</span>
+            <span v-else>登 录 中...</span>
+          </el-button>
+    </div>
+    <el-form v-if="showe"  ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
       <img src="../assets/images/pic_htgl_dl_logo.png" alt="" style="margin-left: 50%; transform: translateX(-50%);">
       <h3 class="title">登录</h3>
       <el-form-item prop="username">
@@ -59,15 +84,11 @@
 
       </el-form-item>
     </el-form>
-    <!--  底部  -->
-    <!-- <div class="el-login-footer">
-      <span>Copyright © 2018-2025 ruoyi.vip All Rights Reserved.</span>
-    </div> -->
   </div>
 </template>
 
 <script>
-import { getCodeImg } from "@/api/login"
+import { getCodeImg,checkDynamicPassword } from "@/api/login"
 import Cookies from "js-cookie"
 import { encrypt, decrypt } from '@/utils/jsencrypt'
 
@@ -98,7 +119,9 @@ export default {
       captchaEnabled: false,
       // 注册开关
       register: true,
-      redirect: undefined
+      redirect: undefined,
+      showe:false,
+      valhpos:null
     }
   },
   watch: {
@@ -110,10 +133,27 @@ export default {
     }
   },
   created() {
-    this.getCode()
-    this.getCookie()
+    this.showe = false
   },
   methods: {
+    // 动态密码
+    handleLogindt(){
+      if(this.valhpos == null || this.valhpos == ''){
+        this.$message.error('请先输入密码');
+        return
+      }
+    checkDynamicPassword(this.valhpos).then(res => {
+
+      // this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
+      // if (this.captchaEnabled) {
+      //   this.codeUrl = "data:image/gif;base64," + res.img
+      //   this.loginForm.uuid = res.uuid
+      // }
+      this.showe = true
+      this.getCode()
+      this.getCookie()
+    })
+    },
     getCode() {
       getCodeImg().then(res => {
         this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
@@ -223,6 +263,15 @@ export default {
     margin-bottom: 32px;
   }
 }
+.login-formyi{
+  display: flex;
+    justify-content: center;
+    align-items: center;
+    height: 100%;
+    background-image: url("../assets/images/pic_htgl_bgs.png");
+    background-size: cover;
+    position: relative;
+}
 .login-tip {
   font-size: 13px;
   text-align: center;
@@ -252,4 +301,7 @@ export default {
 .login-code-img {
   height: 38px;
 }
+.login-formba{
+  background-image: url("../assets/images/pic_htgl_srbg_yj.png");
+}
 </style>

+ 32 - 8
ruoyi-ui/src/views/system/config/index.vue

@@ -56,6 +56,14 @@
           v-hasPermi="['system:config:add']"
         >新增</el-button>
       </el-col>
+      <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="handleAddtai"
+          v-hasPermi="['manage:common:getDynamicPassword']"
+        >生成动态码</el-button>
+      </el-col>
       <!-- <el-col :span="1.5">
         <el-button
           type="success"
@@ -139,12 +147,12 @@
                         <p class="paragraph_5">{{item.configKey}}</p>
                         </el-tooltip>
                       </div>
-                      <!-- <div style="display: flex">
+                      <div style="display: flex">
                         <p class="paragraph_5">参数键值:</p>
                         <el-tooltip class="item" effect="dark" :content="'参数键值:' + item.configValue" placement="left-start">
                         <p class="paragraph_5">{{item.configValue}}</p>
                         </el-tooltip>
-                      </div> -->
+                      </div>
                       <div style="display: flex">
                         <p class="paragraph_5">系统内置:</p>
                         <p class="paragraph_5">{{item.configType == 'Y'?'是' : '否'}}</p>
@@ -255,7 +263,7 @@
 </template>
 
 <script>
-import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config"
+import { getDynamicPassword, listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config"
 
 export default {
   name: "Config",
@@ -393,12 +401,28 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const configIds = row.configId || this.ids
-      this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
-        return delConfig(configIds)
-      }).then(() => {
-        this.getList()
+      delConfig(configIds).then(response => {
         this.$modal.msgSuccess("删除成功")
-      }).catch(() => {})
+        this.getList()
+      })
+      // this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
+      //   return delConfig(configIds)
+      // }).then(() => {
+      //   this.getList()
+      //   this.$modal.msgSuccess("删除成功")
+      // }).catch(() => {})
+    },
+    // 生成动态码
+    handleAddtai(){
+      getDynamicPassword().then(response => {
+        this.$notify({
+                  title: '动态码为:' + response.data,
+                  message:'操作成功' ,
+                  type: 'success',
+                  duration: 0
+                });
+        // this.getList()
+      })
     },
     /** 导出按钮操作 */
     handleExport() {