From f14a62d114865d86af1e92f361060be31c092363 Mon Sep 17 00:00:00 2001 From: yutent Date: Sat, 14 Jan 2023 16:49:53 +0800 Subject: [PATCH] update --- package.json | 2 +- src/lib/fetch.js | 11 +++++++ src/router.js | 5 +++ src/views/login.vue | 78 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 src/lib/fetch.js create mode 100644 src/views/login.vue diff --git a/package.json b/package.json index 2983806..5d95604 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "start": "vue-live dev", "build": "vue-live build" }, - "dependencies": { + "devDependencies": { "@bytedo/vue-live": "^0.0.13" } } diff --git a/src/lib/fetch.js b/src/lib/fetch.js new file mode 100644 index 0000000..61419d3 --- /dev/null +++ b/src/lib/fetch.js @@ -0,0 +1,11 @@ +import fetch from 'fetch' + +fetch.BASE_URL = '//api.jscdn.ink' + +fetch.inject.request(function (conf) { + conf.headers['content-type'] = 'application/json' +}) + +fetch.inject.response(r => r.json()) + +export default fetch diff --git a/src/router.js b/src/router.js index 7a351f6..5583cfe 100644 --- a/src/router.js +++ b/src/router.js @@ -18,6 +18,11 @@ const router = createRouter({ path: '/request', name: 'request', component: () => import('./views/request.vue') + }, + { + path: '/login', + name: 'login', + component: () => import('./views/login.vue') } ] }) diff --git a/src/views/login.vue b/src/views/login.vue new file mode 100644 index 0000000..346922c --- /dev/null +++ b/src/views/login.vue @@ -0,0 +1,78 @@ + + + + +