diff --git a/src/api/user.ts b/src/api/user.ts
new file mode 100644
index 0000000..cebb207
--- /dev/null
+++ b/src/api/user.ts
@@ -0,0 +1,10 @@
+import request from '../utils/request'
+const authorize = (params: any) => {
+ return request({
+ url: '/api/vi/authorize',
+ method: 'post',
+ data: {}
+ })
+}
+
+export { authorize }
\ No newline at end of file
diff --git a/src/components/layout/NavBar.vue b/src/components/layout/NavBar.vue
index 0e647d6..6cd100e 100644
--- a/src/components/layout/NavBar.vue
+++ b/src/components/layout/NavBar.vue
@@ -12,13 +12,13 @@
删除
-->
- 小管
-
+ 登录
\ No newline at end of file
+
+const resetForm = (formEl: FormInstance | undefined) => {
+ if (!formEl) return
+ formEl.resetFields()
+}
+
+
diff --git a/src/main.ts b/src/main.ts
index 1f78b34..ad4a326 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -15,13 +15,13 @@ app.use(router)
app.use(ElementPlus)
app.use(store)
-
+import { getToken } from './utils/auth'
const whiteList = ['/', '/blog']
let url = window.location.href
console.log(url)
if (url != 'http://localhost:3000/' && url.search("blog=") != -1) {
let blog = {
- blog_id: 1
+ blog_id: url.split("=")[1]
}
router.push({
path: '/feedback',
@@ -30,6 +30,10 @@ if (url != 'http://localhost:3000/' && url.search("blog=") != -1) {
}
router.beforeEach((to, from, next) => {
console.log(to.path, from.path)
+ if (to.path === '/login') {
+ next()
+ }
+
if (whiteList.includes(to.path)) {
diff --git a/src/router/index.ts b/src/router/index.ts
index 1699036..cd165d4 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -73,7 +73,11 @@ const routes: Array = [
{
path: "/feedback",
component: () => import('../view/blog/mdview.vue')
- }
+ },
+ {
+ path: "/login",
+ component: () => import('../components/login/login.vue')
+ },
]
diff --git a/src/view/blog/mdview.vue b/src/view/blog/mdview.vue
index ce7150a..73b2cc3 100644
--- a/src/view/blog/mdview.vue
+++ b/src/view/blog/mdview.vue
@@ -4,13 +4,14 @@