diff --git a/.env b/.env new file mode 100644 index 00000000..06a891d8 --- /dev/null +++ b/.env @@ -0,0 +1,11 @@ +VITE_BASE=/manage +VITE_BASE_API=/ +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_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_API_URL=https://u-pre.boe.com \ No newline at end of file diff --git a/.env.boe b/.env.boe new file mode 100644 index 00000000..ef2ad7d6 --- /dev/null +++ b/.env.boe @@ -0,0 +1,9 @@ +VITE_BASE=/manage +VITE_BASE_API=/manageApi + + +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_TEST_DETAIL_URL=https://u-pre.boe.com/web/quizsummary?detailId= + +VITE_BOE_API_URL=https://u-pre.boe.com \ No newline at end of file diff --git a/.env.prod b/.env.prod new file mode 100644 index 00000000..6671831e --- /dev/null +++ b/.env.prod @@ -0,0 +1,8 @@ +VITE_BASE=/fe-student-release +VITE_BASE_API=/manageApi-release + +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_TEST_DETAIL_URL=https://u.boe.com/web/quizsummary?detailId= + +VITE_BOE_API_URL=https://u.boe.com \ No newline at end of file diff --git a/.env.release b/.env.release new file mode 100644 index 00000000..05c6e5c4 --- /dev/null +++ b/.env.release @@ -0,0 +1,10 @@ +VITE_BASE=/fe-student-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_CASS_DETAIL_URL=https://u.boe.com/pc-release/case/detail?id= +VITE_BOE_TEST_DETAIL_URL=https://u.boe.com/web/quizsummary?detailId= + +VITE_BOE_API_URL=https://u.boe.com \ No newline at end of file diff --git a/.env.test b/.env.test new file mode 100644 index 00000000..6f9f2122 --- /dev/null +++ b/.env.test @@ -0,0 +1,9 @@ +VITE_BASE=/fe-student +VITE_BASE_API=/manageApi + + +VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc-release/course/studyindex?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_API_URL=https://u-pre.boe.com \ No newline at end of file diff --git a/package.json b/package.json index 935c5f5b..f694a453 100644 --- a/package.json +++ b/package.json @@ -1,68 +1,71 @@ { - "name": "fe_manage", - "version": "0.1.0", - "private": true, - "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint" - }, - "dependencies": { - "@wangeditor/editor": "^5.1.23", - "@wangeditor/editor-for-vue": "^5.1.12", - "ant-design-vue": "^3.2.12", - "axios": "^1.1.3", - "core-js": "^3.8.3", - "dayjs": "^1.11.6", - "element-plus": "^2.2.17", - "element-resize-detector": "^1.2.4", - "html2canvas": "^1.4.1", - "jquery": "^3.6.1", - "mitt": "^3.0.0", - "moment": "^2.29.4", - "qrcode.vue": "^3.3.3", - "qs": "^6.11.0", - "sortablejs": "^1.15.0", - "vue": "^3.2.13", - "vue-router": "^4.0.3", - "vuedraggable": "^4.1.0", - "vuex": "^4.0.0" - }, - "devDependencies": { - "@babel/core": "^7.12.16", - "@babel/eslint-parser": "^7.12.16", - "@vue/cli-plugin-babel": "~5.0.0", - "@vue/cli-plugin-eslint": "~5.0.0", - "@vue/cli-plugin-router": "~5.0.0", - "@vue/cli-plugin-vuex": "~5.0.0", - "@vue/cli-service": "~5.0.0", - "eslint": "^7.32.0", - "eslint-plugin-vue": "^8.0.3", - "sass": "^1.32.7", - "sass-loader": "^12.0.0" - }, - "eslintConfig": { - "root": true, - "env": { - "node": true - }, - "extends": [ - "plugin:vue/vue3-essential", - "eslint:recommended" - ], - "parserOptions": { - "parser": "@babel/eslint-parser" - }, - "rules": { - "no-console": "off", - "no-debugger": "off", - "no-mixed-spaces-and-tabs": "off" - } - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not dead", - "not ie 11" - ] + "name": "fe_manage", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "build:boe": "vue-cli-service build --mode boe", + "build:release": "vue-cli-service build --mode release", + "build:prod": "vue-cli-service build --mode prod", + "build:test": "vue-cli-service build --mode test" + }, + "dependencies": { + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^5.1.12", + "ant-design-vue": "^3.2.12", + "axios": "^1.1.3", + "core-js": "^3.8.3", + "dayjs": "^1.11.6", + "element-plus": "^2.2.17", + "element-resize-detector": "^1.2.4", + "html2canvas": "^1.4.1", + "jquery": "^3.6.1", + "mitt": "^3.0.0", + "moment": "^2.29.4", + "qrcode.vue": "^3.3.3", + "qs": "^6.11.0", + "sortablejs": "^1.15.0", + "vue": "^3.2.13", + "vue-router": "^4.0.3", + "vuedraggable": "^4.1.0", + "vuex": "^4.0.0" + }, + "devDependencies": { + "@babel/core": "^7.12.16", + "@babel/eslint-parser": "^7.12.16", + "@vue/cli-plugin-babel": "~5.0.0", + "@vue/cli-plugin-eslint": "~5.0.0", + "@vue/cli-plugin-router": "~5.0.0", + "@vue/cli-plugin-vuex": "~5.0.0", + "@vue/cli-service": "~5.0.0", + "eslint": "^7.32.0", + "eslint-plugin-vue": "^8.0.3", + "sass": "^1.32.7", + "sass-loader": "^12.0.0" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "extends": [ + "plugin:vue/vue3-essential", + "eslint:recommended" + ], + "parserOptions": { + "parser": "@babel/eslint-parser" + }, + "rules": { + "no-console": "off", + "no-debugger": "off", + "no-mixed-spaces-and-tabs": "off" + } + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not dead", + "not ie 11" + ] } diff --git a/src/App.vue b/src/App.vue index 2354d8c4..b85229f3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -44,7 +44,7 @@ export default defineComponent({ const store = useStore(); const isLogin = ref(false); // console.log("router", router.getRoutes(), route); - console.log("版本0.9.13------------"); + console.log("版本0.9.14------------"); const routes = computed(() => { return router.getRoutes().filter((e) => e.meta?.isLink); }); diff --git a/src/api/config.js b/src/api/config.js index ec213068..87b1987b 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -2,12 +2,13 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-11-21 14:32:52 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2022-12-14 09:04:31 + * @LastEditTime: 2022-12-14 20:56:10 * @FilePath: /fe-manage/src/api/config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import { message } from "ant-design-vue"; import axios from "axios"; +import router from "@/router"; // import { getCookie } from '../api/method' // const Qs = require("qs"); @@ -16,7 +17,7 @@ import axios from "axios"; axios.defaults.withCredentials = true; const http = axios.create({ - baseURL: "/manageApi", + baseURL: process.env.VITE_BASE_API, timeout: 1000 * 15, // headers: { "Content-Type": "multipart/form-data" }, headers: { "Content-Type": "application/json" }, @@ -56,8 +57,7 @@ http.interceptors.response.use( return response; } else { if (code === 1000) { - // window.open("https://u-pre.boe.com/web/", '_self'); - // window.open("http://111.231.196.214:12013/manage/login", '_self'); + process.env.NODE_ENV === 'development' ? router.push({ path: 'login' }) : (window.location.href = process.env.VITE_LOGIN_URL) } console.log("api %o", msg); } diff --git a/src/api/method.js b/src/api/method.js index a10dafa0..401b7d1d 100644 --- a/src/api/method.js +++ b/src/api/method.js @@ -193,7 +193,7 @@ const setCookie = (name, value, perpetual) => { //先写一个方法 function getCookie(name) { - return document.cookie?.split(";").find(e => e.includes(name)).replace(`${name}=`,'') || '' + return document.cookie?.split(";").find(e => e.includes(name)).replace(`${name}=`, '') || '' //1.获取cookie字符串 // const cookies = document.cookie; // console.log('cookies',cookies) @@ -219,7 +219,7 @@ function getCookie(name) { //滚动加载信息 const scrollLoad = (e) => { // console.log("滚动", e, b); - const {target} = e; + const { target } = e; const scrllHeight = target.scrollHeight - target.scrollTop; const clientHeight = target.clientHeight; // console.log("scrllHeight", scrllHeight, clientHeight); @@ -277,6 +277,9 @@ const organizationalTree = [] //嵌套页面 const iframeUrl = "https://u-pre.boe.com/pc/iframe" +//学员端路由 +const studentUrl = 'https://u-pre.boe.com/pc/loading' + //二维码 const codeUrl = "https://u-pre.boe.com" export { @@ -292,5 +295,6 @@ export { commonData, organizationalTree, iframeUrl, + studentUrl, codeUrl, } \ No newline at end of file diff --git a/src/components/NavTop.vue b/src/components/NavTop.vue index 797a6847..b69ba583 100644 --- a/src/components/NavTop.vue +++ b/src/components/NavTop.vue @@ -61,7 +61,7 @@ import { reactive, toRefs } from "vue"; import DownLoad from "../components/drawers/DownLoad"; import * as api from "../api/index1"; - +import { studentUrl } from "../api/method"; export default { name: "NavTop", components: { @@ -81,7 +81,7 @@ export default { { id: 2, name: "学员", - go: "https://u.boe.com/pc/uc/study/courses", + go: studentUrl, }, ], diff --git a/src/components/drawers/AddProject.vue b/src/components/drawers/AddProject.vue index 04f75503..98d6dbe1 100644 --- a/src/components/drawers/AddProject.vue +++ b/src/components/drawers/AddProject.vue @@ -54,7 +54,7 @@ -