1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-11 11:40:23 +08:00

login add salt

This commit is contained in:
源文雨
2023-03-16 23:27:29 +08:00
parent 57b32e609f
commit 5889f0e30a
5 changed files with 31 additions and 2 deletions

View File

@@ -80,6 +80,7 @@
</template>
<script lang="ts" setup>
import { reactive, ref, unref, computed } from 'vue'
import md5 from 'md5'
import { Checkbox, Form, Input, Row, Col, Button } from 'ant-design-vue'
import LoginFormTitle from './LoginFormTitle.vue'
@@ -88,6 +89,7 @@
import { useMessage } from '/@/hooks/web/useMessage'
import { useUserStore } from '/@/store/modules/user'
import { getLoginSalt } from '/@/api/sys/user'
import { LoginStateEnum, useLoginState, useFormRules, useFormValid } from './useLogin'
import { useDesign } from '/@/hooks/web/useDesign'
// import { onKeyStroke } from '@vueuse/core'
@@ -124,8 +126,9 @@
if (!data) return
try {
loading.value = true
const { salt } = await getLoginSalt(data.account)
const userInfo = await userStore.login({
password: data.password,
password: md5(data.password + salt),
username: data.account,
mode: 'none', //不要默认的错误提示
})