1 Star 0 Fork 0

诺墨/Next.js 集成 Gitee OAuth 登录

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Next.js 集成 Gitee OAuth 示例

GitHub License GitHub top language

这是一个使用 Next.js 15 和 Gitee OAuth 构建的应用示例,展示了如何集成 Gitee 账号登录功能。

授权登录页

点此体验在线 Demo

特性

  • ⚡️ Next.js 15 框架,使用 Turbopack 提供极速开发体验
  • 🔐 集成 Gitee OAuth 登录
  • 🎨 基于 shadcn/ui 构建的现代 UI
  • 🌓 支持亮色/暗色主题,可跟随系统设置
  • 📱 完全响应式设计
  • 🚀 使用 pnpm 作为包管理器

快速开始

环境要求

  • Node.js >= 18.17.0
  • pnpm >= 8.0.0

安装

# 克隆项目
git clone https://gitee.com/normalcoder/nextjs-gitee-oauth.git
cd nextjs-gitee-oauth

# 安装依赖
pnpm install

开发

  1. 复制环境变量文件:

    cp .env.example .env.local
    
  2. .env.local 中配置你的 Gitee OAuth 应用信息:

    # Gitee OAuth 配置
    NEXT_PUBLIC_GITEE_CLIENT_ID=你的客户端 ID
    GITEE_CLIENT_SECRET=你的客户端密钥
    NEXT_PUBLIC_GITEE_REDIRECT_URI=http://localhost:3000/api/auth/callback/gitee 
    
  3. 启动开发服务器:

    pnpm dev
    

现在你可以访问 http://localhost:3000 查看应用。

构建

# 生产环境构建
pnpm build

# 启动生产服务器
pnpm start

项目结构

.
├── app/            # Next.js 应用目录
│   ├── api/        # API 路由
│   ├── dashboard/  # 用户仪表盘页面
│   └── page.tsx    # 首页
├── components/     # React 组件
├── lib/            # 工具函数
└── public/         # 静态资源

开源许可

本项目基于 MIT 发布

MIT License Copyright (c) 2025 诺墨 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用 Next.js 15 和 Gitee OAuth 构建的应用示例,展示了如何集成 Gitee 账号登录功能。 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/normalcoder/nextjs-gitee-oauth.git
git@gitee.com:normalcoder/nextjs-gitee-oauth.git
normalcoder
nextjs-gitee-oauth
Next.js 集成 Gitee OAuth 登录
main

搜索帮助