更新
This commit is contained in:
parent
5ffcbf84a3
commit
7e7c6c2340
@ -21,7 +21,7 @@ kinit 是一套全部开源的快速开发平台,毫无保留给个人及企
|
|||||||
|
|
||||||
👩👧👦演示地址:正在部署中。。。。。
|
👩👧👦演示地址:正在部署中。。。。。
|
||||||
|
|
||||||
- 账号:admin
|
- 账号:admin
|
||||||
- 密码:123456
|
- 密码:123456
|
||||||
|
|
||||||
## 源码地址
|
## 源码地址
|
||||||
|
@ -21,5 +21,5 @@ export const getUserApi = (dataId: number): Promise<IResponse> => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const postCurrentUserResetPassword = (data: any): Promise<IResponse> => {
|
export const postCurrentUserResetPassword = (data: any): Promise<IResponse> => {
|
||||||
return request.get({ url: `/vadmin/auth/user/current/reset/password/`, data })
|
return request.post({ url: `/vadmin/auth/user/current/reset/password/`, data })
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import { resetRouter } from '@/router'
|
import { resetRouter } from '@/router'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { loginOutApi } from '@/api/login'
|
|
||||||
import { useDesign } from '@/hooks/web/useDesign'
|
import { useDesign } from '@/hooks/web/useDesign'
|
||||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||||
@ -59,6 +58,9 @@ const user = wsCache.get(appStore.getUserInfo)
|
|||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<ElDropdownMenu>
|
<ElDropdownMenu>
|
||||||
|
<ElDropdownItem>
|
||||||
|
<div @click="toDocument">个人主页</div>
|
||||||
|
</ElDropdownItem>
|
||||||
<ElDropdownItem>
|
<ElDropdownItem>
|
||||||
<div @click="toDocument">前端项目文档</div>
|
<div @click="toDocument">前端项目文档</div>
|
||||||
</ElDropdownItem>
|
</ElDropdownItem>
|
||||||
|
@ -137,7 +137,7 @@ const router = createRouter({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const resetRouter = (): void => {
|
export const resetRouter = (): void => {
|
||||||
const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root']
|
const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root', 'Reset']
|
||||||
router.getRoutes().forEach((route) => {
|
router.getRoutes().forEach((route) => {
|
||||||
const { name } = route
|
const { name } = route
|
||||||
if (name && !resetWhiteNameList.includes(name as string)) {
|
if (name && !resetWhiteNameList.includes(name as string)) {
|
||||||
|
@ -125,7 +125,6 @@ const signIn = async () => {
|
|||||||
const authStore = useAuthStoreWithOut()
|
const authStore = useAuthStoreWithOut()
|
||||||
const res = await authStore.login(formData)
|
const res = await authStore.login(formData)
|
||||||
if (res) {
|
if (res) {
|
||||||
console.log(res)
|
|
||||||
if (!res.data.is_reset_password) {
|
if (!res.data.is_reset_password) {
|
||||||
// 重置密码
|
// 重置密码
|
||||||
push({ path: '/reset/password' })
|
push({ path: '/reset/password' })
|
||||||
|
@ -7,7 +7,7 @@ import { postCurrentUserResetPassword } from '@/api/vadmin/auth/user'
|
|||||||
import { usePermissionStore } from '@/store/modules/permission'
|
import { usePermissionStore } from '@/store/modules/permission'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import type { RouteRecordRaw, RouteLocationNormalizedLoaded } from 'vue-router'
|
import type { RouteRecordRaw, RouteLocationNormalizedLoaded } from 'vue-router'
|
||||||
import { UserLoginType } from '@/api/login/types'
|
import { getRoleMenusApi } from '@/api/login'
|
||||||
import { useValidator } from '@/hooks/web/useValidator'
|
import { useValidator } from '@/hooks/web/useValidator'
|
||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
@ -25,8 +25,14 @@ const permissionStore = usePermissionStore()
|
|||||||
const { addRoute, push, currentRoute } = useRouter()
|
const { addRoute, push, currentRoute } = useRouter()
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
password: [required()],
|
password: [
|
||||||
password_two: [required()]
|
required(),
|
||||||
|
{ min: 8, max: 16, message: '长度需为8-16个字符,请重新输入。', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
password_two: [
|
||||||
|
required(),
|
||||||
|
{ min: 8, max: 16, message: '长度需为8-16个字符,请重新输入。', trigger: 'blur' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
const schema = reactive<FormSchema[]>([
|
const schema = reactive<FormSchema[]>([
|
||||||
@ -94,9 +100,9 @@ const save = async () => {
|
|||||||
if (isValid) {
|
if (isValid) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const { getFormData } = methods
|
const { getFormData } = methods
|
||||||
const formData = await getFormData<UserLoginType>()
|
const formData = await getFormData()
|
||||||
try {
|
try {
|
||||||
const res = postCurrentUserResetPassword(formData)
|
const res = await postCurrentUserResetPassword(formData)
|
||||||
if (res) {
|
if (res) {
|
||||||
// 是否使用动态路由
|
// 是否使用动态路由
|
||||||
getMenu()
|
getMenu()
|
||||||
|
@ -51,6 +51,8 @@ class UserDal(DalBase):
|
|||||||
result = test_password(data.password)
|
result = test_password(data.password)
|
||||||
if isinstance(result, str):
|
if isinstance(result, str):
|
||||||
raise CustomException(msg=result, code=400)
|
raise CustomException(msg=result, code=400)
|
||||||
|
user.password = self.model.get_password_hash(data.password)
|
||||||
|
user.is_reset_password = True
|
||||||
self.db.add(user)
|
self.db.add(user)
|
||||||
await self.db.flush()
|
await self.db.flush()
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user