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

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) {