diff --git a/.env.development b/.env.development index 9f37959..706d429 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,2 @@ VITE_BASE_URL='' -VITE_BASE_PATH=/api \ No newline at end of file +VITE_BASE_PATH=/apis \ No newline at end of file diff --git a/.env.production b/.env.production index fbe8955..c8111fb 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ -VITE_BASE_URL='https://api.wodeschool.com' +VITE_BASE_URL='http://w3.myschools.me' VITE_BASE_PATH='' \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 98240ae..b5b4e0b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,3 +1,14 @@ + + \ No newline at end of file diff --git a/src/api/request.js b/src/api/request.js index 83b90da..15a8b2d 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -25,13 +25,11 @@ service.interceptors.request.use( // 响应拦截器 service.interceptors.response.use( response => { - const res = response.data; - // 假设统一应答数据结构中有一个 code 字段表示请求状态 - if (res.code !== 2) { - console.log('请求失败:', res); - return Promise.reject(new Error(res.msg || 'Error')); + // 检查 HTTP 状态码 + if (response.status === 200) { + return response.data; } else { - return res.data; + return Promise.reject(new Error(response.message || 'Error')); } }, error => { diff --git a/src/main.js b/src/main.js index f65c35f..0067848 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,4 @@ import { createApp } from 'vue' -import './style.css' import App from './App.vue' import axios from 'axios' import ElementPlus from 'element-plus' @@ -12,7 +11,7 @@ const app=createApp(App) app.use(pinia) app.use(router) -app.use(ElementPlus) +app.use(ElementPlus, { size: 'large', zIndex: 2000 }) app.config.globalProperties.$axios=axios app.mount('#app') diff --git a/src/style.css b/src/style.css deleted file mode 100644 index f691315..0000000 --- a/src/style.css +++ /dev/null @@ -1,79 +0,0 @@ -:root { - font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -.card { - padding: 2em; -} - -#app { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} diff --git a/src/views/about.vue b/src/views/about.vue index cb9eff6..677b87d 100644 --- a/src/views/about.vue +++ b/src/views/about.vue @@ -1,4 +1,69 @@