Browse Source

custom comment

WuXinyu 7 năm trước cách đây
mục cha
commit
2133f35d60
4 tập tin đã thay đổi với 7 bổ sung38 xóa
  1. 2 1
      src/api/user.js
  2. 0 26
      src/router.js
  3. 5 1
      src/router/index.js
  4. 0 10
      src/store.js

+ 2 - 1
src/api/user.js

@@ -3,7 +3,8 @@ import { USER_MODULE } from "./_prefix";
 
 /**
  * 获取用户数据
- * @returns {{avatar,username,nickname,bios}}
+ * @param userId
+ * @returns {Promise<{avatar:string,username:string,nickname:string,bios:string}>}
  */
 export const fetchUserAuthProfile = userId => {
   return request(`${USER_MODULE}/auth/${userId}`);

+ 0 - 26
src/router.js

@@ -1,26 +0,0 @@
-import Vue from "vue";
-import Router from "vue-router";
-import Home from "./views/Home.vue";
-
-Vue.use(Router);
-
-export default new Router({
-  mode: "history",
-  base: process.env.BASE_URL,
-  routes: [
-    {
-      path: "/",
-      name: "home",
-      component: Home
-    },
-    {
-      path: "/about",
-      name: "about",
-      // route level code-splitting
-      // this generates a separate chunk (about.[hash].js) for this route
-      // which is lazy-loaded when the route is visited.
-      component: () =>
-        import(/* webpackChunkName: "about" */ "./views/About.vue")
-    }
-  ]
-});

+ 5 - 1
src/router/index.js

@@ -9,7 +9,9 @@ import {
 
 Vue.use(Router);
 
-export default new Router({
+const router = new Router({
+  mode: "history",
+  base: process.env.BASE_URL,
   routes: [
     {
       path: "/login",
@@ -44,3 +46,5 @@ export default new Router({
     }
   ]
 });
+
+export default router;

+ 0 - 10
src/store.js

@@ -1,10 +0,0 @@
-import Vue from "vue";
-import Vuex from "vuex";
-
-Vue.use(Vuex);
-
-export default new Vuex.Store({
-  state: {},
-  mutations: {},
-  actions: {}
-});