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,
|
||||
"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",
|
||||
"core-js": "^3.26.0",
|
||||
"dayjs": "^1.11.6",
|
||||
"element-plus": "^2.2.20",
|
||||
"element-plus": "^2.2.27",
|
||||
"json-bigint": "^1.0.0",
|
||||
"vue": "^3.2.45",
|
||||
"vue-router": "^4.1.6",
|
||||
"vuex": "^4.1.0"
|
||||
@@ -35,7 +40,8 @@
|
||||
"vite": "^3.2.3",
|
||||
"vite-plugin-imp": "^2.3.1",
|
||||
"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": {
|
||||
"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 name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<title>京东方</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
||||
69
src/App.vue
69
src/App.vue
@@ -1,50 +1,54 @@
|
||||
<template>
|
||||
<div id="container">
|
||||
<div id="nav">
|
||||
<router-link
|
||||
v-for="item in routes"
|
||||
:key="item.path"
|
||||
:to="item.path"
|
||||
:class="{
|
||||
link: true,
|
||||
active: name === item.name,
|
||||
}"
|
||||
>
|
||||
{{ item.name }}
|
||||
</router-link>
|
||||
</div>
|
||||
<!-- <div id="nav">-->
|
||||
<!-- <router-link-->
|
||||
<!-- v-for="item in routes"-->
|
||||
<!-- :key="item.path"-->
|
||||
<!-- :to="item.path"-->
|
||||
<!-- :class="{-->
|
||||
<!-- link: true,-->
|
||||
<!-- active: name === item.name,-->
|
||||
<!-- }"-->
|
||||
<!-- >-->
|
||||
<!-- {{ item.name }}-->
|
||||
<!-- </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);
|
||||
const routes = computed(() => {
|
||||
return router.getRoutes().filter((e) => e.meta?.isLink);
|
||||
});
|
||||
<script setup>
|
||||
import {computed, onMounted} from "vue";
|
||||
import {useRouter, useRoute} from "vue-router";
|
||||
import {useStore} from "vuex";
|
||||
import {boeRequest} from "@/api/request";
|
||||
import {GET_USER_INFO} from "@/api/ThirdApi";
|
||||
import {getCookie} from "@/api/utils";
|
||||
|
||||
const currentRouteName = computed(() => route.name);
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
|
||||
return {
|
||||
routes,
|
||||
name: currentRouteName,
|
||||
};
|
||||
},
|
||||
onMounted(() => {
|
||||
window.location.href.includes('/login') || getUserInfo();
|
||||
});
|
||||
|
||||
function getUserInfo() {
|
||||
boeRequest(GET_USER_INFO).then((res) => {
|
||||
console.log(222222222)
|
||||
console.log(res)
|
||||
res.result.avatar = res.result.avatar ? res.result.avatar : '/800e23f7-b58c-4192-820d-0c6a2b7544cc.png'
|
||||
store.commit("SET_USER", res.result);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
#app {
|
||||
// font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial,
|
||||
// sans-serif;
|
||||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
|
||||
Microsoft YaHei, Arial, sans-serif;
|
||||
Microsoft YaHei, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #2c3e50;
|
||||
@@ -87,6 +91,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
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 LOGIN = '/admin/CheckUser/userLogin post'
|
||||
export const FILE_UPLOAD = '/file/upload'
|
||||
export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList'
|
||||
export const ROUTER_LIST = '/stu/router/list post'
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import router from "@/router";
|
||||
import {ref, watch} from "vue";
|
||||
import axios from 'axios';
|
||||
import { getCookie } from "@/api/utils";
|
||||
|
||||
import JSONBigInt from 'json-bigint';
|
||||
const JSONBigIntStr = JSONBigInt({ storeAsString: true });
|
||||
|
||||
export function useRequest(_url, params = {}) {
|
||||
|
||||
@@ -51,20 +55,14 @@ export async function request(_url, params) {
|
||||
'X-Token': localStorage.getItem('token'),
|
||||
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
|
||||
},
|
||||
baseURL: '',
|
||||
baseURL: import.meta.env.VITE_BASE_API,
|
||||
...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 === 3 || response.code === 4 || response.code === 100) {
|
||||
// router.push({path: '/login'})
|
||||
return
|
||||
} else {
|
||||
// response.showMsg && notification.open({
|
||||
// message: response.showMsg,
|
||||
// duration: 2,
|
||||
// });
|
||||
return
|
||||
if (response.code === 1000) {
|
||||
import.meta.env.MODE === 'development' ? router.push({path: '/login'}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL + window.location.url, '_top')
|
||||
}
|
||||
throw new Error('接口异常')
|
||||
}
|
||||
return response
|
||||
}).catch(e => {
|
||||
@@ -72,4 +70,40 @@ export async function request(_url, params) {
|
||||
console.log(e)
|
||||
// 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 = {
|
||||
//选择按钮
|
||||
checkboxImg: require('./checkbox.png'),
|
||||
checkbox2Img: require('./checkbox2.png'),
|
||||
zipImg: require('./filestorag/zip.png'),
|
||||
excelImg: require('./filestorag/excel.png'),
|
||||
mdImg: require('./filestorag/md.png'),
|
||||
pdfImg: require('./filestorag/pdf.png'),
|
||||
pptImg: require('./filestorag/ppt.png'),
|
||||
rarImg: require('./filestorag/rar.png'),
|
||||
wordImg: require('./filestorag/word.png'),
|
||||
checkboxImg: import('./checkbox.png'),
|
||||
checkbox2Img: import('./checkbox2.png'),
|
||||
zipImg: import('./filestorag/zip.png'),
|
||||
excelImg: import('./filestorag/excel.png'),
|
||||
mdImg: import('./filestorag/md.png'),
|
||||
pdfImg: import('./filestorag/pdf.png'),
|
||||
pptImg: import('./filestorag/ppt.png'),
|
||||
rarImg: import('./filestorag/rar.png'),
|
||||
wordImg: import('./filestorag/word.png'),
|
||||
}
|
||||
export default Images
|
||||
@@ -1,11 +1,11 @@
|
||||
const routes = [];
|
||||
const context =import.meta.glob("../views/*/*.vue")
|
||||
const context =import.meta.glob("../views/*/*.vue", {eager: true})
|
||||
Object.keys(context).forEach(path => {
|
||||
const componentName = path.replace(/.*\/([^\\.\\/]*)\.vue$/, '$1');
|
||||
routes.push({
|
||||
path: `/${componentName.toLowerCase()}`,
|
||||
name: componentName,
|
||||
component: () => import(path/* @vite-ignore */),
|
||||
component: context[path].default,
|
||||
meta: {
|
||||
isLink: true
|
||||
}
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
|
||||
import routesConfig from './config';
|
||||
import {getCookie} from "@/api/utils";
|
||||
// console.log('routesConfig', routesConfig)
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: '首页',
|
||||
redirect: routesConfig[0].path
|
||||
},
|
||||
...routesConfig
|
||||
{
|
||||
path: '/',
|
||||
name: '首页',
|
||||
redirect: routesConfig[0].path
|
||||
},
|
||||
...routesConfig
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory('/student-h5'),
|
||||
routes
|
||||
history: createWebHistory(import.meta.env.VITE_BASE),
|
||||
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
|
||||
@@ -2,10 +2,14 @@ import { createStore } from 'vuex'
|
||||
|
||||
export default createStore({
|
||||
state: {
|
||||
userInfo: {}
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
mutations: {
|
||||
SET_USER(state, userInfo) {
|
||||
state.userInfo = userInfo
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="main">
|
||||
<div class="notice">
|
||||
<span class="text"
|
||||
>请各位选课的同学提前阅读本课程的“教学大纲与计划请各位选课的同学提前阅读本课程的“教学大纲与计划</span
|
||||
>请各位选课的同学提前阅读本课程的“教学大纲与计划请各位选课的同学提前阅读本课程的“教学大纲与计划</span
|
||||
>
|
||||
<span class="close"></span>
|
||||
</div>
|
||||
@@ -11,8 +11,8 @@
|
||||
<div class="titlemain">
|
||||
<div class="timeposition">
|
||||
<div
|
||||
calss="titlecontent"
|
||||
style="
|
||||
calss="titlecontent"
|
||||
style="
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 21.6px;
|
||||
@@ -23,8 +23,8 @@
|
||||
</div>
|
||||
<div class="time">
|
||||
<img
|
||||
style="width: 13px; height: 14.5px; margin-right: 5.5px"
|
||||
src="../../assets/image/faceteach/time.png"
|
||||
style="width: 13px; height: 14.5px; margin-right: 5.5px"
|
||||
src="../../assets/image/faceteach/time.png"
|
||||
/>
|
||||
<div style="font-size: 12px; color: rgba(110, 123, 132, 1)">
|
||||
2022-07-20 20:00-21:00
|
||||
@@ -32,8 +32,8 @@
|
||||
</div>
|
||||
<div class="time" style="margin-top: 9px">
|
||||
<img
|
||||
style="width: 13px; height: 15px; margin-right: 5.5px"
|
||||
src="../../assets/image/faceteach/position.png"
|
||||
style="width: 13px; height: 15px; margin-right: 5.5px"
|
||||
src="../../assets/image/faceteach/position.png"
|
||||
/>
|
||||
<div style="font-size: 12px; color: rgba(110, 123, 132, 1)">
|
||||
大族广场
|
||||
@@ -46,25 +46,17 @@
|
||||
<div class="details">
|
||||
<div class="details_title">活动详情</div>
|
||||
<div class="details_content">
|
||||
大族广场写字楼采用国际顶级硬件设施,美国OTIS电梯、麦克维尔中央空调、高端安防系统等商务空间新标准匹配项目在亦庄地标综合体的形象。写字楼空间设计由亚洲著名的室内空间设计大师之一梁景华设计,写字楼群由六栋(T1—T6)呈舰队排列的5A写字楼构成形成独特的舰队造型。<br />购物中心介绍<br />大族广场Mall&More位于北京经济技术开发区核心商圈荣华路,由荷兰鹿特丹缤纷市场设计师HANS
|
||||
大族广场写字楼采用国际顶级硬件设施,美国OTIS电梯、麦克维尔中央空调、高端安防系统等商务空间新标准匹配项目在亦庄地标综合体的形象。写字楼空间设计由亚洲著名的室内空间设计大师之一梁景华设计,写字楼群由六栋(T1—T6)呈舰队排列的5A写字楼构成形成独特的舰队造型。<br/>购物中心介绍<br/>大族广场Mall&More位于北京经济技术开发区核心商圈荣华路,由荷兰鹿特丹缤纷市场设计师HANS
|
||||
VAN DALEN
|
||||
主持设计,秉持自然与未来和谐共生理念,倡导乐活、有机、绿色环保的生活方式,传递生活美学。<br />大族广场Mall&More汇集众多知名优质品牌,7FRESH生鲜超市、CGV星聚汇影城、中信书店、源力悦体等,集购物、餐饮娱乐、文化于一体,丰富的业态品类为消费者提供城市生活的第三空间感受。<br />大族广场Mall&More以人为本,不断提升服务水平,升级消费购物体验,致力于营造更加舒适的购物环境与空间,打造有温度的品牌。同时根据春夏秋冬四季策划丰富多样的大型主题活动;为会员设置专属的沙龙活动,打造专属会员日等
|
||||
主持设计,秉持自然与未来和谐共生理念,倡导乐活、有机、绿色环保的生活方式,传递生活美学。<br/>大族广场Mall&More汇集众多知名优质品牌,7FRESH生鲜超市、CGV星聚汇影城、中信书店、源力悦体等,集购物、餐饮娱乐、文化于一体,丰富的业态品类为消费者提供城市生活的第三空间感受。<br/>大族广场Mall&More以人为本,不断提升服务水平,升级消费购物体验,致力于营造更加舒适的购物环境与空间,打造有温度的品牌。同时根据春夏秋冬四季策划丰富多样的大型主题活动;为会员设置专属的沙龙活动,打造专属会员日等
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { reactive, toRefs } from "vue";
|
||||
//import TitleHead from "@/components/TitleHead.vue";
|
||||
export default {
|
||||
name: "ActivitiesPage",
|
||||
components: {
|
||||
//TitleHead,
|
||||
},
|
||||
setup() {},
|
||||
};
|
||||
<script setup>
|
||||
console.log(333333333333333)
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -85,6 +77,7 @@ export default {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.text {
|
||||
//display: flex;
|
||||
height: 25px;
|
||||
@@ -97,6 +90,7 @@ export default {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.close {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
@@ -110,6 +104,7 @@ export default {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
//height: 74px;
|
||||
@@ -117,6 +112,7 @@ export default {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.titlemain {
|
||||
width: 90%;
|
||||
display: flex;
|
||||
@@ -124,12 +120,14 @@ export default {
|
||||
margin-bottom: 15px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.timeposition {
|
||||
.time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.titlebtn {
|
||||
width: 83px;
|
||||
height: 33px;
|
||||
@@ -147,6 +145,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
width: 100%;
|
||||
margin-top: 11.5px;
|
||||
@@ -155,6 +154,7 @@ export default {
|
||||
align-items: center;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
padding-bottom: 20px;
|
||||
|
||||
.details_title {
|
||||
width: 90%;
|
||||
display: flex;
|
||||
@@ -165,6 +165,7 @@ export default {
|
||||
padding: 17px 0 17px 0px;
|
||||
border-bottom: 0.5px solid rgba(241, 242, 243, 1);
|
||||
}
|
||||
|
||||
.details_content {
|
||||
display: flex;
|
||||
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 legacy from '@vitejs/plugin-legacy'
|
||||
import topLevelAwait from "vite-plugin-top-level-await";
|
||||
|
||||
import {viteMockServe} from 'vite-plugin-mock'
|
||||
|
||||
const path = require('path')
|
||||
|
||||
export default defineConfig(({command}) =>
|
||||
export default defineConfig(({command,mode}) =>
|
||||
({
|
||||
base: loadEnv(mode, process.cwd()).VITE_BASE,
|
||||
plugins: [
|
||||
vue(),
|
||||
legacy({
|
||||
targets: ['chrome 52', 'defaults', 'not IE 11']
|
||||
}),
|
||||
viteMockServe({
|
||||
mockPath: './src/mock/mocks',
|
||||
})
|
||||
// viteMockServe({
|
||||
// mockPath: './src/mock/mocks',
|
||||
// })
|
||||
topLevelAwait({
|
||||
promiseExportName: '__tla',
|
||||
promiseImportName: i => `__tla_${i}`
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: [
|
||||
{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