From 2396f13d01c207985c083a47f556a11aafb188de Mon Sep 17 00:00:00 2001 From: xiaoshiguang123 Date: Tue, 5 Nov 2019 10:39:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:zap:=20=E5=B0=81=E8=A3=85axios=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=83=A8=E5=88=86=E9=87=8D=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 + src/api/index.js | 43 +++++ src/components/admin/admin.vue | 2 - src/components/admin/changeEntrance.vue | 18 +- src/components/admin/changeInformation.vue | 4 - src/components/admin/manageEntrance.vue | 46 ++--- src/components/admin/manageInformation.vue | 41 ++--- src/components/admin/manageLost.vue | 46 ++--- src/components/admin/manageRepair.vue | 44 ++--- src/components/admin/manageSecond.vue | 34 ++-- src/components/common/UpLoader.vue | 7 +- src/components/common/avatarUp.vue | 7 +- src/components/common/view.vue | 1 - src/components/information/entrance.vue | 17 +- src/components/information/information.vue | 23 +-- src/components/login/login.vue | 37 +--- src/components/login/register.vue | 45 ++--- src/components/lost/changelost.vue | 4 - src/components/lost/lost.vue | 19 +- src/components/lost/lostdetails.vue | 2 +- src/components/repair/changerepair.vue | 18 +- src/components/repair/repair.vue | 18 +- src/components/repair/repairdetails.vue | 2 +- src/components/second/changesecond.vue | 4 - src/components/second/second.vue | 10 +- src/components/setting/apps/account.vue | 23 +-- src/components/setting/apps/avatar.vue | 2 - src/components/setting/apps/myLost.vue | 32 ++-- src/components/setting/apps/myRepair.vue | 36 ++-- src/components/setting/apps/mySecond.vue | 34 ++-- src/components/setting/apps/school.vue | 1 - src/components/setting/setting.vue | 1 - src/main.js | 13 +- src/router/index.js | 1 - src/utils/http.js | 203 +++++++++++++++++++++ 35 files changed, 453 insertions(+), 391 deletions(-) create mode 100644 src/api/index.js create mode 100644 src/utils/http.js diff --git a/README.md b/README.md index 9781b71..f3b3f57 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,12 @@ 1. 添加路由守卫,不登录无法随意跳转页面 +### 2019.11.4 + +1. 开始优化项目结构,修改部分冗余代码. +2. 封装axios +3. 预计升级项目所需依赖.(暂时搁置) + ### 完成所有功能 ## 目前出现的BUG及解决方法 diff --git a/src/api/index.js b/src/api/index.js new file mode 100644 index 0000000..79deb88 --- /dev/null +++ b/src/api/index.js @@ -0,0 +1,43 @@ +export default { + api:{ + user:{ + login: "/user/login", + register: "/user/register", + update: "/user/update", + }, + test:{ + updateTest: "/test/updateTest", + deleteTest:"/test/deleteTest", + insertTest:"/test/insertTest", + checkcollege: "/test/checkcollege", + + }, + testtell:{ + updateTell: "/testtell/updateTell", + checkTell: "/testtell/checkTell", + deleteTell:"/testtell/deleteTell", + + }, + lf:{ + testAllLost:"/lf/testAllLost", + testAllFound:"/lf/testAllFound", + testDeleteTo:"/lf/testDeleteTo", + testAllThing:"/lf/testAllThing", + testDeleteTo:"/lf/testDeleteTo", + }, + record:{ + wwmessmy:"/record/wwmessmy", + wymessmy:"/record/wymessmy", + deleteTo:"/record/deleteTo", + delByW:"/record/delByW", + rmess:"/record/rmess", + rmessmy:"/record/rmessmy", + }, + trade:{ + rmess:"/trade/rmess", + deleteTo:"/trade/deleteTo", + rmessmy:"/trade/rmessmy", + deleteTo:"/trade/deleteTo", + } + } +} diff --git a/src/components/admin/admin.vue b/src/components/admin/admin.vue index 5ccd702..6e30770 100644 --- a/src/components/admin/admin.vue +++ b/src/components/admin/admin.vue @@ -14,8 +14,6 @@