mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-06 09:26:46 +08:00
init 初始化
This commit is contained in:
16
.env
Normal file
16
.env
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
VITE_BASE=/student-h5
|
||||||
|
VITE_BASE_API=
|
||||||
|
VITE_BASE_LOGIN_URL=https://u-pre.boe.com/web?returnUrl=
|
||||||
|
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_TEST_OUT_DETAIL_URL=https://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_PATH_DETAIL_URL=https://u-pre.boe.com/pc/forward?to=/student-h5
|
||||||
|
|
||||||
|
VITE_BOE_API_URL=https://u-pre.boe.com
|
||||||
|
|
||||||
|
VITE_TASK_WHITE_TYPE=-8-,-12-,-13-
|
||||||
10
.env.boe
Normal file
10
.env.boe
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
VITE_BASE=/student-h5
|
||||||
|
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_TEST_OUT_DETAIL_URL=https://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_API_URL=https://u-pre.boe.com
|
||||||
15
.env.prod
Normal file
15
.env.prod
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
VITE_BASE=/student-h5
|
||||||
|
VITE_BASE_API=/manageApi
|
||||||
|
VITE_BASE_LOGIN_URL=https://u.boe.com/web?returnUrl=
|
||||||
|
|
||||||
|
|
||||||
|
VITE_BOE_ONLINE_CLASS_URL=https://u.boe.com/pc/course/studyindex?id=
|
||||||
|
VITE_BOE_CASS_DETAIL_URL=https://u.boe.com/pc/case/detail?id=
|
||||||
|
VITE_BOE_TEST_DETAIL_URL=https://u.boe.com/web/quizsummary?detailId=
|
||||||
|
VITE_BOE_TEST_OUT_DETAIL_URL=https://u.boe.com/api/b1/tale/do-quiz?quizKid=
|
||||||
|
VITE_BOE_EXAM_DETAIL_URL=https://u.boe.com/pc/exam/test?id=
|
||||||
|
VITE_BOE_PATH_DETAIL_URL=https://u.boe.com/pc/forward?to=/student-h5
|
||||||
|
|
||||||
|
VITE_BOE_API_URL=https://u.boe.com
|
||||||
|
|
||||||
|
VITE_TASK_WHITE_TYPE=-8-,-12-,-13-
|
||||||
12
.env.release
Normal file
12
.env.release
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
VITE_BASE=/student-h5-release
|
||||||
|
VITE_BASE_API=/manageApi-release
|
||||||
|
VITE_BASE_LOGIN_URL=https://u.boe.com/web?returnUrl=
|
||||||
|
|
||||||
|
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_TEST_OUT_DETAIL_URL=https://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_PATH_DETAIL_URL=https://u.boe.com/pc-release/forward?to=/student-h5-release
|
||||||
|
|
||||||
|
VITE_BOE_API_URL=https://u.boe.com
|
||||||
14
package.json
14
package.json
@@ -4,14 +4,19 @@
|
|||||||
"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",
|
||||||
"core-js": "^3.26.0",
|
"core-js": "^3.26.0",
|
||||||
"dayjs": "^1.11.6",
|
"dayjs": "^1.11.6",
|
||||||
"element-plus": "^2.2.20",
|
"element-plus": "^2.2.27",
|
||||||
|
"json-bigint": "^1.0.0",
|
||||||
"vue": "^3.2.45",
|
"vue": "^3.2.45",
|
||||||
"vue-router": "^4.1.6",
|
"vue-router": "^4.1.6",
|
||||||
"vuex": "^4.1.0"
|
"vuex": "^4.1.0"
|
||||||
@@ -35,7 +40,8 @@
|
|||||||
"vite": "^3.2.3",
|
"vite": "^3.2.3",
|
||||||
"vite-plugin-imp": "^2.3.1",
|
"vite-plugin-imp": "^2.3.1",
|
||||||
"vite-plugin-mock": "^2.9.6",
|
"vite-plugin-mock": "^2.9.6",
|
||||||
"vite-plugin-style-import": "^2.0.0"
|
"vite-plugin-style-import": "^2.0.0",
|
||||||
|
"vite-plugin-top-level-await": "^1.2.1"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"root": true,
|
"root": true,
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 25 KiB |
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
<title>京东方</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
|||||||
61
src/App.vue
61
src/App.vue
@@ -1,43 +1,47 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="nav">
|
<!-- <div id="nav">-->
|
||||||
<router-link
|
<!-- <router-link-->
|
||||||
v-for="item in routes"
|
<!-- v-for="item in routes"-->
|
||||||
:key="item.path"
|
<!-- :key="item.path"-->
|
||||||
:to="item.path"
|
<!-- :to="item.path"-->
|
||||||
:class="{
|
<!-- :class="{-->
|
||||||
link: true,
|
<!-- link: true,-->
|
||||||
active: name === item.name,
|
<!-- active: name === item.name,-->
|
||||||
}"
|
<!-- }"-->
|
||||||
>
|
<!-- >-->
|
||||||
{{ item.name }}
|
<!-- {{ item.name }}-->
|
||||||
</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 {computed, onMounted} from "vue";
|
||||||
import {useRouter, useRoute} from "vue-router";
|
import {useRouter, useRoute} from "vue-router";
|
||||||
export default defineComponent({
|
import {useStore} from "vuex";
|
||||||
setup() {
|
import {boeRequest} from "@/api/request";
|
||||||
|
import {GET_USER_INFO} from "@/api/ThirdApi";
|
||||||
|
import {getCookie} from "@/api/utils";
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
|
||||||
console.log("router", router.getRoutes(), route);
|
onMounted(() => {
|
||||||
const routes = computed(() => {
|
window.location.href.includes('/login') || getUserInfo();
|
||||||
return router.getRoutes().filter((e) => e.meta?.isLink);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const currentRouteName = computed(() => route.name);
|
function getUserInfo() {
|
||||||
|
boeRequest(GET_USER_INFO).then((res) => {
|
||||||
return {
|
console.log(222222222)
|
||||||
routes,
|
console.log(res)
|
||||||
name: currentRouteName,
|
res.result.avatar = res.result.avatar ? res.result.avatar : '/800e23f7-b58c-4192-820d-0c6a2b7544cc.png'
|
||||||
};
|
store.commit("SET_USER", res.result);
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
#app {
|
#app {
|
||||||
@@ -87,6 +91,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
5
src/api/ThirdApi.js
Normal file
5
src/api/ThirdApi.js
Normal file
@@ -0,0 +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`
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
export const BASE = 'http://localhost:3000'
|
export const BASE = 'http://localhost:3000'
|
||||||
|
export const LOGIN = '/admin/CheckUser/userLogin post'
|
||||||
export const FILE_UPLOAD = '/file/upload'
|
export const FILE_UPLOAD = '/file/upload'
|
||||||
export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList'
|
export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList'
|
||||||
export const ROUTER_LIST = '/stu/router/list post'
|
export const ROUTER_LIST = '/stu/router/list post'
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import {ref, watch} from "vue";
|
import {ref, watch} from "vue";
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { getCookie } from "@/api/utils";
|
||||||
|
|
||||||
|
import JSONBigInt from 'json-bigint';
|
||||||
|
const JSONBigIntStr = JSONBigInt({ storeAsString: true });
|
||||||
|
|
||||||
export function useRequest(_url, params = {}) {
|
export function useRequest(_url, params = {}) {
|
||||||
|
|
||||||
@@ -51,20 +55,14 @@ 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: '',
|
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) {
|
||||||
if (response.code === 3 || response.code === 4 || response.code === 100) {
|
if (response.code === 1000) {
|
||||||
// router.push({path: '/login'})
|
import.meta.env.MODE === 'development' ? router.push({path: '/login'}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL + window.location.url, '_top')
|
||||||
return
|
|
||||||
} else {
|
|
||||||
// response.showMsg && notification.open({
|
|
||||||
// message: response.showMsg,
|
|
||||||
// duration: 2,
|
|
||||||
// });
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
throw new Error('接口异常')
|
||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
@@ -73,3 +71,39 @@ export async function request(_url, params) {
|
|||||||
// router.push({path: '/login'})
|
// router.push({path: '/login'})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export async function boeRequest(_url, params) {
|
||||||
|
const s = _url.split(' ')
|
||||||
|
let url = s[0]
|
||||||
|
const method = s[1]?.toLowerCase() || 'get'
|
||||||
|
if (method === 'get') {
|
||||||
|
let paramsArray = [];
|
||||||
|
//拼接参数
|
||||||
|
if (params) {
|
||||||
|
Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
|
||||||
|
if (url.search(/\?/) === -1) {
|
||||||
|
url += '?' + paramsArray.join('&')
|
||||||
|
} else {
|
||||||
|
url += '&' + paramsArray.join('&')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const body = method !== 'get' ? params || {} : {}
|
||||||
|
return fetch(url,{
|
||||||
|
method,
|
||||||
|
headers:{
|
||||||
|
token: getCookie('token'),
|
||||||
|
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
|
||||||
|
},
|
||||||
|
...method !== 'get' ? {body: JSON.stringify(body)} : {}
|
||||||
|
}).then(res=>{
|
||||||
|
return res.text()
|
||||||
|
}).then(res=>{
|
||||||
|
return JSONBigIntStr.parse(res)
|
||||||
|
}).then(res=>{
|
||||||
|
console.log(res)
|
||||||
|
if(res.status === 500){
|
||||||
|
import.meta.env.MODE === 'development' ? router.push({path: '/login',query:{returnUrl:router.currentRoute.value.fullPath}}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL + window.location.url, '_top')
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
}
|
||||||
28
src/api/utils.js
Normal file
28
src/api/utils.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import {watch, ref} from "vue";
|
||||||
|
import {boeRequest} from "@/api/request";
|
||||||
|
import {GET_USER_LIST} from "@/api/ThirdApi";
|
||||||
|
|
||||||
|
export function useImage(src) {
|
||||||
|
return new URL(`../assets/image/${src}`, import.meta.url).href
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setCookie(name, value, perpetual) {
|
||||||
|
const d = new Date()
|
||||||
|
d.setDate(perpetual * 24 * 60 * 60 * 1000)
|
||||||
|
document.cookie = `${name}=${value};expires=${d.toGMTString()};path=/`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCookie(name) {
|
||||||
|
return document.cookie?.split(";").find(e => e.includes(name))?.replace(`${name}=`, '') || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useUserInfo(id) {
|
||||||
|
const userInfo = ref({})
|
||||||
|
watch(id, () => {
|
||||||
|
id.value && boeRequest(GET_USER_LIST, {id: id.value}).then(res => {
|
||||||
|
userInfo.value = res.result.userInfoList[0]
|
||||||
|
userInfo.value.avatar = userInfo.value.avatar?userInfo.value.avatar:'/800e23f7-b58c-4192-820d-0c6a2b7544cc.png'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return userInfo
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
const Images = {
|
const Images = {
|
||||||
//选择按钮
|
//选择按钮
|
||||||
checkboxImg: require('./checkbox.png'),
|
checkboxImg: import('./checkbox.png'),
|
||||||
checkbox2Img: require('./checkbox2.png'),
|
checkbox2Img: import('./checkbox2.png'),
|
||||||
zipImg: require('./filestorag/zip.png'),
|
zipImg: import('./filestorag/zip.png'),
|
||||||
excelImg: require('./filestorag/excel.png'),
|
excelImg: import('./filestorag/excel.png'),
|
||||||
mdImg: require('./filestorag/md.png'),
|
mdImg: import('./filestorag/md.png'),
|
||||||
pdfImg: require('./filestorag/pdf.png'),
|
pdfImg: import('./filestorag/pdf.png'),
|
||||||
pptImg: require('./filestorag/ppt.png'),
|
pptImg: import('./filestorag/ppt.png'),
|
||||||
rarImg: require('./filestorag/rar.png'),
|
rarImg: import('./filestorag/rar.png'),
|
||||||
wordImg: require('./filestorag/word.png'),
|
wordImg: import('./filestorag/word.png'),
|
||||||
}
|
}
|
||||||
export default Images
|
export default Images
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
const routes = [];
|
const routes = [];
|
||||||
const context =import.meta.glob("../views/*/*.vue")
|
const context =import.meta.glob("../views/*/*.vue", {eager: true})
|
||||||
Object.keys(context).forEach(path => {
|
Object.keys(context).forEach(path => {
|
||||||
const componentName = path.replace(/.*\/([^\\.\\/]*)\.vue$/, '$1');
|
const componentName = path.replace(/.*\/([^\\.\\/]*)\.vue$/, '$1');
|
||||||
routes.push({
|
routes.push({
|
||||||
path: `/${componentName.toLowerCase()}`,
|
path: `/${componentName.toLowerCase()}`,
|
||||||
name: componentName,
|
name: componentName,
|
||||||
component: () => import(path/* @vite-ignore */),
|
component: context[path].default,
|
||||||
meta: {
|
meta: {
|
||||||
isLink: true
|
isLink: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
|
import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
|
||||||
import routesConfig from './config';
|
import routesConfig from './config';
|
||||||
|
import {getCookie} from "@/api/utils";
|
||||||
// console.log('routesConfig', routesConfig)
|
// console.log('routesConfig', routesConfig)
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
@@ -12,8 +13,15 @@ const routes = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory('/student-h5'),
|
history: createWebHistory(import.meta.env.VITE_BASE),
|
||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
router.beforeEach((to, from, next) => {
|
||||||
|
if (!getCookie('token')) {
|
||||||
|
to.path === '/login' ? next() : next({path: '/login', query: {returnUrl: to.fullPath}})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
next()
|
||||||
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
@@ -2,10 +2,14 @@ import { createStore } from 'vuex'
|
|||||||
|
|
||||||
export default createStore({
|
export default createStore({
|
||||||
state: {
|
state: {
|
||||||
|
userInfo: {}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
SET_USER(state, userInfo) {
|
||||||
|
state.userInfo = userInfo
|
||||||
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -55,16 +55,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
// import { reactive, toRefs } from "vue";
|
console.log(333333333333333)
|
||||||
//import TitleHead from "@/components/TitleHead.vue";
|
|
||||||
export default {
|
|
||||||
name: "ActivitiesPage",
|
|
||||||
components: {
|
|
||||||
//TitleHead,
|
|
||||||
},
|
|
||||||
setup() {},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -85,6 +77,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
//display: flex;
|
//display: flex;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
@@ -97,6 +90,7 @@ export default {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close {
|
.close {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -110,6 +104,7 @@ export default {
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
//height: 74px;
|
//height: 74px;
|
||||||
@@ -117,6 +112,7 @@ export default {
|
|||||||
background-color: rgba(255, 255, 255, 1);
|
background-color: rgba(255, 255, 255, 1);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.titlemain {
|
.titlemain {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -124,12 +120,14 @@ export default {
|
|||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.timeposition {
|
.timeposition {
|
||||||
.time {
|
.time {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.titlebtn {
|
.titlebtn {
|
||||||
width: 83px;
|
width: 83px;
|
||||||
height: 33px;
|
height: 33px;
|
||||||
@@ -147,6 +145,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.details {
|
.details {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 11.5px;
|
margin-top: 11.5px;
|
||||||
@@ -155,6 +154,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: rgba(255, 255, 255, 1);
|
background-color: rgba(255, 255, 255, 1);
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
|
|
||||||
.details_title {
|
.details_title {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -165,6 +165,7 @@ export default {
|
|||||||
padding: 17px 0 17px 0px;
|
padding: 17px 0 17px 0px;
|
||||||
border-bottom: 0.5px solid rgba(241, 242, 243, 1);
|
border-bottom: 0.5px solid rgba(241, 242, 243, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.details_content {
|
.details_content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
|||||||
68
src/views/login/login.vue
Normal file
68
src/views/login/login.vue
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
margin: 'auto',
|
||||||
|
background:
|
||||||
|
'url(http://img.gz2c.com/FoTcLY8ww-ISCFlwyCoYuLim1BMt) no-repeat',
|
||||||
|
backgroundSize: '100% 100%',
|
||||||
|
width: '100%',
|
||||||
|
height: '100vh',
|
||||||
|
display: 'flex',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
width: '300px',
|
||||||
|
height: '300px',
|
||||||
|
margin: '10% auto',
|
||||||
|
padding: '20px 30px',
|
||||||
|
textAlign: 'center',
|
||||||
|
borderRadius: '10px',
|
||||||
|
background: '#e0e0e0',
|
||||||
|
boxShadow: '20px 20px 60px #bebebe,-20px -20px 60px #ffffff',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div :style="{ fontSize: '24px', paddingBottom: '30px' }">用户登录</div>
|
||||||
|
<div>
|
||||||
|
<input placeholder="用户名" v-model="form.account"/>
|
||||||
|
<input
|
||||||
|
placeholder="密码"
|
||||||
|
v-model="form.password"
|
||||||
|
:style="{ marginTop: '30px' }"
|
||||||
|
type="password"
|
||||||
|
/>
|
||||||
|
<button :style="{ marginTop: '30px' }" @click="loginUser">
|
||||||
|
登录
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import {useRoute, useRouter} from "vue-router";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import {LOGIN} from "@/api/api";
|
||||||
|
import {setCookie} from "@/api/utils";
|
||||||
|
import {request} from "@/api/request";
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const {
|
||||||
|
query: {returnUrl},
|
||||||
|
} = useRoute();
|
||||||
|
|
||||||
|
const returnclick = () => {
|
||||||
|
router.back();
|
||||||
|
};
|
||||||
|
|
||||||
|
const form = ref({
|
||||||
|
account: "00004409",
|
||||||
|
password: "1234567890Aa",
|
||||||
|
});
|
||||||
|
|
||||||
|
async function loginUser() {
|
||||||
|
const {data: token} = await request(LOGIN, form.value);
|
||||||
|
setCookie("token", token, 10);
|
||||||
|
await router.push({path: returnUrl || "/learnpath"});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
9
src/views/sign/signResult.vue
Normal file
9
src/views/sign/signResult.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
签到成功!
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -1,25 +1,96 @@
|
|||||||
import {defineConfig} from 'vite'
|
import {defineConfig, loadEnv} from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import legacy from '@vitejs/plugin-legacy'
|
import legacy from '@vitejs/plugin-legacy'
|
||||||
|
import topLevelAwait from "vite-plugin-top-level-await";
|
||||||
|
|
||||||
import {viteMockServe} from 'vite-plugin-mock'
|
import {viteMockServe} from 'vite-plugin-mock'
|
||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
export default defineConfig(({command}) =>
|
export default defineConfig(({command,mode}) =>
|
||||||
({
|
({
|
||||||
|
base: loadEnv(mode, process.cwd()).VITE_BASE,
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
legacy({
|
legacy({
|
||||||
targets: ['chrome 52', 'defaults', 'not IE 11']
|
targets: ['chrome 52', 'defaults', 'not IE 11']
|
||||||
}),
|
}),
|
||||||
viteMockServe({
|
// viteMockServe({
|
||||||
mockPath: './src/mock/mocks',
|
// mockPath: './src/mock/mocks',
|
||||||
})
|
// })
|
||||||
|
topLevelAwait({
|
||||||
|
promiseExportName: '__tla',
|
||||||
|
promiseImportName: i => `__tla_${i}`
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: [
|
alias: [
|
||||||
{find: '@', replacement: path.resolve(__dirname, 'src')}
|
{find: '@', replacement: path.resolve(__dirname, 'src')}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/file/upload': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
// '/stu': {
|
||||||
|
// target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
// changeOrigin: true,
|
||||||
|
// },
|
||||||
|
'/queryVoteSubmitDetailById': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/work': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/discuss': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/discussSubmit': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/comment': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/vote': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/admin': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/activity': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/liveBroadcast': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/examination': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/assessment': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/workSubmit': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/userbasic': {
|
||||||
|
target: 'https://u-pre.boe.com',
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/link': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
}, '/onlineClasses/queryOnlineClassesStudyDetail': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user