feat:合并

This commit is contained in:
lixg
2022-12-14 22:45:38 +08:00
14 changed files with 143 additions and 95 deletions

10
.env Normal file
View 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
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

9
.env.release Normal file
View 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
View File

@@ -4,7 +4,7 @@ node_modules
# local env files # local env files
.env.local .env.test
.env.*.local .env.*.local
# Log files # Log files

View File

@@ -4,8 +4,12 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"server": "vite build && vite preview", "server": "vite build --mode boe && vite preview ",
"build": "vite build" "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": { "dependencies": {
"axios": "^1.1.3", "axios": "^1.1.3",

View File

@@ -22,42 +22,35 @@
</router-link> </router-link>
</div> --> </div> -->
<main> <main>
<router-view /> <router-view/>
</main> </main>
</div> </div>
</template> </template>
<script> <script setup>
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);
});
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> </script>
<style lang="scss"> <style lang="scss">
#app { #app {
// font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial, // font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial,
// sans-serif; // sans-serif;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
Microsoft YaHei, Arial, sans-serif; Microsoft YaHei, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
color: #2c3e50; color: #2c3e50;
@@ -99,6 +92,7 @@ export default defineComponent({
} }
} }
} }
main { main {
flex: 1; flex: 1;
width: 100%; width: 100%;

View File

@@ -1,4 +1,5 @@
export const BASE = 'https://u-pre.boe.com' export const BASE = 'https://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`

View File

@@ -6,8 +6,6 @@
* @FilePath: /fe-stu/src/api/api.js * @FilePath: /fe-stu/src/api/api.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
*/ */
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 LOGIN = '/admin/CheckUser/userLogin post'
// export const FILE_UPLOAD = 'http://111.231.196.214:30001/file/upload' // export const FILE_UPLOAD = 'http://111.231.196.214:30001/file/upload'
export const FILE_UPLOAD = '/file/upload' export const FILE_UPLOAD = '/file/upload'

View File

@@ -2,7 +2,6 @@ import router from "@/router";
import {reactive, ref, toRefs, watch} from "vue"; import {reactive, ref, toRefs, watch} from "vue";
import axios from 'axios'; import axios from 'axios';
import {getCookie} from "@/api/utils"; import {getCookie} from "@/api/utils";
import {BASE} from "@/api/api";
export function usePage(_url, param) { export function usePage(_url, param) {
@@ -89,7 +88,7 @@ export async function request(_url, params) {
'X-Token': localStorage.getItem('token'), 'X-Token': localStorage.getItem('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {} ...method !== 'get' ? {'Content-Type': 'application/json'} : {}
}, },
baseURL: BASE, baseURL: import.meta.env.VITE_BASE_API,
...method !== 'get' ? {data: JSON.stringify(body)} : {} ...method !== 'get' ? {data: JSON.stringify(body)} : {}
}).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) {

View File

@@ -1,14 +1,15 @@
import { createStore } from 'vuex' import {createStore} from 'vuex'
export default createStore({ export default createStore({
state: { state: {
}, userInfo: {}
getters: { },
}, getters: {},
mutations: { mutations: {
}, SET_USER(state, userInfo) {
actions: { state.userInfo = userInfo
}, },
modules: { },
} actions: {},
modules: {}
}) })

View File

@@ -4,58 +4,58 @@
<div class="title"> <div class="title">
<div class="titleL"> <div class="titleL">
<div @click="returnfun" class="text">学习路径图</div> <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 <img
style="width: 20px; height: 18px; margin-right: 10px" style="width: 20px; height: 18px; margin-right: 10px"
src="../../assets/image/pm.png" src="../../assets/image/pm.png"
/> />
<div style="margin-top: 1px">产品经理</div> <div style="margin-top: 1px">{{ useInfo.jobName }}</div>
</div> </div>
<div class="info"> <div class="info" v-if="useInfo.bandDesc">
<img <img
style="width: 18px; height: 17px; margin-right: 11px" style="width: 18px; height: 17px; margin-right: 11px"
src="../../assets/image/band.png" src="../../assets/image/band.png"
/> />
<div style="margin-top: 2px">Band8</div> <div style="margin-top: 2px">{{ useInfo.bandDesc }}</div>
</div> </div>
</div> </div>
<div :style="{ display: !showmapdetail ? 'flex' : 'none' }"> <div :style="{ display: !showmapdetail ? 'flex' : 'none' }">
<el-popover width="475px" trigger="hover" popper-class="lppopover"> <!-- <el-popover width="475px" trigger="hover" popper-class="lppopover">-->
<div> <!-- <div>-->
<div class="finish"> <!-- <div class="finish">-->
<img <!-- <img-->
src="../../assets/image/circle.png" <!-- src="../../assets/image/circle.png"-->
style="width: 20px; height: 20px" <!-- style="width: 20px; height: 20px"-->
/> <!-- />-->
<div class="text">未完成</div> <!-- <div class="text">未完成</div>-->
<div class="box"></div> <!-- <div class="box"></div>-->
</div> <!-- </div>-->
<div <!-- <div-->
v-for="(value, index) in unCompleteTaskList" <!-- v-for="(value, index) in unCompleteTaskList"-->
:key="index" <!-- :key="index"-->
class="tasks" <!-- class="tasks"-->
:style="{ <!-- :style="{-->
'border-bottom': <!-- 'border-bottom':-->
index === unCompleteTaskList.length - 1 <!-- index === unCompleteTaskList.length - 1-->
? null <!-- ? null-->
: '1px solid rgba(229, 228, 228, 1)', <!-- : '1px solid rgba(229, 228, 228, 1)',-->
}" <!-- }"-->
> <!-- >-->
<div style="font-size: 14px; font-weight: 500; color: #677d86"> <!-- <div style="font-size: 14px; font-weight: 500; color: #677d86">-->
{{ value.name }} <!-- {{ value.name }}-->
</div> <!-- </div>-->
<img <!-- <img-->
style="width: 20px; height: 20px" <!-- style="width: 20px; height: 20px"-->
src="../../assets/image/go.png" <!-- src="../../assets/image/go.png"-->
@click="toUnTask(chapterId)" <!-- @click="toUnTask(chapterId)"-->
/> <!-- />-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<template #reference> <!-- <template #reference>-->
<!-- todo #学习路径 只会有一个未完成任务么?是否是直接跳到任务详情--> <!-- todo #学习路径 只会有一个未完成任务么?是否是直接跳到任务详情-->
<div class="titleR">进入未完成任务</div> <!-- <div class="titleR">进入未完成任务</div>-->
</template> <!-- </template>-->
</el-popover> <!-- </el-popover>-->
</div> </div>
<div <div
:style="{ display: showmapdetail ? 'flex' : 'none' }" :style="{ display: showmapdetail ? 'flex' : 'none' }"
@@ -91,7 +91,6 @@
<el-popover <el-popover
placement="top-start" placement="top-start"
title="路径介绍" title="路径介绍"
:width="350"
trigger="hover" trigger="hover"
:content="scope.row.remark" :content="scope.row.remark"
> >
@@ -109,7 +108,7 @@
<el-table-column <el-table-column
#default="scope" #default="scope"
align="center" align="center"
width="110" :width="150"
prop="state" prop="state"
label="状态" label="状态"
> >
@@ -141,26 +140,34 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import {reactive, toRefs, ref} from "vue"; import {reactive, toRefs, ref, onMounted} from "vue";
import nostarted from "../../assets/image/nostarted.png"; import nostarted from "../../assets/image/nostarted.png";
import completed from "../../assets/image/completed.png"; import completed from "../../assets/image/completed.png";
import ongoing from "../../assets/image/ongoing.png"; import ongoing from "../../assets/image/ongoing.png";
import {request, usePage, useRequest} from "@/api/request"; import {boeRequest, request, usePage, useRequest} from "@/api/request";
import { import {
BASE_URL,
ROUTER_CHAPTER_LIST, ROUTER_CHAPTER_LIST,
ROUTER_LIST, ROUTER_LIST,
ROUTER_UNCOMPLETE_LIST, ROUTER_UNCOMPLETE_LIST,
} from "@/api/api"; } from "@/api/api";
import {useImage} from "@/api/utils"; import {useImage} from "@/api/utils";
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
import {GET_USER_INFO} from "@/api/ThirdApi";
const detail = ref(); const detail = ref();
const useInfo = ref({});
const {data} = usePage(ROUTER_LIST, {}); const {data} = usePage(ROUTER_LIST, {});
const router = useRouter(); 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({ const state = reactive({
showmapdetail: false, showmapdetail: false,
}); });
@@ -186,6 +193,7 @@ function toUnTask() {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.modal { .modal {
} }

View File

@@ -342,7 +342,7 @@ import medal2 from "@/assets/image/medal/medal2.png";
import medal3 from "@/assets/image/medal/medal3.png"; import medal3 from "@/assets/image/medal/medal3.png";
import img from "@/assets/image/uploadimg.png"; import img from "@/assets/image/uploadimg.png";
import { boeRequest, useRequest } from "@/api/request"; 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 { useRoute, useRouter } from "vue-router";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { useUserInfo } from "@/api/utils"; import { useUserInfo } from "@/api/utils";
@@ -576,12 +576,11 @@ const types = ref({
13: "去完成", 13: "去完成",
}, },
path: { path: {
// 1: `https://u-pre.boe.com/pc/course/studyindex?id=${}`, 1: import.meta.env.VITE_BOE_ONLINE_CLASS_URL,
1: `https://u-pre.boe.com/pc/course/studyindex`,
2: "/faceteach", 2: "/faceteach",
3: "", 3: import.meta.env.VITE_BOE_CASS_DETAIL_URL,
4: "/homeworkpage", 4: "/homeworkpage",
5: "", 5: import.meta.env.VITE_BOE_TEST_DETAIL_URL,
6: "/livebroadcast", 6: "/livebroadcast",
7: "", 7: "",
8: "/discusspage", 8: "/discusspage",
@@ -598,6 +597,15 @@ function toFinish(d) {
ElMessage.error("暂时未开放"); ElMessage.error("暂时未开放");
return; 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({ router.push({
path: types.value.path[d.type], path: types.value.path[d.type],
query: { id: d.routerTaskId, type: 1, courseId: d.courseId }, query: { id: d.routerTaskId, type: 1, courseId: d.courseId },

View File

@@ -13,8 +13,8 @@ import { viteMockServe } from 'vite-plugin-mock'
import topLevelAwait from "vite-plugin-top-level-await"; import topLevelAwait from "vite-plugin-top-level-await";
const path = require('path') const path = require('path')
// const url = 'http://localhost:30001' const url = 'http://localhost:30001'
const url = 'http://111.231.196.214:12013/manageApi' // const url = 'http://111.231.196.214:12013/manageApi'
export default defineConfig(({ command }) => export default defineConfig(({ command }) =>
({ ({
base: '/fe-student', base: '/fe-student',