From 0dc9d032376f0bf5607ee508963dc2482780d188 Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Wed, 27 Nov 2024 16:43:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9E=84=E5=BB=BA=20login=20?= =?UTF-8?q?=E5=BE=AE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/http/apis/user/index.ts | 10 ++++++++++ src/http/apis/user/type.ts | 1 + src/pages/error/403.vue | 2 +- src/pages/error/404.vue | 2 +- .../error => pages/error/images}/403.svg | 0 .../error => pages/error/images}/404.svg | 0 .../apis/login => pages/login/apis}/index.ts | 8 -------- .../apis/login => pages/login/apis}/type.ts | 2 -- src/pages/login/components/Owl.vue | 12 ++++++------ .../login/images}/close-eyes.png | Bin .../login => pages/login/images}/face.png | Bin .../login/images}/hand-down-left.png | Bin .../login/images}/hand-down-right.png | Bin .../login/images}/hand-up-left.png | Bin .../login/images}/hand-up-right.png | Bin src/pages/login/index.vue | 9 ++++++--- src/pinia/stores/user.ts | 18 ++++++++---------- 17 files changed, 33 insertions(+), 31 deletions(-) create mode 100644 src/http/apis/user/index.ts create mode 100644 src/http/apis/user/type.ts rename src/{common/assets/images/error => pages/error/images}/403.svg (100%) rename src/{common/assets/images/error => pages/error/images}/404.svg (100%) rename src/{http/apis/login => pages/login/apis}/index.ts (73%) rename src/{http/apis/login => pages/login/apis}/type.ts (76%) rename src/{common/assets/images/login => pages/login/images}/close-eyes.png (100%) rename src/{common/assets/images/login => pages/login/images}/face.png (100%) rename src/{common/assets/images/login => pages/login/images}/hand-down-left.png (100%) rename src/{common/assets/images/login => pages/login/images}/hand-down-right.png (100%) rename src/{common/assets/images/login => pages/login/images}/hand-up-left.png (100%) rename src/{common/assets/images/login => pages/login/images}/hand-up-right.png (100%) diff --git a/src/http/apis/user/index.ts b/src/http/apis/user/index.ts new file mode 100644 index 00000000..53a57978 --- /dev/null +++ b/src/http/apis/user/index.ts @@ -0,0 +1,10 @@ +import type * as Login from "./type" +import { request } from "@/http/request" + +/** 获取当前登陆用户详情 */ +export function getUserInfoApi() { + return request({ + url: "users/info", + method: "get" + }) +} diff --git a/src/http/apis/user/type.ts b/src/http/apis/user/type.ts new file mode 100644 index 00000000..c3f50edf --- /dev/null +++ b/src/http/apis/user/type.ts @@ -0,0 +1 @@ +export type UserInfoResponseData = ApiResponseData<{ username: string, roles: string[] }> diff --git a/src/pages/error/403.vue b/src/pages/error/403.vue index 59b7bd53..db16d5bd 100644 --- a/src/pages/error/403.vue +++ b/src/pages/error/403.vue @@ -1,6 +1,6 @@