From 71d670b862b675fa352b5e006831ee04f3e26251 Mon Sep 17 00:00:00 2001 From: wuyize Date: Wed, 29 Jun 2022 22:01:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E6=90=AD=E5=BB=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 4 +- src/utils/baseUrl.js | 4 +- src/utils/request.js | 22 +-- src/views/Home.vue | 250 +++++++---------------------------- src/views/Login.vue | 13 +- src/views/OngoingProject.vue | 121 +++++++++++++++++ 6 files changed, 184 insertions(+), 230 deletions(-) create mode 100644 src/views/OngoingProject.vue diff --git a/src/router/index.js b/src/router/index.js index 26333fd..5326abe 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,7 +3,7 @@ import Home from '@/views/Home.vue' import {createWebHistory} from "vue-router/dist/vue-router.esm-browser" import Login from "@/views/Login.vue" import Project from "@/views/Project.vue"; - +import OngoingProject from "../views/OngoingProject"; const routes = [ { path: '/', @@ -12,7 +12,7 @@ const routes = [ children: [ { path: '', - component: Project, + component: OngoingProject, }, ], }, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index b6b3867..fcf28aa 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -1,3 +1,3 @@ -//const baseUrl = "http://localhost:8090/" -const baseUrl = "http://36.5.61.1:8081/" +const baseUrl = "http://192.168.31.194:8081/" +//const baseUrl = "http://36.5.61.1:8081/" export default baseUrl; \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 40b3e2b..b70a465 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -20,27 +20,15 @@ request.interceptors.request.use( request.interceptors.response.use( function (response) { // 2xx 范围内的状态码都会触发该函数。 - console.log("success") - if(localStorage.getItem('expire')) - { - let time = new Date().getTime() - Number(localStorage.getItem('expire')) - if(time > 30*60*1000) - { - request({ - url: '/api/refreshToken', - method: 'get', - }).then(response => { - console.log(response.data) - localStorage.setItem('token', response.data) - localStorage.setItem('expire', new Date().getTime().toString()) - }) - } - } + console.log("SUCCESS") + return response }, function (error) { - console.log( error.response.status) + console.log("ERROR") + console.log(error.response) //if(error.response.status===403) //router.push({path: '/login'}) + return Promise.reject(error) }); export default request diff --git a/src/views/Home.vue b/src/views/Home.vue index 3eea1d1..9781142 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,85 +1,55 @@ -