-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(user-manage): 基于 next-auth 重构《用户管理》模块
- Loading branch information
Showing
28 changed files
with
543 additions
and
801 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ DATABASE_URL="postgresql://postgres:123456@localhost:5432/next-admin?schema=publ | |
NEXT_PUBLIC_PROJECT_NAME = Next Admin | ||
|
||
# 项目描述 | ||
NEXT_PUBLIC_PROJECT_DESC = 基于 Ant Design Next.js 的后台管理系统 | ||
NEXT_PUBLIC_PROJECT_DESC = 挖掘发现 Next.js 的乐趣所在 | ||
|
||
# 主题模式 | ||
NEXT_PUBLIC_THEME_MODE = light | ||
|
@@ -33,3 +33,17 @@ NEXT_PUBLIC_AUTHOR_WECHAT = https://wechat.baiwumm.com/ | |
|
||
# 邮箱 | ||
NEXT_PUBLIC_AUTHOR_EMAIL = [email protected] | ||
|
||
AUTH_SECRET="qeY6JYj8JUEkkqsp+RHtusNfChlUKl1RhtZT5C2JkEE=" # Added by `npx auth`. Read more: https://cli.authjs.dev | ||
|
||
# Github 授权信息 | ||
GITHUB_ID= 'Ov23liiX13UGfOAGJjnb' | ||
GITHUB_SECRET= '084703c6c57e4b3c4fa9fadfb1aaf3be354f5b95' | ||
|
||
# Google 授权信息 | ||
GOOGLE_CLIENT_ID= '512149633218-bne02tg2f496qtq3moak048na8c1tq3o.apps.googleusercontent.com' | ||
GOOGLE_CLIENT_SECRET= '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' | ||
|
||
# Gitee 授权信息 | ||
GITEE_CLIENT_ID= 'e1e6a35da0eef58d8a428d6b02fe3fcc93b5d4e198e21384b36257e241a564bd' | ||
GITEE_CLIENT_SECRET= '464416f35faae65d9f908cffc7bb35c6acc11800172671f3b72a15c7b42fe040' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/versions | ||
.env | ||
|
||
# testing | ||
/coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { handlers } from '@/auth'; | ||
export const { GET, POST } = handlers; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use client'; | ||
|
||
import { useMount, useUnmount } from 'ahooks'; | ||
|
||
import LangSwitch from '@/components/LangSwitch'; | ||
import ThemeModeButton from '@/components/ThemeModeButton'; | ||
import { useLayoutStore } from '@/store/layoutStore'; | ||
|
||
export default function LoginLayout({ children }: { children: React.ReactNode }) { | ||
useMount(() => { | ||
useLayoutStore.setState({ skipGlobalLayout: true }); | ||
}); | ||
|
||
useUnmount(() => { | ||
// 如果需要在离开页面时重置状态 | ||
useLayoutStore.setState({ skipGlobalLayout: false }); | ||
}); | ||
return ( | ||
<div className="relative flex h-[calc(100vh_-_2rem)] w-[calc(100vw_-_2rem)] overflow-hidden justify-center items-center"> | ||
{children} | ||
<div className="flex absolute top-0 right-0"> | ||
<ThemeModeButton /> | ||
<LangSwitch /> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.