feat:增加动态获取协议(http/https)

This commit is contained in:
wyx
2023-02-03 17:19:14 +08:00
parent 7c194b2308
commit 160670c540
11 changed files with 43 additions and 43 deletions

14
.env
View File

@@ -2,16 +2,16 @@ VITE_BASE=/fe-student
VITE_BASE_API= VITE_BASE_API=
VITE_OUTPUT_DIR=./dist VITE_OUTPUT_DIR=./dist
VITE_FILE_PATH=/upload/ VITE_FILE_PATH=/upload/
VITE_BASE_LOGIN_URL=https://u-pre.boe.com/web/ VITE_BASE_LOGIN_URL=//u-pre.boe.com/web/
VITE_PROXY_URL=http://43.143.139.204/manageApi VITE_PROXY_URL=http://43.143.139.204/manageApi
VITE_BOE_ONLINE_CLASS_URL=https://u-pre.boe.com/pc/course/studyindex?id= VITE_BOE_ONLINE_CLASS_URL=//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=//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=//u-pre.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=https://u-pre.boe.com/api/b1/tale/do-quiz?quizKid= VITE_BOE_TEST_OUT_DETAIL_URL=//u-pre.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=https://u-pre.boe.com/pc/exam/test?id= VITE_BOE_EXAM_DETAIL_URL=//u-pre.boe.com/pc/exam/test?id=
VITE_BOE_PATH_DETAIL_URL=https://u-pre.boe.com/pc/forward?to=/fe-student VITE_BOE_PATH_DETAIL_URL=//u-pre.boe.com/pc/forward?to=/fe-student
VITE_BOE_API_URL=https://u-pre.boe.com VITE_BOE_API_URL=https://u-pre.boe.com

View File

@@ -1,10 +1,10 @@
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=//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=//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=//u-pre.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=https://u-pre.boe.com/api/b1/tale/do-quiz?quizKid= VITE_BOE_TEST_OUT_DETAIL_URL=//u-pre.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=https://u-pre.boe.com/pc/exam/test?id= VITE_BOE_EXAM_DETAIL_URL=//u-pre.boe.com/pc/exam/test?id=
VITE_BOE_API_URL=https://u-pre.boe.com VITE_BOE_API_URL=https://u-pre.boe.com

View File

@@ -1,15 +1,15 @@
VITE_BASE=/fe-student VITE_BASE=/fe-student
VITE_BASE_API=/manageApi VITE_BASE_API=/manageApi
VITE_BASE_LOGIN_URL=https://u.boe.com/web/ VITE_BASE_LOGIN_URL=//u.boe.com/web/
VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc/course/studyindex?id= VITE_BOE_ONLINE_CLASS_URL=//u.boe.com/pc/course/studyindex?id=
VITE_BOE_CASS_DETAIL_URL=https://u.boe.com/pc/case/detail?id= VITE_BOE_CASS_DETAIL_URL=//u.boe.com/pc/case/detail?id=
VITE_BOE_TEST_DETAIL_URL=https://u.boe.com/web/quizsummary?detailId= VITE_BOE_TEST_DETAIL_URL=//u.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=https://u.boe.com/api/b1/tale/do-quiz?quizKid= VITE_BOE_TEST_OUT_DETAIL_URL=//u.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=https://u.boe.com/pc/exam/test?id= VITE_BOE_EXAM_DETAIL_URL=//u.boe.com/pc/exam/test?id=
VITE_BOE_PATH_DETAIL_URL=https://u.boe.com/pc/forward?to=/fe-student VITE_BOE_PATH_DETAIL_URL=//u.boe.com/pc/forward?to=/fe-student
VITE_BOE_API_URL=https://u.boe.com VITE_BOE_API_URL=https://u.boe.com
VITE_TASK_WHITE_TYPE=-8-,-12-,-13- VITE_TASK_WHITE_TYPE==-22-

View File

@@ -1,12 +1,12 @@
VITE_BASE=/fe-student-release VITE_BASE=/fe-student-release
VITE_BASE_API=/manageApi-release VITE_BASE_API=/manageApi-release
VITE_BASE_LOGIN_URL=https://u.boe.com/web/ VITE_BASE_LOGIN_URL=//u.boe.com/web/
VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc-release/course/studyindex?id= VITE_BOE_ONLINE_CLASS_URL=//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=//u.boe.com/pc-release/case/detail?id=
VITE_BOE_TEST_DETAIL_URL=https://u.boe.com/web/quizsummary?detailId= VITE_BOE_TEST_DETAIL_URL=//u.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=https://u.boe.com/api/b1/tale/do-quiz?quizKid= VITE_BOE_TEST_OUT_DETAIL_URL=//u.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=https://u.boe.com/pc-release/exam/test?id= VITE_BOE_EXAM_DETAIL_URL=//u.boe.com/pc-release/exam/test?id=
VITE_BOE_PATH_DETAIL_URL=https://u.boe.com/pc-release/forward?to=/fe-student-release VITE_BOE_PATH_DETAIL_URL=//u.boe.com/pc-release/forward?to=/fe-student-release
VITE_BOE_API_URL=https://u.boe.com VITE_BOE_API_URL=https://u.boe.com

View File

@@ -1,4 +1,4 @@
export const BASE = 'https://u-pre.boe.com' export const BASE = window.location.protocol + '//u-pre.boe.com'
export const GET_USER_LIST = `/userbasic/user/list post` export const GET_USER_LIST = `/userbasic/user/list post`
export const GET_USER_INFO = `/userbasic/user/info post` export const GET_USER_INFO = `/userbasic/user/info post`

View File

@@ -98,7 +98,7 @@ export async function request(_url, params) {
}).then(resp => resp.data).then(response => { }).then(resp => resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) { if (response.code !== 200 && response.code !== 0) {
if (response.code === 1000) { if (response.code === 1000) {
(import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL, '_top') (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL, '_top')
} }
if (response.code === 2001) { if (response.code === 2001) {
router.push({path: '/FaceTeachSignUp', query: {courseId: router.currentRoute.value.query.courseId,type:3}}) router.push({path: '/FaceTeachSignUp', query: {courseId: router.currentRoute.value.query.courseId,type:3}})

View File

@@ -61,7 +61,7 @@ function toDetail(i) {
query: {routerId: props.detail.routerId, routerName: props.detail.routerName}, query: {routerId: props.detail.routerId, routerName: props.detail.routerName},
}) })
: window.open( : window.open(
`${import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails&params=${encodeURIComponent( `${window.location.protocol + import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails&params=${encodeURIComponent(
`routerId=${props.detail.routerId}&routerName=${props.detail.routerName}` `routerId=${props.detail.routerId}&routerName=${props.detail.routerName}`
)}` )}`
,'_top'); ,'_top');

View File

@@ -512,7 +512,7 @@ function toExamItem(obj) {
} }
console.log("obj", obj.examinationTestId); console.log("obj", obj.examinationTestId);
window.open( window.open(
import.meta.env.VITE_BOE_EXAM_DETAIL_URL + obj.examinationTestId, window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL + obj.examinationTestId,
"_top" "_top"
); //测评 ); //测评
// router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId }); // router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId });

View File

@@ -361,11 +361,11 @@ const types = ref({
13: "去完成", 13: "去完成",
}, },
path: { path: {
1: import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线 1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
2: ({ courseId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_top'), 2: ({ courseId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_top'),
3: import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例 3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
4: "/homeworkpage", 4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试 5: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast", 6: "/livebroadcast",
7: ({ targetId }) => window.open(targetId, '_top'), 7: ({ targetId }) => window.open(targetId, '_top'),
8: "/discusspage", 8: "/discusspage",
@@ -373,8 +373,8 @@ const types = ref({
10: ({ evaType, targetId }) => 10: ({ evaType, targetId }) =>
window.open( window.open(
evaType == 0 evaType == 0
? import.meta.env.VITE_BOE_TEST_DETAIL_URL+ targetId ? window.location.protocol + import.meta.env.VITE_BOE_TEST_DETAIL_URL+ targetId
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL+targetId+`&quizTaskKid=${projectId}&channelCode=project` : window.location.protocol + import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL+targetId+`&quizTaskKid=${projectId}&channelCode=project`
,'_top'), //测评 ,'_top'), //测评
11: "/surveydetail", 11: "/surveydetail",
12: "/ballotpage", 12: "/ballotpage",

View File

@@ -261,7 +261,7 @@ const goProjectDetails = (value) => {
}) })
: :
window.open( window.open(
`${import.meta.env.VITE_BOE_PATH_DETAIL_URL}/projectdetails&params=${encodeURIComponent( `${window.location.protocol + import.meta.env.VITE_BOE_PATH_DETAIL_URL}/projectdetails&params=${encodeURIComponent(
`projectId=${value.projectId}` `projectId=${value.projectId}`
,'_top')}` ,'_top')}`
); );

View File

@@ -338,11 +338,11 @@ const types = ref({
13: "去完成", 13: "去完成",
}, },
path: { path: {
1: import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线 1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
2: ({ courseId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_top'), 2: ({ courseId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_top'),
3: import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例 3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
4: "/homeworkpage", 4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试 5: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast", 6: "/livebroadcast",
7: ({ targetId }) => window.open(targetId, '_top'), //外联 7: ({ targetId }) => window.open(targetId, '_top'), //外联
8: "/discusspage", 8: "/discusspage",
@@ -350,8 +350,8 @@ const types = ref({
10: ({ evaType, targetId }) => 10: ({ evaType, targetId }) =>
window.open( window.open(
evaType == 0 evaType == 0
? import.meta.env.VITE_BOE_TEST_DETAIL_URL+targetId ? window.location.protocol + import.meta.env.VITE_BOE_TEST_DETAIL_URL+targetId
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + targetId+`&quizTaskKid=${routerId}&channelCode=learningpath` : window.location.protocol + import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + targetId+`&quizTaskKid=${routerId}&channelCode=learningpath`
,'_top'), //测评 ,'_top'), //测评
11: "/surveydetail", 11: "/surveydetail",
12: "/ballotpage", 12: "/ballotpage",