diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 7409d23..af17996 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -15,11 +15,14 @@ declare module 'vue' { ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] + ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElEmpty: typeof import('element-plus/es')['ElEmpty'] + ElForm: typeof import('element-plus/es')['ElForm'] + ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElInput: typeof import('element-plus/es')['ElInput'] ElOption: typeof import('element-plus/es')['ElOption'] diff --git a/frontend/src/api/login.ts b/frontend/src/api/login.ts new file mode 100644 index 0000000..868c54d --- /dev/null +++ b/frontend/src/api/login.ts @@ -0,0 +1,14 @@ +//进行接口API的统一管理 +import { request } from "./axios"; + +export class login { + /** + * @description 获取article文章详情 + * @param {string} account - 账号 + * @param {string} password - 密码 + * @return {Promise} 返回请求结果 + */ + static async goLogin(account: string, password: string) { + return request("/index/user/login", { account,password }, "post"); + } +} diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index b7b4e19..f0ac64e 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -52,6 +52,11 @@ const router = createRouter({ name: "search", component: () => import("@/views/components/search.vue"), }, + { + path: "/login", + name: "login", + component: () => import("@/views/login/index.vue"), + }, ], }); diff --git a/frontend/src/views/components/header.vue b/frontend/src/views/components/header.vue index 2ef9a96..3fdf3a3 100644 --- a/frontend/src/views/components/header.vue +++ b/frontend/src/views/components/header.vue @@ -1,5 +1,5 @@ +
+ + 登录 + +
@@ -303,6 +357,16 @@ const handleCommand = (command: string) => { } } } + + .login-section { + flex-shrink: 0; + + .el-button { + height: 32px; + padding: 0 16px; + font-size: 14px; + } + } } } } @@ -334,6 +398,14 @@ const handleCommand = (command: string) => { .username { display: none; // 小屏幕隐藏用户名 } + + .login-section { + .el-button { + height: 28px; + padding: 0 12px; + font-size: 13px; + } + } } } } diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue new file mode 100644 index 0000000..70d8d42 --- /dev/null +++ b/frontend/src/views/login/index.vue @@ -0,0 +1,299 @@ + + + + +