mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 04:16:47 +08:00
-- bug
This commit is contained in:
1
.env
1
.env
@@ -1,6 +1,7 @@
|
|||||||
VITE_BASE=/manage
|
VITE_BASE=/manage
|
||||||
VITE_BASE_API=/
|
VITE_BASE_API=/
|
||||||
VITE_PROXY_URL=http://111.231.196.214:30001/
|
VITE_PROXY_URL=http://111.231.196.214:30001/
|
||||||
|
VITE_LOGIN_URL=https://u-pre.boe.com/web
|
||||||
|
|
||||||
|
|
||||||
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=
|
||||||
|
|||||||
1
.env.boe
1
.env.boe
@@ -1,6 +1,7 @@
|
|||||||
VITE_BASE=/fe-student
|
VITE_BASE=/fe-student
|
||||||
VITE_BASE_API=/manageApi
|
VITE_BASE_API=/manageApi
|
||||||
|
|
||||||
|
|
||||||
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_BOE_CASS_DETAIL_URL=https://u-pre.boe.com/pc/case/detail?id=
|
VITE_BOE_CASS_DETAIL_URL=https://u-pre.boe.com/pc/case/detail?id=
|
||||||
VITE_BOE_TEST_DETAIL_URL=https://u-pre.boe.com/web/quizsummary?detailId=
|
VITE_BOE_TEST_DETAIL_URL=https://u-pre.boe.com/web/quizsummary?detailId=
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
VITE_BASE=/fe-student-release
|
VITE_BASE=/fe-student-release
|
||||||
VITE_BASE_API=/manageApi-release
|
VITE_BASE_API=/manageApi-release
|
||||||
|
VITE_LOGIN_URL=https://u.boe.com/web
|
||||||
|
|
||||||
|
|
||||||
VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc-release/course/studyindex?id=
|
VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc-release/course/studyindex?id=
|
||||||
VITE_BOE_CASS_DETAIL_URL=https://u.boe.com/pc-release/case/detail?id=
|
VITE_BOE_CASS_DETAIL_URL=https://u.boe.com/pc-release/case/detail?id=
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
* @FilePath: /fe-manage/src/api/config.js
|
* @FilePath: /fe-manage/src/api/config.js
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
*/
|
*/
|
||||||
import { message } from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import router from "@/router";
|
||||||
// import { getCookie } from '../api/method'
|
// import { getCookie } from '../api/method'
|
||||||
// const Qs = require("qs");
|
// const Qs = require("qs");
|
||||||
|
|
||||||
@@ -16,61 +17,60 @@ import axios from "axios";
|
|||||||
|
|
||||||
axios.defaults.withCredentials = true;
|
axios.defaults.withCredentials = true;
|
||||||
const http = axios.create({
|
const http = axios.create({
|
||||||
baseURL: process.env.VITE_BASE_API,
|
baseURL: process.env.VITE_BASE_API,
|
||||||
timeout: 1000 * 15,
|
timeout: 1000 * 15,
|
||||||
// headers: { "Content-Type": "multipart/form-data" },
|
// headers: { "Content-Type": "multipart/form-data" },
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: {"Content-Type": "application/json"},
|
||||||
});
|
});
|
||||||
|
|
||||||
http.interceptors.request.use(
|
http.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
// console.log("config", config);
|
// console.log("config", config);
|
||||||
// const token = localStorage.getItem("token");
|
// const token = localStorage.getItem("token");
|
||||||
// // const token = getCookie('token')
|
// // const token = getCookie('token')
|
||||||
// // console.log('token', token)
|
// // console.log('token', token)
|
||||||
// if (token) {
|
// if (token) {
|
||||||
// config.headers.token = token; //测试1111
|
// config.headers.token = token; //测试1111
|
||||||
// } else {
|
// } else {
|
||||||
// console.log("当前请求页面无token,请执行操作!!!");
|
// console.log("当前请求页面无token,请执行操作!!!");
|
||||||
|
|
||||||
// // 此处测试默认配置token
|
// // 此处测试默认配置token
|
||||||
// config.headers.token =
|
// config.headers.token =
|
||||||
// "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzAxNTMxMDMsImV4cCI6MTY3MDE2MDMwMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.c937b2d3a59cbab2136fdde55fd38f06bdff041212aab0fa6741bc4be41e28a7";
|
// "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzAxNTMxMDMsImV4cCI6MTY3MDE2MDMwMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.c937b2d3a59cbab2136fdde55fd38f06bdff041212aab0fa6741bc4be41e28a7";
|
||||||
// // }
|
// // }
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
console.log("登陆前拦截", err);
|
console.log("登陆前拦截", err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
http.interceptors.response.use(
|
http.interceptors.response.use(
|
||||||
(response) => {
|
(response) => {
|
||||||
// console.log('response', response)
|
// console.log('response', response)
|
||||||
const {
|
const {
|
||||||
data: { code, msg },
|
data: {code, msg},
|
||||||
} = response;
|
} = response;
|
||||||
// console.log('code', code)
|
// console.log('code', code)
|
||||||
if (code === 0 || code === 200) {
|
if (code === 0 || code === 200) {
|
||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
if (code === 1000) {
|
if (code === 1000) {
|
||||||
window.open("https://u-pre.boe.com/web/", '_self');
|
process.env.NODE_ENV === 'development' ? router.push({path: 'login'}) : (window.location.href = process.env.VITE_LOGIN_URL)
|
||||||
// window.open("http://111.231.196.214:12013/manage/login", '_self');
|
}
|
||||||
}
|
console.log("api %o", msg);
|
||||||
console.log("api %o", msg);
|
}
|
||||||
|
return response;
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
if (error.message == "timeout of 1ms exceeded") {
|
||||||
|
message.destroy();
|
||||||
|
message.error("请求超时");
|
||||||
|
}
|
||||||
|
console.log("api error %o", error);
|
||||||
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
return response;
|
|
||||||
},
|
|
||||||
function (error) {
|
|
||||||
if (error.message == "timeout of 1ms exceeded") {
|
|
||||||
message.destroy();
|
|
||||||
message.error("请求超时");
|
|
||||||
}
|
|
||||||
console.log("api error %o", error);
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
export default http;
|
export default http;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
const {defineConfig} = require("@vue/cli-service");
|
const {defineConfig} = require("@vue/cli-service");
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
publicPath: process.env.VITE_BASE,
|
publicPath: "/manage",
|
||||||
// transpileDependencies: true,
|
// transpileDependencies: true,
|
||||||
devServer: {
|
devServer: {
|
||||||
port: 8080,
|
port: 8080,
|
||||||
|
|||||||
Reference in New Issue
Block a user