From 33e66e6ef0e16b972d8001c8d234ca50c77fb512 Mon Sep 17 00:00:00 2001 From: callmeyan Date: Tue, 6 Dec 2022 17:54:26 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=AE=8C=E6=88=90=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=9F=BA=E6=9C=AC=E6=93=8D=E4=BD=9C=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0modal=E9=9B=8F=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-fe/src/components/modal/index.ts | 3 + admin-fe/src/components/modal/modal.vue | 66 ++++++++++++++++++++++ admin-fe/src/main.ts | 2 + admin-fe/src/util/http.ts | 12 ++-- admin-fe/src/views/user/index.vue | 74 ++++++++++++++++++++++++- 5 files changed, 148 insertions(+), 9 deletions(-) create mode 100644 admin-fe/src/components/modal/index.ts create mode 100644 admin-fe/src/components/modal/modal.vue diff --git a/admin-fe/src/components/modal/index.ts b/admin-fe/src/components/modal/index.ts new file mode 100644 index 0000000..d0115fb --- /dev/null +++ b/admin-fe/src/components/modal/index.ts @@ -0,0 +1,3 @@ +import Modal from './modal.vue'; + +export default Modal \ No newline at end of file diff --git a/admin-fe/src/components/modal/modal.vue b/admin-fe/src/components/modal/modal.vue new file mode 100644 index 0000000..73fe993 --- /dev/null +++ b/admin-fe/src/components/modal/modal.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/admin-fe/src/main.ts b/admin-fe/src/main.ts index 8f28e57..0eced11 100644 --- a/admin-fe/src/main.ts +++ b/admin-fe/src/main.ts @@ -5,6 +5,7 @@ import App from './App.vue' import router from './router' import {httpConfig} from "./util/http"; import './assets/app.css' +import PInput from "./components/input"; httpConfig.baseURL = "http://localhost:8080" @@ -12,5 +13,6 @@ const app = createApp(App) // 使用路由 app.use(router) app.use(createPinia()); +app.component('PInput',PInput) // 将应用实例挂载到 模板中 app.mount('#vue-root-app') \ No newline at end of file diff --git a/admin-fe/src/util/http.ts b/admin-fe/src/util/http.ts index f4cc384..88f6ea6 100644 --- a/admin-fe/src/util/http.ts +++ b/admin-fe/src/util/http.ts @@ -1,6 +1,5 @@ import {toast} from "../components/message"; import {useUserStore} from "../service/store"; -import {useRoute, useRouter} from "vue-router"; export type HttpMethod = 'get' | 'post' | 'delete' | 'put' @@ -77,7 +76,8 @@ class Http { for (const key in data) { params.push(`${key}=${data[key]}`); } - data = params.join('&') + data = null; + url += '?' + params.join('&') } } @@ -86,7 +86,6 @@ class Http { } const token = useUserStore().token(); if (token) headers.token = token - const r = useRoute(), router = useRouter(); fetch(httpConfig.baseURL + url, { method, body: data, @@ -100,9 +99,9 @@ class Http { // 需要统一处理数据 if (code === 403) { toast("登录凭证无效或者已过期") - if (r.fullPath != '/login') { - router.replace('/login'); - } + // if (r.fullPath != '/login') { + // router.replace('/login'); + // } return; } else if (err) { toast(httpConfig.globalErrorHandler[code]) @@ -114,7 +113,6 @@ class Http { resolve(res.data) }) .catch(() => { - }) }); } diff --git a/admin-fe/src/views/user/index.vue b/admin-fe/src/views/user/index.vue index 05e8de2..21eaa0d 100644 --- a/admin-fe/src/views/user/index.vue +++ b/admin-fe/src/views/user/index.vue @@ -24,17 +24,42 @@ {{ u.pointInfo?.totalPoint }} {{ u.firstLoginTime }} - 编辑 + 编辑 禁用 - 删除 + 删除 + +
+
+ 昵称 +

+ +

+
+
+ 省份 +

+ +

+
+
+ 城市 +

+ +

+
+ +
+