mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-12 20:36:48 +08:00
feat:合并
This commit is contained in:
10
.env
Normal file
10
.env
Normal file
@@ -0,0 +1,10 @@
|
||||
VITE_BASE=/fe-student
|
||||
VITE_BASE_API=/
|
||||
VITE_BASE_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
|
||||
8
.env.boe
Normal file
8
.env.boe
Normal 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
8
.env.prod
Normal 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.release
Normal file
9
.env.release
Normal file
@@ -0,0 +1,9 @@
|
||||
VITE_BASE=/fe-student-release
|
||||
VITE_BASE_API=/manageApi-release
|
||||
VITE_BASE_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
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,7 +4,7 @@ node_modules
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.test
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
|
||||
@@ -4,8 +4,12 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"server": "vite build && vite preview",
|
||||
"build": "vite build"
|
||||
"server": "vite build --mode boe && vite preview ",
|
||||
"build": "vite build --mode release",
|
||||
"build:boe": "vite build --mode boe",
|
||||
"build:prod": "vite build --mode prod",
|
||||
"build:release": "vite build --mode release",
|
||||
"build:test": "vite build --mode test"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.1.3",
|
||||
|
||||
42
src/App.vue
42
src/App.vue
@@ -22,35 +22,28 @@
|
||||
</router-link>
|
||||
</div> -->
|
||||
<main>
|
||||
<router-view />
|
||||
<router-view/>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { computed, defineComponent } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
console.log("router", router.getRoutes(), route);
|
||||
console.log(import.meta.env.DEV);
|
||||
const routes = computed(() => {
|
||||
return router.getRoutes().filter((e) => e.meta?.isLink);
|
||||
});
|
||||
<script setup>
|
||||
|
||||
const currentRouteName = computed(() => route.name);
|
||||
import {boeRequest} from "@/api/request";
|
||||
import {GET_USER_INFO} from "@/api/ThirdApi";
|
||||
import { useStore } from "vuex";
|
||||
import {onMounted} from "vue";
|
||||
|
||||
const store = useStore();
|
||||
|
||||
onMounted(()=>{
|
||||
getUserInfo()
|
||||
})
|
||||
function getUserInfo(){
|
||||
boeRequest(GET_USER_INFO).then(res=>{
|
||||
store.commit("SET_USER", res.result);
|
||||
})
|
||||
}
|
||||
|
||||
// localStorage.setItem(
|
||||
// "token",
|
||||
// "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzA3NjExNzIsImV4cCI6MTY3MDc2ODM3MiwiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.9e8c4d3933c3a6d9b660e0b849940c813e1c245b3d17646ff7a793100640bc42"
|
||||
// );
|
||||
return {
|
||||
routes,
|
||||
name: currentRouteName,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
#app {
|
||||
@@ -99,6 +92,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export const BASE = 'https://u-pre.boe.com'
|
||||
export const GET_USER_LIST = `/userbasic/user/list post`
|
||||
export const GET_USER_INFO = `/userbasic/user/info post`
|
||||
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -2,7 +2,6 @@ import router from "@/router";
|
||||
import {reactive, ref, toRefs, watch} from "vue";
|
||||
import axios from 'axios';
|
||||
import {getCookie} from "@/api/utils";
|
||||
import {BASE} from "@/api/api";
|
||||
|
||||
export function usePage(_url, param) {
|
||||
|
||||
@@ -89,7 +88,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) {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { createStore } from 'vuex'
|
||||
import {createStore} from 'vuex'
|
||||
|
||||
export default createStore({
|
||||
state: {
|
||||
userInfo: {}
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
getters: {},
|
||||
mutations: {
|
||||
SET_USER(state, userInfo) {
|
||||
state.userInfo = userInfo
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
modules: {
|
||||
}
|
||||
actions: {},
|
||||
modules: {}
|
||||
})
|
||||
|
||||
@@ -4,58 +4,58 @@
|
||||
<div class="title">
|
||||
<div class="titleL">
|
||||
<div @click="returnfun" class="text">学习路径图</div>
|
||||
<div class="info" style="margin-right: 14px">
|
||||
<div class="info" style="margin-right: 14px" v-if="useInfo.jobName">
|
||||
<img
|
||||
style="width: 20px; height: 18px; margin-right: 10px"
|
||||
src="../../assets/image/pm.png"
|
||||
/>
|
||||
<div style="margin-top: 1px">产品经理</div>
|
||||
<div style="margin-top: 1px">{{ useInfo.jobName }}</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="info" v-if="useInfo.bandDesc">
|
||||
<img
|
||||
style="width: 18px; height: 17px; margin-right: 11px"
|
||||
src="../../assets/image/band.png"
|
||||
/>
|
||||
<div style="margin-top: 2px">Band8</div>
|
||||
<div style="margin-top: 2px">{{ useInfo.bandDesc }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div :style="{ display: !showmapdetail ? 'flex' : 'none' }">
|
||||
<el-popover width="475px" trigger="hover" popper-class="lppopover">
|
||||
<div>
|
||||
<div class="finish">
|
||||
<img
|
||||
src="../../assets/image/circle.png"
|
||||
style="width: 20px; height: 20px"
|
||||
/>
|
||||
<div class="text">未完成</div>
|
||||
<div class="box"></div>
|
||||
</div>
|
||||
<div
|
||||
v-for="(value, index) in unCompleteTaskList"
|
||||
:key="index"
|
||||
class="tasks"
|
||||
:style="{
|
||||
'border-bottom':
|
||||
index === unCompleteTaskList.length - 1
|
||||
? null
|
||||
: '1px solid rgba(229, 228, 228, 1)',
|
||||
}"
|
||||
>
|
||||
<div style="font-size: 14px; font-weight: 500; color: #677d86">
|
||||
{{ value.name }}
|
||||
</div>
|
||||
<img
|
||||
style="width: 20px; height: 20px"
|
||||
src="../../assets/image/go.png"
|
||||
@click="toUnTask(chapterId)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<template #reference>
|
||||
<!-- <el-popover width="475px" trigger="hover" popper-class="lppopover">-->
|
||||
<!-- <div>-->
|
||||
<!-- <div class="finish">-->
|
||||
<!-- <img-->
|
||||
<!-- src="../../assets/image/circle.png"-->
|
||||
<!-- style="width: 20px; height: 20px"-->
|
||||
<!-- />-->
|
||||
<!-- <div class="text">未完成</div>-->
|
||||
<!-- <div class="box"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div-->
|
||||
<!-- v-for="(value, index) in unCompleteTaskList"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- class="tasks"-->
|
||||
<!-- :style="{-->
|
||||
<!-- 'border-bottom':-->
|
||||
<!-- index === unCompleteTaskList.length - 1-->
|
||||
<!-- ? null-->
|
||||
<!-- : '1px solid rgba(229, 228, 228, 1)',-->
|
||||
<!-- }"-->
|
||||
<!-- >-->
|
||||
<!-- <div style="font-size: 14px; font-weight: 500; color: #677d86">-->
|
||||
<!-- {{ value.name }}-->
|
||||
<!-- </div>-->
|
||||
<!-- <img-->
|
||||
<!-- style="width: 20px; height: 20px"-->
|
||||
<!-- src="../../assets/image/go.png"-->
|
||||
<!-- @click="toUnTask(chapterId)"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <template #reference>-->
|
||||
<!-- todo #学习路径 只会有一个未完成任务么?是否是直接跳到任务详情-->
|
||||
<div class="titleR">进入未完成任务</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
<!-- <div class="titleR">进入未完成任务</div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-popover>-->
|
||||
</div>
|
||||
<div
|
||||
:style="{ display: showmapdetail ? 'flex' : 'none' }"
|
||||
@@ -91,7 +91,6 @@
|
||||
<el-popover
|
||||
placement="top-start"
|
||||
title="路径介绍"
|
||||
:width="350"
|
||||
trigger="hover"
|
||||
:content="scope.row.remark"
|
||||
>
|
||||
@@ -109,7 +108,7 @@
|
||||
<el-table-column
|
||||
#default="scope"
|
||||
align="center"
|
||||
width="110"
|
||||
:width="150"
|
||||
prop="state"
|
||||
label="状态"
|
||||
>
|
||||
@@ -141,26 +140,34 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {reactive, toRefs, ref} from "vue";
|
||||
import {reactive, toRefs, ref, onMounted} from "vue";
|
||||
import nostarted from "../../assets/image/nostarted.png";
|
||||
import completed from "../../assets/image/completed.png";
|
||||
import ongoing from "../../assets/image/ongoing.png";
|
||||
import {request, usePage, useRequest} from "@/api/request";
|
||||
import {boeRequest, request, usePage, useRequest} from "@/api/request";
|
||||
import {
|
||||
BASE_URL,
|
||||
ROUTER_CHAPTER_LIST,
|
||||
ROUTER_LIST,
|
||||
ROUTER_UNCOMPLETE_LIST,
|
||||
} from "@/api/api";
|
||||
import {useImage} from "@/api/utils";
|
||||
import {useRouter} from "vue-router";
|
||||
import {GET_USER_INFO} from "@/api/ThirdApi";
|
||||
|
||||
const detail = ref();
|
||||
const useInfo = ref({});
|
||||
const {data} = usePage(ROUTER_LIST, {});
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const {unCompleteTaskList} = useRequest(ROUTER_UNCOMPLETE_LIST, {});
|
||||
// const {unCompleteTaskList} = useRequest(ROUTER_UNCOMPLETE_LIST, {});
|
||||
|
||||
onMounted(()=>{
|
||||
boeRequest(GET_USER_INFO).then(res=>{
|
||||
useInfo.value=res.result
|
||||
})
|
||||
})
|
||||
|
||||
const state = reactive({
|
||||
showmapdetail: false,
|
||||
});
|
||||
@@ -186,6 +193,7 @@ function toUnTask() {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
.modal {
|
||||
}
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ import medal2 from "@/assets/image/medal/medal2.png";
|
||||
import medal3 from "@/assets/image/medal/medal3.png";
|
||||
import img from "@/assets/image/uploadimg.png";
|
||||
import { boeRequest, useRequest } from "@/api/request";
|
||||
import { BASE_URL, ROUTER_PROCESS } from "@/api/api";
|
||||
import { ROUTER_PROCESS } from "@/api/api";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useUserInfo } from "@/api/utils";
|
||||
@@ -576,12 +576,11 @@ const types = ref({
|
||||
13: "去完成",
|
||||
},
|
||||
path: {
|
||||
// 1: `https://u-pre.boe.com/pc/course/studyindex?id=${}`,
|
||||
1: `https://u-pre.boe.com/pc/course/studyindex`,
|
||||
1: import.meta.env.VITE_BOE_ONLINE_CLASS_URL,
|
||||
2: "/faceteach",
|
||||
3: "",
|
||||
3: import.meta.env.VITE_BOE_CASS_DETAIL_URL,
|
||||
4: "/homeworkpage",
|
||||
5: "",
|
||||
5: import.meta.env.VITE_BOE_TEST_DETAIL_URL,
|
||||
6: "/livebroadcast",
|
||||
7: "",
|
||||
8: "/discusspage",
|
||||
@@ -598,6 +597,15 @@ function toFinish(d) {
|
||||
ElMessage.error("暂时未开放");
|
||||
return;
|
||||
}
|
||||
if (types.value.path[d.type] && types.value.path[d.type].startsWith("http")) {
|
||||
//配置文件
|
||||
const url =
|
||||
types.value.path[d.type] + (d.type === 1 ? d.targetId : d.courseId);
|
||||
import.meta.env.DEV
|
||||
? (window.location.href = url)
|
||||
: (window.parent.location.href = url);
|
||||
return;
|
||||
}
|
||||
router.push({
|
||||
path: types.value.path[d.type],
|
||||
query: { id: d.routerTaskId, type: 1, courseId: d.courseId },
|
||||
|
||||
@@ -13,8 +13,8 @@ import { viteMockServe } from 'vite-plugin-mock'
|
||||
import topLevelAwait from "vite-plugin-top-level-await";
|
||||
|
||||
const path = require('path')
|
||||
// const url = 'http://localhost:30001'
|
||||
const url = 'http://111.231.196.214:12013/manageApi'
|
||||
const url = 'http://localhost:30001'
|
||||
// const url = 'http://111.231.196.214:12013/manageApi'
|
||||
export default defineConfig(({ command }) =>
|
||||
({
|
||||
base: '/fe-student',
|
||||
|
||||
Reference in New Issue
Block a user