diff --git a/front-end/XDShare-FE/.gitignore b/front-end/XDShare-FE/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..574a4987f21eb938c49a8e7ff75cfe5a7c4d44cf --- /dev/null +++ b/front-end/XDShare-FE/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +components.d.ts +.vite \ No newline at end of file diff --git a/front-end/XDShare-FE/README.md b/front-end/XDShare-FE/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c02eb704a154a04e5eeeb3445f95631956df4c48 --- /dev/null +++ b/front-end/XDShare-FE/README.md @@ -0,0 +1,46 @@ +# XDShare-FE + +## 版本 +Node v18.20.0 +npm v10.5.0 + +安装依赖: `npm install` + +本地运行: `npm run dev` + +构建: `npm run build` + +## 主要依赖 + - vue3 & vue-router4 & vuex4 + - Typescript + - less + - ant-design-vue + - axios & qs + +## 目录说明 +src +├─api # 接口 + +├─assets # 静态文件 + +├─components # 公用组件 + +├─constant # 常量 + +├─lib # 工具模块 + +├─pages # 页面 + +├─router # 路由 + +├─store # 状态管理 + +├─styles # 公用样式 + +└─types # 公用类型 + +## 规范 + +## 测试账号 +account: linds123 +password: 123456 \ No newline at end of file diff --git a/front-end/XDShare-FE/index.html b/front-end/XDShare-FE/index.html new file mode 100644 index 0000000000000000000000000000000000000000..173a0b72df5743fc0c3b0e79ed49c94f7ba2bc3d --- /dev/null +++ b/front-end/XDShare-FE/index.html @@ -0,0 +1,16 @@ + + + +
+ + + +
+ Edit
+ components/HelloWorld.vue
to test HMR
+
+ Check out + create-vue, the official Vue + Vite starter +
++ Install + Volar + in your IDE for a better DX +
+Click on the Vite and Vue logos to learn more
+ + + diff --git a/front-end/XDShare-FE/src/constant/index.ts b/front-end/XDShare-FE/src/constant/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..db635dcef4290e23be48f83ce15eb00b07107848 --- /dev/null +++ b/front-end/XDShare-FE/src/constant/index.ts @@ -0,0 +1,52 @@ +interface ITest {} + +type TTest = string; + +// 获取的文章详情类型 +export const ARTICLE_FETCH_TYPE: IEditConfig = { + CREATE: 0, + DETAIL: 1, +}; + +// 编辑中文章类型 +export const ARTICLE_EDIT_TYPE: IEditConfig = { + DRAFT: 0, // 存为草稿 + UPDATE: 1, // 更新草稿 + POST: 2, // 提交审核 +}; + +// 用户身份 +export enum UserTypeEnum { + ADMIN = 1, + USER = 2, +} + +// 文章状态 +export enum ArticleStatusEnum { + WAITING_FOR_APPROVAL = 0, + PASS = 1, + NOT_PASS = 2, + BAN = 3, + DRAFT = 4, + DELETED = 5, +} + +// 文章状态的中文名称 +export const ArticleStatusEnumLabel = { + [ArticleStatusEnum.WAITING_FOR_APPROVAL]: "等待审核", + [ArticleStatusEnum.PASS]: "审核通过", + [ArticleStatusEnum.NOT_PASS]: "审核不通过", + [ArticleStatusEnum.BAN]: "已封禁", + [ArticleStatusEnum.DRAFT]: "草稿", + [ArticleStatusEnum.DELETED]: "已删除", +}; + +// 文章状态展示的颜色 +export const ArticleStatusColor = { + [ArticleStatusEnum.WAITING_FOR_APPROVAL]: "blue", + [ArticleStatusEnum.PASS]: "green", + [ArticleStatusEnum.NOT_PASS]: "orange", + [ArticleStatusEnum.BAN]: "black", + [ArticleStatusEnum.DRAFT]: "orange", + [ArticleStatusEnum.DELETED]: "red", +}; diff --git a/front-end/XDShare-FE/src/lib/imgHelper.ts b/front-end/XDShare-FE/src/lib/imgHelper.ts new file mode 100644 index 0000000000000000000000000000000000000000..5791926391ca26510a7496b326e9078de28e5662 --- /dev/null +++ b/front-end/XDShare-FE/src/lib/imgHelper.ts @@ -0,0 +1,5 @@ +export const getBase64 = (img: Blob, callback: (base64Url: string) => void) => { + const reader = new FileReader(); + reader.addEventListener("load", () => callback(reader.result as string)); + reader.readAsDataURL(img); +}; diff --git a/front-end/XDShare-FE/src/main.ts b/front-end/XDShare-FE/src/main.ts new file mode 100644 index 0000000000000000000000000000000000000000..ba50fa22c8417a31d522dd3088ac1f62a4826937 --- /dev/null +++ b/front-end/XDShare-FE/src/main.ts @@ -0,0 +1,6 @@ +import { createApp } from "vue"; +import "@/styles/common.less"; +import App from "./App.vue"; +import router from "./router"; + +createApp(App).use(router).mount("#app"); diff --git a/front-end/XDShare-FE/src/pages/Home/Header/index.vue b/front-end/XDShare-FE/src/pages/Home/Header/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..481771617acbd6751b0618a9f005b9224a2eb0a1 --- /dev/null +++ b/front-end/XDShare-FE/src/pages/Home/Header/index.vue @@ -0,0 +1,124 @@ + +您所做的编辑或修改不会做任何保存
++ {{ detail.text }} +
+