- Home
-
-
-
-
-
\ No newline at end of file
diff --git a/admin-fe/src/assets/app.css b/admin-fe/src/assets/app.css
new file mode 100644
index 0000000..d81191c
--- /dev/null
+++ b/admin-fe/src/assets/app.css
@@ -0,0 +1,19 @@
+:root {
+ --primary-color: #fff;
+ --primary-color-text: #333;
+ --font-size: 14px;
+}
+
+* {
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 'Source Han Sans SC', 'Microsoft YaHei', 'Microsoft YaHei UI', "Helvetica Neue", sans-serif;
+ scroll-behavior: smooth;
+}
+.container{
+ max-width: 1200px;
+ margin: auto;
+}
diff --git a/admin-fe/src/main.ts b/admin-fe/src/main.ts
index bad7cdc..11f5de3 100644
--- a/admin-fe/src/main.ts
+++ b/admin-fe/src/main.ts
@@ -1,6 +1,10 @@
import {createApp} from 'vue';
import App from './App.vue'
import router from './router'
+import {httpConfig} from "./util/http";
+
+
+httpConfig.baseURL = "http://localhost:8080"
const app = createApp(App)
// 使用路由
diff --git a/admin-fe/src/router/routes.ts b/admin-fe/src/router/routes.ts
index e231749..543d9d1 100644
--- a/admin-fe/src/router/routes.ts
+++ b/admin-fe/src/router/routes.ts
@@ -1,6 +1,7 @@
import {RouteRecordRaw} from "vue-router";
-import Home from './../Home.vue'
-import User from './../User.vue'
+import Home from '../views/admin/Home.vue'
+import Login from '../views/Login.vue'
+import NotFound from '../views/NotFound.vue'
const routes: RouteRecordRaw[] = [
{
@@ -8,8 +9,12 @@ const routes: RouteRecordRaw[] = [
component: Home
},
{
- path: '/user',
- component: User
+ path: '/login',
+ component: Login
+ },
+ {
+ path:'/:pathMatch(.*)*',
+ component: NotFound
}
]
diff --git a/admin-fe/src/util/http.ts b/admin-fe/src/util/http.ts
new file mode 100644
index 0000000..d0fc47a
--- /dev/null
+++ b/admin-fe/src/util/http.ts
@@ -0,0 +1,41 @@
+export type HttpMethod = 'get' | 'post' | 'delete' | 'put'
+
+export const httpConfig = {
+ baseURL: ''
+}
+export type ResponseModel = {
+ code: number
+ message: string
+ data: T
+ trace?: string
+}
+
+class Http {
+ post(url, data) {
+ return this.request(url, 'post', data)
+ }
+
+ request(url: string, method: HttpMethod, data: any = null) {
+ return new Promise>((resolve, reject) => {
+
+ fetch(httpConfig.baseURL + url, {
+ method,
+ body: JSON.stringify(data),
+ headers: {
+ 'Content-Type': 'application/json;charset=utf-8'
+ }
+ })
+ .then(res => res.json()) // 只要json的响应数据
+ .then((res: ResponseModel) => {
+ if (res.code !== 0) {
+ reject(Error(res.message))
+ return;
+ }
+ resolve(res.data)
+ }).catch(reject)
+ });
+ }
+}
+
+const http = new Http();
+export default http
\ No newline at end of file
diff --git a/admin-fe/src/views/Login.vue b/admin-fe/src/views/Login.vue
new file mode 100644
index 0000000..7c4efd6
--- /dev/null
+++ b/admin-fe/src/views/Login.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin-fe/src/views/NotFound.vue b/admin-fe/src/views/NotFound.vue
new file mode 100644
index 0000000..9f9a491
--- /dev/null
+++ b/admin-fe/src/views/NotFound.vue
@@ -0,0 +1,18 @@
+
+
Not Found
+
+
+
+
+
\ No newline at end of file
diff --git a/admin-fe/src/Home.vue b/admin-fe/src/views/admin/Home.vue
similarity index 100%
rename from admin-fe/src/Home.vue
rename to admin-fe/src/views/admin/Home.vue