Bladeren bron

登录加密

yuanhao 2 jaren geleden
bovenliggende
commit
1055cdc024

+ 1 - 1
in-cloud-ui/src/config/setting.config.js

@@ -49,7 +49,7 @@ const setting = {
   //是否开启登录拦截
   loginInterception: true,
   //是否开启登录RSA加密
-  loginRSA: false,
+  loginRSA: true,
   //intelligence和all两种方式,前者后端权限只控制permissions不控制view文件的import(前后端配合,减轻后端工作量),all方式完全交给后端前端只负责加载
   authentication: 'intelligence',
   //vertical布局时是否只保持一个子菜单的展开

+ 0 - 9
in-cloud-ui/src/router/index.js

@@ -80,15 +80,6 @@ export const asyncRoutes = [
           permissions: ['admin'],
         },
       },
-      {
-        path: 'map',
-        component: () => import('@/views/vab/map/index'),
-        name: 'Map',
-        meta: {
-          title: '地图',
-          permissions: ['admin'],
-        },
-      },
     ],
   },
   {

+ 6 - 13
in-cloud-ui/src/utils/encrypt.js

@@ -3,7 +3,7 @@ import { getPublicKey } from '@/api/publicKey'
 
 const privateKey =
   'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMFPa+v52FkSUXvcUnrGI/XzW3EpZRI0s9BCWJ3oNQmEYA5luWW5p8h0uadTIoTyYweFPdH4hveyxlwmS7oefvbIdiP+o+QIYW/R4Wjsb4Yl8MhR4PJqUE3RCy6IT9fM8ckG4kN9ECs6Ja8fQFc6/mSl5dJczzJO3k1rWMBhKJD/AgMBAAECgYEAucMakH9dWeryhrYoRHcXo4giPVJsH9ypVt4KzmOQY/7jV7KFQK3x//27UoHfUCak51sxFw9ek7UmTPM4HjikA9LkYeE7S381b4QRvFuf3L6IbMP3ywJnJ8pPr2l5SqQ00W+oKv+w/VmEsyUHr+k4Z+4ik+FheTkVWp566WbqFsECQQDjYaMcaKw3j2Zecl8T6eUe7fdaRMIzp/gcpPMfT/9rDzIQk+7ORvm1NI9AUmFv/FAlfpuAMrdL2n7p9uznWb7RAkEA2aP934kbXg5bdV0R313MrL+7WTK/qdcYxATUbMsMuWWQBoS5irrt80WCZbG48hpocJavLNjbtrjmUX3CuJBmzwJAOJg8uP10n/+ZQzjEYXh+BszEHDuw+pp8LuT/fnOy5zrJA0dO0RjpXijO3vuiNPVgHXT9z1LQPJkNrb5ACPVVgQJBALPeb4uV0bNrJDUb5RB4ghZnIxv18CcaqNIft7vuGCcFBAIPIRTBprR+RuVq+xHDt3sNXdsvom4h49+Hky1b0ksCQBBwUtVaqH6ztCtwUF1j2c/Zcrt5P/uN7IHAd44K0gIJc1+Csr3qPG+G2yoqRM8KVqLI8Z2ZYn9c+AvEE+L9OQY='
-
+const publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwVN9PdIfX2YNWOYsdkjwcf4iEwXiwPu7ON1dhden0DtyENEI4HnUYnw/r2PrqOVCB1X57FJR93efneL4EFOQ5fI/mkmhbfnNg5O8iabAJtz443mUhLvlyO6o0m5EKWf2PuvxEdgOLAFooAVfYTskiHMQ1Hc7s+iU//Y5JRwAF2QIDAQAB'
 /**
  * @author https://gitee.com/chu1204505056/vue-admin-better (不想保留author可删除)
  * @description RSA加密
@@ -11,22 +11,15 @@ const privateKey =
  * @returns {Promise<{param: PromiseLike<ArrayBuffer>}|*>}
  */
 export async function encryptedData(data) {
-  let publicKey = ''
-  const res = await getPublicKey()
-  publicKey = res.data.publicKey
-  if (res.data.mockServer) {
-    publicKey = ''
-  }
-  if (publicKey == '') {
-    return data
-  }
+
   const encrypt = new JSEncrypt()
   encrypt.setPublicKey(
-    `-----BEGIN PUBLIC KEY-----${publicKey}-----END PUBLIC KEY-----`
+    publicKey
   )
-  data = encrypt.encrypt(JSON.stringify(data))
+  var pwd = encrypt.encrypt(data.password)
   return {
-    param: data,
+    username: data.username,
+    password: pwd
   }
 }
 

+ 18 - 384
in-cloud-ui/src/views/index/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="index-container">
-    <el-row :gutter="20">
+<!--    <el-row :gutter="20">
       <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
         <el-alert v-if="noticeList[0]" :closable="noticeList[0].closable">
           <div
@@ -199,395 +199,29 @@
         <plan></plan>
         <version-information></version-information>
       </el-col>
-    </el-row>
+    </el-row>-->
+
+    <vab-snow></vab-snow>
   </div>
 </template>
 
 <script>
-  import VabChart from '@/plugins/echarts'
-  import { dependencies, devDependencies } from '../../../package.json'
-  import { getList } from '@/api/changeLog'
-  import { getNoticeList } from '@/api/notice'
-  import Plan from './components/Plan'
-  import VersionInformation from './components/VersionInformation'
-
-  export default {
-    name: 'Index',
-    components: {
-      VabChart,
-      Plan,
-      VersionInformation,
-    },
-    data() {
-      return {
-        timer: 0,
-        updateTime: process.env.VUE_APP_UPDATE_TIME,
-        nodeEnv: process.env.NODE_ENV,
-        dependencies: dependencies,
-        devDependencies: devDependencies,
-        config1: {
-          startVal: 0,
-          endVal: this.$baseLodash.random(20000, 60000),
-          decimals: 0,
-          prefix: '',
-          suffix: '',
-          separator: ',',
-          duration: 8000,
-        },
-        config2: {
-          startVal: 0,
-          endVal: this.$baseLodash.random(1000, 20000),
-          decimals: 0,
-          prefix: '',
-          suffix: '',
-          separator: ',',
-          duration: 8000,
-        },
-        config3: {
-          startVal: 0,
-          endVal: this.$baseLodash.random(1000, 20000),
-          decimals: 0,
-          prefix: '',
-          suffix: '',
-          separator: ',',
-          duration: 8000,
-        },
-
-        //访问量
-        fwl: {
-          grid: {
-            top: '4%',
-            left: '2%',
-            right: '4%',
-            bottom: '0%',
-            containLabel: true,
-          },
-          xAxis: [
-            {
-              type: 'category',
-              boundaryGap: false,
-              data: [],
-              axisTick: {
-                alignWithLabel: true,
-              },
-            },
-          ],
-          yAxis: [
-            {
-              type: 'value',
-            },
-          ],
-          series: [
-            {
-              name: '访问量',
-              type: 'line',
-              data: [],
-              smooth: true,
-              areaStyle: {},
-            },
-          ],
-        },
-        //授权数
-        sqs: {
-          grid: {
-            top: '4%',
-            left: '2%',
-            right: '4%',
-            bottom: '0%',
-            containLabel: true,
-          },
-          xAxis: [
-            {
-              type: 'category',
-              /*boundaryGap: false,*/
-              data: ['0时', '4时', '8时', '12时', '16时', '20时', '24时'],
-              axisTick: {
-                alignWithLabel: true,
-              },
-            },
-          ],
-          yAxis: [
-            {
-              type: 'value',
-            },
-          ],
-          series: [
-            {
-              name: '授权数',
-              type: 'bar',
-              barWidth: '60%',
-              data: [10, 52, 20, 33, 39, 33, 22],
-            },
-          ],
-        },
-        //词云
-        cy: {
-          grid: {
-            top: '4%',
-            left: '2%',
-            right: '4%',
-            bottom: '0%',
-          },
-          series: [
-            {
-              type: 'wordCloud',
-              gridSize: 15,
-              sizeRange: [12, 40],
-              rotationRange: [0, 0],
-              width: '100%',
-              height: '100%',
-              textStyle: {
-                normal: {
-                  color() {
-                    const arr = [
-                      '#5470c6',
-                      '#91cc75',
-                      '#fac858',
-                      '#ee6666',
-                      '#73c0de',
-                      '#975FE5',
-                    ]
-                    let index = Math.floor(Math.random() * arr.length)
-                    return arr[index]
-                  },
-                },
-              },
-              data: [
-                {
-                  name: 'vue-admin-better',
-                  value: 15000,
-                },
-                {
-                  name: 'element',
-                  value: 10081,
-                },
-                {
-                  name: 'beautiful',
-                  value: 9386,
-                },
-
-                {
-                  name: 'vue',
-                  value: 6500,
-                },
-                {
-                  name: 'chuzhixin',
-                  value: 6000,
-                },
-                {
-                  name: 'good',
-                  value: 4500,
-                },
-                {
-                  name: 'success',
-                  value: 3800,
-                },
-                {
-                  name: 'never',
-                  value: 3000,
-                },
-                {
-                  name: 'boy',
-                  value: 2500,
-                },
-                {
-                  name: 'girl',
-                  value: 2300,
-                },
-                {
-                  name: 'github',
-                  value: 2000,
-                },
-                {
-                  name: 'hbuilder',
-                  value: 1900,
-                },
-                {
-                  name: 'dcloud',
-                  value: 1800,
-                },
-                {
-                  name: 'china',
-                  value: 1700,
-                },
-                {
-                  name: '1204505056',
-                  value: 1600,
-                },
-                {
-                  name: '972435319',
-                  value: 1500,
-                },
-                {
-                  name: 'young',
-                  value: 1200,
-                },
-                {
-                  name: 'old',
-                  value: 1100,
-                },
-                {
-                  name: 'vuex',
-                  value: 900,
-                },
-                {
-                  name: 'router',
-                  value: 800,
-                },
-                {
-                  name: 'money',
-                  value: 700,
-                },
-                {
-                  name: 'qingdao',
-                  value: 800,
-                },
-                {
-                  name: 'yantai',
-                  value: 9000,
-                },
-                {
-                  name: 'author is very cool',
-                  value: 9200,
-                },
-              ],
-            },
-          ],
-        },
-
-        //更新日志
-        reverse: true,
-        activities: [],
-        noticeList: [],
-        //其他信息
-        userAgent: navigator.userAgent,
-        //卡片图标
-        iconList: [
-          {
-            icon: 'video',
-            title: '视频播放器',
-            link: '/vab/player',
-            color: '#ffc069',
-          },
-          {
-            icon: 'table',
-            title: '表格',
-            link: '/vab/station/station',
-            color: '#5cdbd3',
-          },
-          {
-            icon: 'laptop-code',
-            title: '源码',
-            link: 'https://github.com/chuzhixin/vue-admin-better',
-            color: '#b37feb',
-          },
-          {
-            icon: 'book',
-            title: '书籍',
-            link: '',
-            color: '#69c0ff',
-          },
-          {
-            icon: 'bullhorn',
-            title: '公告',
-            link: '',
-            color: '#ff85c0',
-          },
-          {
-            icon: 'gift',
-            title: '礼物',
-            link: '',
-            color: '#ffd666',
-          },
-
-          {
-            icon: 'balance-scale-left',
-            title: '公平的世界',
-            link: '',
-            color: '#ff9c6e',
-          },
-          {
-            icon: 'coffee',
-            title: '休息一下',
-            link: '',
-            color: '#95de64',
-          },
-        ],
-      }
-    },
-    created() {
-      this.fetchData()
-    },
-    beforeDestroy() {
-      clearInterval(this.timer)
-    },
-    mounted() {
-      let base = +new Date(2020, 1, 1)
-      let oneDay = 24 * 3600 * 1000
-      let date = []
-
-      let data = [Math.random() * 1500]
-      let now = new Date(base)
 
-      const addData = (shift) => {
-        now = [now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/')
-        date.push(now)
-        data.push(this.$baseLodash.random(20000, 60000))
+import VabSnow from '@/components/VabSnow'
+export default {
+  name: 'index',
+  components: {
+    VabSnow,
+  },
+  data() {
+    return {
 
-        if (shift) {
-          date.shift()
-          data.shift()
-        }
-
-        now = new Date(+new Date(now) + oneDay)
-      }
-
-      for (let i = 1; i < 6; i++) {
-        addData()
-      }
-      addData(true)
-      this.fwl.xAxis[0].data = date
-      this.fwl.series[0].data = data
-      this.timer = setInterval(() => {
-        addData(true)
-        this.fwl.xAxis[0].data = date
-        this.fwl.series[0].data = data
-      }, 3000)
-    },
-    methods: {
-      handleClick(e) {
-        this.$baseMessage(`点击了${e.name},这里可以写跳转`)
-      },
-      handleZrClick(e) {},
-      handleChangeTheme() {
-        this.$baseEventBus.$emit('theme')
-      },
-      async fetchData() {
-        const { data } = await getList()
-        data.map((item, index) => {
-          if (index === data.length - 1) {
-            item.color = '#0bbd87'
-          }
-        })
-        this.activities = data
-        const res = await getNoticeList()
-        this.noticeList = res.data
-        /* getRepos({
-        token: "1061286824f978ea3cf98b7b8ea26fe27ba7cea1",
-      }).then((res) => {
-        const per_page = Math.ceil(res.data.stargazers_count / 100);
-        alert(per_page);
-        getStargazers({
-          token: "1061286824f978ea3cf98b7b8ea26fe27ba7cea1",
-          page: 1,
-          per_page: res.per_page,
-        }).then((res) => {
-          alert(JSON.stringify(res));
-        });
-      }); */
-      },
-    },
-  }
+    }
+  },
+  created() {},
+  mounted() {},
+  methods: {},
+}
 </script>
 <style lang="scss" scoped>
   .index-container {

+ 2 - 1
in-cloud-ui/src/views/quartz/quartzBase/index.vue

@@ -367,7 +367,8 @@
       },
       handleEdit(row) {
         this.typeEdit = true
-        this.form = row
+        var newObj = JSON.parse(JSON.stringify(row))
+        this.form = newObj
         this.title = '修改'
         this.dialogType = 'edit'
         this.dialogFormVisible = true

+ 7 - 5
in-cloud-ui/src/views/vab/inCompany/index.vue

@@ -6,8 +6,7 @@
           ref="searchForm"
           :model="searchForm"
           :inline="true"
-          @submit.native.prevent
-        >
+          @submit.native.prevent>
           <el-form-item>
             <el-input v-model="searchForm.name" placeholder="公司名称" />
           </el-form-item>
@@ -16,7 +15,6 @@
             <el-input v-model="searchForm.code" placeholder="公司编码" />
           </el-form-item>
 
-
           <el-form-item>
             <el-button
               icon="el-icon-search"
@@ -103,7 +101,7 @@
           <el-input v-model.trim="form.name" autocomplete="off"></el-input>
         </el-form-item>
         <el-form-item label="公司编码" prop="code">
-          <el-input v-model.trim="form.code" autocomplete="off"></el-input>
+          <el-input v-model.trim="form.code" autocomplete="off" :disabled="isEdit"></el-input>
         </el-form-item>
         <el-form-item label="联系方式" prop="contact">
           <el-input v-model.trim="form.contact" autocomplete="off"></el-input>
@@ -158,6 +156,7 @@
       }
 
       return {
+        isEdit: false,
         dialogFormVisible: false,
         dialogType: '',
         title: '',
@@ -257,13 +256,16 @@
         this.$emit('fetch-data')
       },
       handleAdd() {
+        this.isEdit = false
         this.form = {}
         this.title = '新增'
         this.dialogType = 'add'
         this.dialogFormVisible = true
       },
       handleEdit(row) {
-        this.form = row
+        this.isEdit = true
+        var newObj = JSON.parse(JSON.stringify(row))
+        this.form = newObj
         this.title = '修改'
         this.dialogType = 'edit'
         this.dialogFormVisible = true

+ 0 - 115
in-cloud-ui/src/views/vab/map/index.vue

@@ -1,115 +0,0 @@
-<template>
-  <div class="map-container">
-    <div id="map" class="container"></div>
-  </div>
-</template>
-
-<script>
-  import axios from 'axios'
-  import * as mapv from 'mapv'
-  export default {
-    name: 'Map',
-    components: {},
-    data() {
-      return {}
-    },
-    created() {},
-    mounted() {
-      this.$nextTick(() => {
-        const map = this.$baseMap()
-        axios
-          .get(
-            'https://fastly.jsdelivr.net/npm/mapv@2.0.12/examples/data/od-xierqi.txt'
-          )
-          .then((rs) => {
-            let data = []
-            let timeData = []
-
-            rs = rs.data.split('\n')
-            let maxLength = 0
-            for (let i = 0; i < rs.length; i++) {
-              let item = rs[i].split(',')
-              let coordinates = []
-              if (item.length > maxLength) {
-                maxLength = item.length
-              }
-              for (let j = 0; j < item.length; j += 2) {
-                let x = (Number(item[j]) / 20037508.34) * 180
-                let y = (Number(item[j + 1]) / 20037508.34) * 180
-                y =
-                  (180 / Math.PI) *
-                  (2 * Math.atan(Math.exp((y * Math.PI) / 180)) - Math.PI / 2)
-                if (x == 0 || y == NaN) {
-                  continue
-                }
-                coordinates.push([x, y])
-                timeData.push({
-                  geometry: {
-                    type: 'Point',
-                    coordinates: [x, y],
-                  },
-                  count: 1,
-                  time: j,
-                })
-              }
-              data.push({
-                geometry: {
-                  type: 'LineString',
-                  coordinates: coordinates,
-                },
-              })
-            }
-
-            let dataSet = new mapv.DataSet(data)
-
-            let options = {
-              strokeStyle: 'rgba(53,57,255,0.5)',
-              // globalCompositeOperation: 'lighter',
-              shadowColor: 'rgba(53,57,255,0.2)',
-              shadowBlur: 3,
-              lineWidth: 3.0,
-              draw: 'simple',
-            }
-
-            let mapvLayer = new mapv.MaptalksLayer(
-              'mapv1',
-              dataSet,
-              options
-            ).addTo(map)
-
-            let dataSet2 = new mapv.DataSet(timeData)
-
-            let options2 = {
-              fillStyle: 'rgba(255, 250, 250, 0.2)',
-              globalCompositeOperation: 'lighter',
-              size: 1.5,
-              animation: {
-                stepsRange: {
-                  start: 0,
-                  end: 100,
-                },
-                trails: 3,
-                duration: 5,
-              },
-              draw: 'simple',
-            }
-
-            let mapvLayer2 = new mapv.MaptalksLayer(
-              'mapv2',
-              dataSet2,
-              options2
-            ).addTo(map)
-          })
-      })
-    },
-    methods: {},
-  }
-</script>
-<style lang="scss" scoped>
-  .map-container {
-    .container {
-      width: 100%;
-      height: calc(100vh - 214px);
-    }
-  }
-</style>

+ 6 - 1
in-cloud-ui/src/views/vab/station/index.vue

@@ -137,6 +137,7 @@
         <el-form-item label="场站编码" prop="stationCode">
           <el-input
             v-model.trim="form.stationCode"
+            :disabled="isEdit"
             autocomplete="off"
           ></el-input>
         </el-form-item>
@@ -214,6 +215,7 @@
       }
 
       return {
+        isEdit: false,
         dialogFormVisible: false,
         dialogType: '',
         title: '',
@@ -336,13 +338,16 @@
         this.$emit('fetch-data')
       },
       handleAdd() {
+        this.isEdit = false
         this.form = {}
         this.title = '新增'
         this.dialogType = 'add'
         this.dialogFormVisible = true
       },
       handleEdit(row) {
-        this.form = row
+        this.isEdit = true
+        var newObj = JSON.parse(JSON.stringify(row))
+        this.form = newObj
         this.title = '修改'
         this.dialogType = 'edit'
         this.dialogFormVisible = true

+ 42 - 3
in-cloud/src/main/java/com/jiayue/insu/incloud/permisson/Login.java

@@ -1,12 +1,23 @@
 package com.jiayue.insu.incloud.permisson;
 
 import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.codec.Base64;
+import cn.hutool.core.util.CharsetUtil;
+import cn.hutool.core.util.HexUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.crypto.SecureUtil;
+import cn.hutool.crypto.asymmetric.AsymmetricAlgorithm;
+import cn.hutool.crypto.asymmetric.KeyType;
+import cn.hutool.crypto.asymmetric.RSA;
 import com.jiayue.insu.common.core.util.R;
 import com.jiayue.insu.incloud.entity.User;
 import com.jiayue.insu.incloud.service.UserService;
+import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.security.KeyPair;
+
 /**
  * 系统权限业务类
  *
@@ -23,10 +34,38 @@ public class Login {
 
     @PostMapping("/doLogin")
     public R doLogin(@RequestBody User user ){
-        User userTar = userService.findByNameAndPwd(user.getUsername(), user.getPassword());
+
+     /*   // 公钥加密,私钥解密
+        String encryptByPublic = rsa.encryptBase64(text, KeyType.PublicKey);
+        System.out.println("公钥加密\t" + encryptByPublic);
+        String decryptByPrivate = rsa.decryptStr(encryptByPublic, KeyType.PrivateKey);
+        System.out.println("私钥解密\t" + decryptByPrivate);
+
+        // 私钥加密,公钥解密
+        String encryptByPrivate = rsa.encryptBase64(text, KeyType.PrivateKey);
+        System.out.println("私钥加密\t" + encryptByPrivate);
+        String decryptByPublic = rsa.decryptStr(encryptByPrivate, KeyType.PublicKey);
+        System.out.println("公钥解密\t" + decryptByPublic);*/
+
+        String privateKey ="MIICdAIBADANBgkqhkiG9w0BAQEFAASCAl4wggJaAgEAAoGBALBU3090h9fZg1Y5ix2SPBx/iITBeLA+7s43V2F16fQO3IQ0QjgedRifD+vY+uo5UIHVfnsUlH3d5+d4vgQU5Dl8j+aSaFt+c2Dk7yJpsAm3PjjeZSEu+XI7qjSbkQpZ/Y+6/ER2A4sAWigBV9hOySIcxDUdzuz6JT/9jklHAAXZAgMBAAECgYAfY1xE9odf4vZAGQosf2V35TPV/eKP7QPxbWR+ktDMgwC5/9txxeouMdJRt1Qi8YTlN63GFwm/xgqL57BbZaSiUuT5FadkAVuLj2FIp+kiHNhsuJJP+2OSPa01uGhef8uNYX0l57lzepsBeCYGoT2aq0iBm84r+POYQatgXPQJiQJBAO6mziOpNAO+DHwn03vGla+QUJyVCOZEGWI1yL09sZs8NUrDrM5OkD+SjCgBIIwRhQKlmxHoOcA4fUaGVe3CGJsCQQC9JlHplFOoiZjPi9bH9AegZgch7WZpXvuw9T8cYa2fER3DEgcn6yexfvjd3sxQ/2qy6ZvtRaKco5KKtkYdU2CbAj9G2T5ZV+IZOlJ6iVg/ZrUJac6Erbn2okDm5xCxHZ+cdkNb7rteg/RO6zKwraT78DeMkZ13s3lxl1OZnEfmTbkCQF4hvuwWpBeg+op3VllGKbF6dRw+UBQqb+md812FgulBlGUrCKKmFafwv5tzMI0yv3/wYGgRmp6HjPs5QOWBQ/cCQCMe73HBAYp1JnhMSvJ4irmRlfI9wsoC7FaEjIdAZCupYma8ST23deBpBOKUSoVY4Off5PZIuBYuKyeUUPBz0Ls=";
+        String publicKey ="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwVN9PdIfX2YNWOYsdkjwcf4iEwXiwPu7ON1dhden0DtyENEI4HnUYnw/r2PrqOVCB1X57FJR93efneL4EFOQ5fI/mkmhbfnNg5O8iabAJtz443mUhLvlyO6o0m5EKWf2PuvxEdgOLAFooAVfYTskiHMQ1Hc7s+iU//Y5JRwAF2QIDAQAB";
+
+        RSA rsa = new RSA(AsymmetricAlgorithm.RSA_ECB_PKCS1.getValue(), privateKey, publicKey);
+        // 私钥解密公钥加密后的密文
+        String inputPwd = rsa.decryptStr(user.getPassword(), KeyType.PrivateKey);
+
+        //User userTar = userService.findByNameAndPwd(user.getUsername(), decrypt);
+        User userTar = userService.findByName(user.getUsername());
+
         if(userTar!=null){
-            StpUtil.login(userTar.getUsername());
-            return R.ok(StpUtil.getTokenInfo());
+            String dbPwd = rsa.decryptStr(userTar.getPassword(), KeyType.PrivateKey);
+            if(dbPwd.equals(inputPwd)){
+                StpUtil.login(userTar.getUsername());
+                return R.ok(StpUtil.getTokenInfo());
+            }else{
+                return R.ok(null);
+            }
+
         }else{
             return R.ok(null);
         }