Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Commit 61d026c

Browse files
committed
删除不必要的路由,清理垃圾代码
1 parent 18712f8 commit 61d026c

File tree

15 files changed

+77
-351
lines changed

15 files changed

+77
-351
lines changed
-172 KB
Binary file not shown.

backend/UserStorage/admin/test/crud.py

-125
This file was deleted.
-172 KB
Binary file not shown.
Binary file not shown.

backend/UserStorage/admin/test2/crud.py

-125
This file was deleted.

backend/src/api/users.py

+10
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,13 @@ async def register(user: UserCreate, db: Session = Depends(get_db)):
111111
access_token=access_token,
112112
)
113113
return response
114+
115+
116+
@router.get("/getAsyncRoutes")
117+
async def get_async_routes():
118+
router = {
119+
"path": "/file",
120+
"meta": {"title": "其他", "icon": "folder", "rank": 10},
121+
}
122+
123+
return {"success": True, "data": [router]}

backend/src/db/sql.db

-48 KB
Binary file not shown.

backend/src/settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def db_url(self) -> URL:
2525

2626
# 从环境变量中读取配置
2727
class Settings(BaseSettings):
28-
# ROOT_PATH: str = "/usr/src/app"
29-
ROOT_PATH: str = "/root/workspace/fileflow/backend"
28+
ROOT_PATH: str = "/usr/src/app"
29+
# ROOT_PATH: str = "/root/workspace/fileflow/backend"
3030
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{ROOT_PATH}/src/db/sql.db"
3131
DEFAULT_CAPACITY: int = Field(1024 * 1024 * 1024 * 1024, env="DEFAULT_CAPACITY")
3232
ALGORITHM: str = Field("HS256", env="ALGORITHM")

backend/src/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def get_file_path(
103103
file_path = item.name
104104
while True:
105105
parent_item = crud.get_item(db, item.parent_id)
106+
if parent_item is None:
107+
return ""
106108
if parent_item.parent_id == 0:
107109
break
108110
file_path: str = f"{parent_item.name}/{file_path}"

frontend/src/api/routes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ type Result = {
66
};
77

88
export const getAsyncRoutes = () => {
9-
return http.request<Result>("get", "/getAsyncRoutes");
9+
return http.request<Result>("get", "api/getAsyncRoutes");
1010
};

frontend/src/api/user.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const getRegister = (data?: object) => {
4444
password: data["password"],
4545
email: "test@test",
4646
};
47-
return http.request<UserResult>("post", baseUrlApi("api/register"), { data:reg_data, headers: { "Content-Type": "application/json" } });
47+
return http.request<UserResult>("post", baseUrlApi("api/register"), { data: reg_data, headers: { "Content-Type": "application/json" } });
4848
};
4949

5050
/** 刷新token */

frontend/src/layout/components/setting/index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ onBeforeMount(() => {
240240
:inactive-icon="darkIcon"
241241
@change="dataThemeChange"
242242
/>
243-
243+
<!--
244244
<el-divider>导航栏模式</el-divider>
245245
<ul class="pure-theme">
246246
<el-tooltip
@@ -384,13 +384,13 @@ onBeforeMount(() => {
384384
</el-radio-group>
385385
</li>
386386
</ul>
387-
387+
-->
388388
<el-divider />
389389
<el-button
390390
type="danger"
391391
style="width: 90%; margin: 24px 15px"
392392
@click="onReset"
393-
>
393+
>
394394
<IconifyIconOffline
395395
:icon="Logout"
396396
width="15"

frontend/src/router/modules/error.ts

-36
This file was deleted.

frontend/src/views/welcome/index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ const columns: TableColumnList = [
240240
</div>
241241
<div>
242242

243-
<el-button type="primary" icon="el-icon-download" @click="handleNewFolder">新建文件夹</el-button>
244-
<el-button type="primary" icon="el-icon-download" @click="handleDownload">下载</el-button>
245-
<el-button type="primary" icon="el-icon-download" @click="handleUpload">上传</el-button>
243+
<el-button type="primary" @click="handleNewFolder">新建文件夹</el-button>
244+
<el-button type="primary" @click="handleDownload">下载</el-button>
245+
<el-button type="primary" @click="handleUpload">上传</el-button>
246246
</div>
247247
</div>
248248
</template>

0 commit comments

Comments
 (0)