# Conflicts:
#	vue.config.js
This commit is contained in:
dongruihua
2022-12-14 20:41:22 +08:00
12 changed files with 74 additions and 32 deletions

10
.env Normal file
View File

@@ -0,0 +1,10 @@
VITE_BASE=/manage
VITE_BASE_API=/
VITE_PROXY_URL=http://111.231.196.214:30001/
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

8
.env.boe Normal file
View File

@@ -0,0 +1,8 @@
VITE_BASE=/fe-student
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

8
.env.prod Normal file
View File

@@ -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

8
.env.release Normal file
View File

@@ -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

9
.env.test Normal file
View File

@@ -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

View File

@@ -44,7 +44,7 @@ export default defineComponent({
const store = useStore(); const store = useStore();
const isLogin = ref(false); const isLogin = ref(false);
// console.log("router", router.getRoutes(), route); // console.log("router", router.getRoutes(), route);
console.log("版本0.9.13------------"); console.log("版本0.9.14------------");
const routes = computed(() => { const routes = computed(() => {
return router.getRoutes().filter((e) => e.meta?.isLink); return router.getRoutes().filter((e) => e.meta?.isLink);
}); });

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com * @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-21 14:32:52 * @Date: 2022-11-21 14:32:52
* @LastEditors: lixg lixg@dongwu-inc.com * @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-14 09:04:31 * @LastEditTime: 2022-12-14 17:51:50
* @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
*/ */
@@ -16,7 +16,7 @@ import axios from "axios";
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
const http = axios.create({ const http = axios.create({
baseURL: "/manageApi", 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" },
@@ -56,7 +56,7 @@ http.interceptors.response.use(
return response; return response;
} else { } else {
if (code === 1000) { if (code === 1000) {
// window.open("https://u-pre.boe.com/web/", '_self'); window.open("https://u-pre.boe.com/web/", '_self');
// window.open("http://111.231.196.214:12013/manage/login", '_self'); // window.open("http://111.231.196.214:12013/manage/login", '_self');
} }
console.log("api %o", msg); console.log("api %o", msg);

View File

@@ -193,7 +193,7 @@ const setCookie = (name, value, perpetual) => {
//先写一个方法 //先写一个方法
function getCookie(name) { 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字符串 //1.获取cookie字符串
// const cookies = document.cookie; // const cookies = document.cookie;
// console.log('cookies',cookies) // console.log('cookies',cookies)
@@ -219,7 +219,7 @@ function getCookie(name) {
//滚动加载信息 //滚动加载信息
const scrollLoad = (e) => { const scrollLoad = (e) => {
// console.log("滚动", e, b); // console.log("滚动", e, b);
const {target} = e; const { target } = e;
const scrllHeight = target.scrollHeight - target.scrollTop; const scrllHeight = target.scrollHeight - target.scrollTop;
const clientHeight = target.clientHeight; const clientHeight = target.clientHeight;
// console.log("scrllHeight", scrllHeight, clientHeight); // console.log("scrllHeight", scrllHeight, clientHeight);
@@ -277,6 +277,9 @@ const organizationalTree = []
//嵌套页面 //嵌套页面
const iframeUrl = "https://u-pre.boe.com/pc/iframe" const iframeUrl = "https://u-pre.boe.com/pc/iframe"
//学员端路由
const studentUrl = 'https://u.boe.com/pc/uc/study/courses'
//二维码 //二维码
const codeUrl = "https://u-pre.boe.com" const codeUrl = "https://u-pre.boe.com"
export { export {
@@ -292,5 +295,6 @@ export {
commonData, commonData,
organizationalTree, organizationalTree,
iframeUrl, iframeUrl,
studentUrl,
codeUrl, codeUrl,
} }

View File

@@ -61,7 +61,7 @@
import { reactive, toRefs } from "vue"; import { reactive, toRefs } from "vue";
import DownLoad from "../components/drawers/DownLoad"; import DownLoad from "../components/drawers/DownLoad";
import * as api from "../api/index1"; import * as api from "../api/index1";
import { studentUrl } from "../api/method";
export default { export default {
name: "NavTop", name: "NavTop",
components: { components: {
@@ -81,7 +81,7 @@ export default {
{ {
id: 2, id: 2,
name: "学员", name: "学员",
go: "https://u.boe.com/pc/uc/study/courses", go: studentUrl,
}, },
], ],

View File

@@ -23,7 +23,7 @@
</a-tree-select> </a-tree-select>
</template> </template>
<script setup> <script setup>
import {computed, defineEmits, defineProps, onMounted, ref} from "vue"; import {computed, defineEmits, defineProps} from "vue";
import {useStore} from "vuex"; import {useStore} from "vuex";
const store = useStore(); const store = useStore();
@@ -33,16 +33,12 @@ const props = defineProps({
}) })
const emit = defineEmits({}) const emit = defineEmits({})
const options = ref([]) const options = computed(() => store.state.orgtreeList)
const id = computed(() => { const id = computed(() => {
return props.value return props.value
}) })
onMounted(() => {
options.value = [...store.state.orgtreeList]
})
function change(key, obj) { function change(key, obj) {
emit('update:name', obj[0]) emit('update:name', obj[0])
emit('update:value', key) emit('update:value', key)

View File

@@ -17,7 +17,7 @@ const routes = [
...routesConfig ...routesConfig
] ]
const router = createRouter({ const router = createRouter({
history: createWebHistory("/manage/"), history: createWebHistory(process.env.VITE_BASE),
routes, routes,
}) })

View File

@@ -6,17 +6,16 @@
* @FilePath: /fe-manage/vue.config.js * @FilePath: /fe-manage/vue.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
*/ */
const { defineConfig } = require("@vue/cli-service"); const {defineConfig} = require("@vue/cli-service");
module.exports = defineConfig({ module.exports = defineConfig({
publicPath: "/manage", publicPath: process.env.VITE_BASE,
// transpileDependencies: true, // transpileDependencies: true,
devServer: { devServer: {
port: 8080, port: 8080,
proxy: { proxy: {
"/manageApi": { "/manageApi": {
// target:"http://192.168.19.246:30001", target: process.env.VITE_PROXY_URL,
// target:"http://192.168.100.208:30001",
target: "https://u-pre.boe.com/manageApi/", //这里后台的地址模拟的;应该填写你们真实的后台接口
changeOrigin: true, //表示是否改变原域名 changeOrigin: true, //表示是否改变原域名
// secure: false, // secure: false,
// ws: false, //表示WebSocket协议 // ws: false, //表示WebSocket协议