forked from xiaobaiweinuli/aipan-netdisk-search
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from unilei/feat-add-admin-panel
Feat add admin panel
- Loading branch information
Showing
45 changed files
with
1,464 additions
and
11 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ADMIN_USER= | ||
ADMIN_PASSWORD= | ||
ADMIN_EMAIL= | ||
JWT_SECRET= | ||
|
||
# This was inserted by `prisma init`: | ||
# Environment variables declared in this file are automatically made available to Prisma. | ||
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema | ||
|
||
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. | ||
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings | ||
|
||
DATABASE_URL= |
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,60 @@ | ||
# 爱盼-网盘资源搜索Web | ||
爱盼-网盘资源搜索:是一个免费开源项目! | ||
👉 [爱盼-网盘资源搜索](https://so.aicompasspro.com) | ||
|
||
### 更新 | ||
- 增加后台管理, 访问路径:/login | /admin/dashboard | /admin/clouddrive | ||
- 后台可以增加自己的网盘资源 | ||
|
||
### 建议 | ||
项目使用的是第三方的API,对ip有访问限制,建议自己部署使用。 | ||
|
||
## 快速开始 | ||
|
||
### 在 Vercel 上部署 | ||
|
||
#### 之前已经部署过本项目 | ||
- 第1步,点击 storge | ||
![第1步](/assets/readme/vercel/exist/1.png) | ||
|
||
- 第2步,选择postgres数据库 | ||
![第2步](/assets/readme/vercel/exist/2.png) | ||
|
||
- 第3步,创建数据库名字 aipannetdisk, 选择数据库地理位置 | ||
![第3步](/assets/readme/vercel/exist/3.png) | ||
|
||
- 第4步,复制POSTGRES_PRISMA_URL, :后面的字符串,就是链接地址 | ||
![第4步](/assets/readme/vercel/exist/4.png) | ||
|
||
- 第5步,切换部署的 git 分支 feat-add-admin-panel | ||
![第5步](/assets/readme/vercel/exist/5.png) | ||
|
||
- 第6步,创建部署时的.env | ||
![第6步](/assets/readme/vercel/exist/6.png) | ||
|
||
- 第7步,创建项目安装时的命令, `npm install && npx prisma generate && npx prisma migrate deploy` | ||
![第7步](/assets/readme/vercel/exist/7.png) | ||
|
||
- 第8步,创建新的部署 | ||
![第8步](/assets/readme/vercel/exist/8.png) | ||
|
||
- 第9步,选择要部署的git分支 | ||
![第9步](/assets/readme/vercel/exist/9.png) | ||
|
||
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/unilei/aipan-netdisk-search.git&project-name=aipan-netdisk-search&repository-name=aipan-netdisk-search) | ||
|
||
### 在 Vercel 上手动部署 操作方法 | ||
|
||
``` | ||
1. fork 本项目 | ||
2. 在 [Vercel] 官网点击 [New Project] | ||
3. 点击 [Import Git Repository] 并选择你 fork 的此项目并点击 [import] | ||
4. 然后直接点 [Deploy] 接着等部署完成即可 | ||
``` | ||
|
||
|
||
### 打赏 | ||
![打赏](/assets/donation/wechat_pay.jpg) | ||
|
||
### 交流 | ||
![交流](/assets/readme/wechat.jpg) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
[ | ||
{ | ||
"api": "/api/sources/aipan-search" | ||
}, | ||
{ | ||
"api": "/api/sources" | ||
}, | ||
|
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,18 @@ | ||
import pg from "pg"; | ||
import { PrismaPg } from "@prisma/adapter-pg"; | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
const connectionString = `${process.env.DATABASE_URL}`; | ||
const connectionSchema = `${process.env.DATABASE_SCHEMA}`; | ||
|
||
const pool = new pg.Pool({ | ||
connectionString, | ||
}); | ||
|
||
const adapter = new PrismaPg(pool, { | ||
schema: connectionSchema, | ||
}); | ||
|
||
const prisma = new PrismaClient({ adapter }); | ||
|
||
export default prisma; |
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,5 @@ | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
const prisma = new PrismaClient(); | ||
|
||
export default prisma; |
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,8 @@ | ||
export default defineNuxtRouteMiddleware((to, from) => { | ||
const token = useCookie("token", { | ||
maxAge: 60 * 60 * 24, | ||
}); | ||
if (!token.value) { | ||
return navigateTo("/login"); | ||
} | ||
}); |
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
Oops, something went wrong.