This commit is contained in:
yuping
2022-12-14 19:31:46 +08:00
parent ffafa08e32
commit 60d6ffd55d
8 changed files with 16 additions and 9 deletions

6
.env
View File

@@ -1 +1,5 @@
VITE_BOE_ONLINE_CLASS_URL=https://u-pre.boe.com/pc/course/studyindex?id=
VITE_BOE_ONLINE_CLASS_URL=https://u-pre.boe.com/pc/course/studyindex?id=
VITE_BASE=/fe-student
VITE_BASE_API=
VITE_PROXY_URL=123

View File

@@ -1 +1,4 @@
VITE_BOE_ONLINE_CLASS_URL=https://u-pre.boe.com/pc/course/studyindex?id=
VITE_BOE_ONLINE_CLASS_URL=https://u-pre.boe.com/pc/course/studyindex?id=
VITE_BASE=/fe-student
VITE_BASE_API=/manageApi
VITE_PROXY_URL=

View File

@@ -1 +1,4 @@
VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc/course/studyindex?id=
VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc/course/studyindex?id=
VITE_BASE=/fe-student
VITE_BASE_API=/manageApi
VITE_PROXY_URL=

View File

@@ -5,7 +5,7 @@
"scripts": {
"dev": "vite",
"server": "vite build && vite preview",
"build": "vite build"
"build": "vite build --mode prod"
},
"dependencies": {
"axios": "^1.1.3",

View File

@@ -6,8 +6,6 @@
* @FilePath: /fe-stu/src/api/api.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export const BASE = import.meta.env.DEV ? '' : '/manageApi'
export const BASE_URL = import.meta.env.DEV ? '' : 'https://u-pre.boe.com/fe-student'
export const LOGIN = '/admin/CheckUser/userLogin post'
// export const FILE_UPLOAD = 'http://111.231.196.214:30001/file/upload'
export const FILE_UPLOAD = '/file/upload'

View File

@@ -89,7 +89,7 @@ export async function request(_url, params) {
'X-Token': localStorage.getItem('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
baseURL: BASE,
baseURL: import.meta.env.VITE_BASE_API,
...method !== 'get' ? {data: JSON.stringify(body)} : {}
}).then(resp => resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) {

View File

@@ -146,7 +146,6 @@ import completed from "../../assets/image/completed.png";
import ongoing from "../../assets/image/ongoing.png";
import {boeRequest, request, usePage, useRequest} from "@/api/request";
import {
BASE_URL,
ROUTER_CHAPTER_LIST,
ROUTER_LIST,
ROUTER_UNCOMPLETE_LIST,

View File

@@ -317,7 +317,7 @@ import medal2 from '@/assets/image/medal/medal2.png'
import medal3 from '@/assets/image/medal/medal3.png'
import img from '@/assets/image/uploadimg.png'
import {boeRequest, useRequest} from "@/api/request";
import {BASE_URL, ROUTER_PROCESS} from "@/api/api";
import {ROUTER_PROCESS} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {ElMessage} from 'element-plus'
import {useUserInfo} from "@/api/utils";