├── .gitignore ├── .vscode └── settings.json ├── README.en.md ├── README.md ├── adminOrTeacher ├── .browserslistrc ├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── App.vue │ ├── assets │ │ └── img │ │ │ ├── dxyy1.jpg │ │ │ └── zipper.png │ ├── main.js │ ├── network │ │ └── index.js │ ├── plugins │ │ └── element_ui.js │ ├── router │ │ ├── admin_main.js │ │ ├── index.js │ │ └── teacher_main.js │ └── views │ │ ├── Login.vue │ │ ├── administrators │ │ ├── Admin │ │ │ ├── AdminEdit.vue │ │ │ └── AdminList.vue │ │ ├── AdminMain.vue │ │ ├── Class │ │ │ ├── ClassEdit.vue │ │ │ └── ClassList.vue │ │ ├── College │ │ │ ├── CollegeEdit.vue │ │ │ └── CollegeList.vue │ │ ├── Course │ │ │ ├── CourseEdit.vue │ │ │ └── CourseList.vue │ │ ├── Main.vue │ │ ├── My │ │ │ ├── My.vue │ │ │ └── setPassword.vue │ │ ├── Profession │ │ │ ├── ProfessionEdit.vue │ │ │ └── ProfessionList.vue │ │ ├── ResultsQuery │ │ │ ├── ClassCardList.vue │ │ │ ├── ClassScoreList.vue │ │ │ ├── CollegeCardList.vue │ │ │ ├── CourseCardList.vue │ │ │ └── ProfessionCardList.vue │ │ ├── Student │ │ │ ├── StudentEdit.vue │ │ │ └── StudentList.vue │ │ ├── Teacher │ │ │ ├── TeacherEdit.vue │ │ │ └── TeacherList.vue │ │ ├── TestPaper │ │ │ ├── Childre │ │ │ │ ├── MultipleChoice.vue │ │ │ │ ├── SingleTopicSelection.vue │ │ │ │ └── TrueFalse.vue │ │ │ ├── PublishedPaperList.vue │ │ │ ├── TestPaperEdit.vue │ │ │ └── TestPaperList.vue │ │ └── echarts │ │ │ ├── PeopleEcharts.vue │ │ │ └── PeopleSexEcharts.vue │ │ └── teachers │ │ ├── Course │ │ ├── CourseCardList.vue │ │ ├── CourseStudentEdit.vue │ │ ├── CourseStudentList.vue │ │ ├── ProfessionCourseEdit.vue │ │ └── ProfessionCourseList.vue │ │ ├── Main.vue │ │ ├── My │ │ ├── My.vue │ │ └── setPassword.vue │ │ ├── ResultsQuery │ │ ├── CourseGradeList.vue │ │ └── StudentScoreList.vue │ │ ├── Student │ │ ├── StudentEdit.vue │ │ └── StudentList.vue │ │ ├── TeacherMain.vue │ │ └── TestPaper │ │ ├── Childre │ │ ├── MultipleChoice.vue │ │ ├── SingleTopicSelection.vue │ │ └── TrueFalse.vue │ │ ├── CoursePublishedPaperList.vue │ │ ├── CourseTestPaperEdit.vue │ │ └── CourseTestPaperList.vue └── vue.config.js ├── img ├── 学生端图片 │ ├── studentHome.png │ ├── 发布的试卷.png │ ├── 时间过期进入不了.png │ ├── 查看已考试卷.png │ ├── 考试提示.png │ └── 考试页面.png ├── 打开数据库.png ├── 教师图片 │ ├── image-20211127122945482.png │ ├── 为课程添加学生.png │ ├── 修改查询个人信息.png │ ├── 已保存的时间_是否发布可以看右边的按钮.png │ ├── 已发布的时间.png │ ├── 查看课程成绩.png │ └── 点击可以查看课程中的学生.png ├── 管理员图片 │ ├── image-20211127122654977.png │ ├── 专业列表.png │ ├── 修改密码.png │ ├── 双击查看学生详情.png │ ├── 学生列表.png │ ├── 学院列表.png │ ├── 已发试卷.png │ ├── 成绩管理_查看成绩.png │ ├── 教师列表.png │ ├── 查看成绩.png │ ├── 添加学院.png │ ├── 管理员列表.png │ ├── 试卷列表.png │ └── 课程列表.png ├── 运行项目.png └── 项目初始化.png ├── server ├── index.js ├── models │ ├── AdminUser.js │ ├── Class.js │ ├── College.js │ ├── Course.js │ ├── CourseStudent.js │ ├── CourseTestPaper.js │ ├── CourseTestPaperScore.js │ ├── Profession.js │ ├── ProfessionCourse.js │ ├── PublishedPaper.js │ ├── StudentUser.js │ ├── TeacherUser.js │ ├── TestPaper.js │ └── TestPaperScore.js ├── package-lock.json ├── package.json ├── plugins │ └── index.js ├── routes │ └── admin │ │ ├── index.js │ │ └── tool.js └── uploads │ ├── 105-1638707644404-17021444845865896.jpg │ ├── 107-1638707515381-33905725661431263.jpg │ ├── 1133-1638706370404-11503081187992814.jpg │ ├── 154-1638706327753-40278043690084187.jpg │ ├── 162-1638706636812-6925329176058272.jpg │ ├── ec0346c22c1a22117d5c35b73d8b1131-1638706355203-49428216796329694.jpeg │ ├── f8bba026c9c981e2e64883c2401095ba-1638705742774-21076726149562552.jpg │ ├── f8bba026c9c981e2e64883c2401095ba-1638705750580-954636825210601.jpg │ ├── fdb09701464f481aa9e52d68aa38e0f7-1638706406720-7306530212142099.jpeg │ ├── 微信图片_20200728212948-1638705885630-6168440191545215.jpg │ ├── 微信图片_20200729222951-1638705874566-646082976537605.jpg │ ├── 微信图片_20200804162337-1638705859324-6958982340464892.jpg │ ├── 微信图片_20200906225604-1640915095265-1234780995818332.jpg │ ├── 电信学院-1638705797999-28499394079109686.jpg │ ├── 电信学院-1638705842948-7615712295337584.jpg │ ├── 电信学院-1638706032073-7540723842114565.jpg │ ├── 电信学院-1638706037227-21866449252151887.jpg │ ├── 电信学院-1638706042698-990705742910003.jpg │ ├── 艺设-1638706150341-14147153410714886.jpg │ └── 高等数学-1638705999668-010306619521483595.jpeg └── student ├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ ├── css │ │ └── style.css │ └── img │ │ ├── dxyy1.jpg │ │ └── none.png ├── components │ ├── AccomplishTestParper.vue │ ├── CourseTestParper.vue │ ├── Login.vue │ ├── TabBar.vue │ └── TestParper.vue ├── main.js ├── network │ └── http.js ├── plugins │ └── vant.js ├── router │ └── index.js └── views │ ├── Main.vue │ ├── My │ ├── EditPassword.vue │ └── My.vue │ └── home │ ├── Home.vue │ └── child │ ├── accomplish │ ├── Accomplish.vue │ ├── AccomplishCourse.vue │ └── FenLei.vue │ ├── course │ ├── CourseExam.vue │ └── ProfessionCourse.vue │ └── school │ ├── SchoolCourse.vue │ └── SchoolExam.vue └── vue.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # 校园考试系统 2 | 3 | #### Description 4 | 使用Vue.js和node.js开发的校园考试系统 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 校园考试系统 2 | 3 | #### 介绍 4 | 使用Vue.js和node.js开发的校园考试系统。所有先要运行该项目必须有node.js环境。 5 | 6 | 使用的是数据库MongoDB,所有也需要安装mongoDB数据库 7 | 8 | #### 软件架构 9 | 软件架构说明 10 | 11 | #### 安装说明 12 | 13 | 1. 安装node.js 14 | 2. 安装MongoDb数据库 https://www.runoob.com/mongodb/mongodb-window-install.html 15 | 3. 数据库比较难安装。(注意要细心哦) 16 | 1. 大概就是安装在c盘, 17 | 2. 然后在c盘根目录创建data文件夹 18 | 3. 在data文件夹中创建db文件夹 19 | 4. 进入安装mongodb的bin目录,打开`mongo.exe`和`mongod.exe` 20 | 4. 安装完数据库,打开cmd命令行窗口 输入mongod启动mongodb服务器在打开一个cmd窗口,输入mongo连接mongodb(不要关闭命令行窗口) 21 | 1. 或者进入数据库安装的目录 22 | 2. ![打开数据库](https://gitee.com/zxr-xiaoha/campus-examination-system/raw/0ecf575b47ca72765bb9111026b3c12503df2422/img/%E6%89%93%E5%BC%80%E6%95%B0%E6%8D%AE%E5%BA%93.png) 23 | 3. 启动mongo.exe和mongod.exe(启动后不要关闭) 24 | 5. 指定数据库:`use test_system`(在mongo.exe打开的控制台中输入) 25 | 6. 为数据库插入一条数据,最好就是:`db.adminusers.insert({name:"root",password:"root"})`(在mongo.exe打开的控制台中输入) 26 | 27 | #### 使用说明 28 | 29 | 1. 下载或克隆项目。该项目拥有:管理员端+教师端+学生端+服务器端 30 | 31 | 2. 管理员和教师是adminOrTeacher文件夹,学生端是student文件夹,服务器端是server文件夹 32 | 33 | 3. 下载下来后,这三个文件夹(adminOrTeacher、server、student)都需要初始化,都是进入根目录,然后运行 npm install(有淘宝镜像的最好用cnpm install )。 34 | 35 | 4. 建议先启动server(服务器端),因为管理员,教师,学生这些都需要server提供数据 36 | 37 | 5. ![初始化](https://gitee.com/zxr-xiaoha/campus-examination-system/raw/9daa9f4a375cf91676bc4adf1f5f67a39434ad1d/img/image-20211127122322922.png) 38 | 39 | 6. 然后,这三个文件夹(adminOrTeacher、server、student)都是进入根目录,然后运行 npm run serve 来启动项目。 40 | 41 | 7. ![运行项目](https://gitee.com/zxr-xiaoha/campus-examination-system/raw/9daa9f4a375cf91676bc4adf1f5f67a39434ad1d/img/image-20211127122022797.png) 42 | 43 | 44 | 45 | #### 项目截图 46 | 47 | 1. ##### 管理员端:![管理员首页](https://gitee.com/zxr-xiaoha/campus-examination-system/raw/9daa9f4a375cf91676bc4adf1f5f67a39434ad1d/img/image-20211127122654977.png) 48 | 49 | 2. 管理员端添加试卷![管理员添加试卷](https://gitee.com/zxr-xiaoha/campus-examination-system/raw/9daa9f4a375cf91676bc4adf1f5f67a39434ad1d/img/image-20211127122745572.png) 50 | 51 | 3. **查看项目其它图片可以点击img文件夹** 52 | 53 | #### 其它介绍 54 | 55 | 1. 管理员端发布的试卷是校级试卷,学校中所有的学生都可以考试。 56 | 2. 教师端发布的试卷的课程试卷,只有课程中的学生才可以考试 57 | -------------------------------------------------------------------------------- /adminOrTeacher/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /adminOrTeacher/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /adminOrTeacher/README.md: -------------------------------------------------------------------------------- 1 | # admin 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Customize configuration 19 | See [Configuration Reference](https://cli.vuejs.org/config/). 20 | -------------------------------------------------------------------------------- /adminOrTeacher/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /adminOrTeacher/package.json: -------------------------------------------------------------------------------- 1 | { "name": "adminorteacher", 2 | 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.24.0", 11 | "core-js": "^3.6.5", 12 | "echarts": "^5.2.2", 13 | "element-ui": "^2.15.6", 14 | "vue": "^2.6.11", 15 | "vue-router": "^3.2.0", 16 | "vuex": "^3.4.0" 17 | }, 18 | "devDependencies": { 19 | "@vue/cli-plugin-babel": "~4.5.0", 20 | "@vue/cli-plugin-router": "~4.5.0", 21 | "@vue/cli-plugin-vuex": "~4.5.0", 22 | "@vue/cli-service": "~4.5.0", 23 | "vue-template-compiler": "^2.6.11" 24 | }, 25 | "description": "## Project setup ``` npm install ```", 26 | "main": "babel.config.js", 27 | "keywords": [], 28 | "author": "", 29 | "license": "ISC" 30 | } 31 | -------------------------------------------------------------------------------- /adminOrTeacher/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/adminOrTeacher/public/favicon.ico -------------------------------------------------------------------------------- /adminOrTeacher/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /adminOrTeacher/src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | -------------------------------------------------------------------------------- /adminOrTeacher/src/assets/img/dxyy1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/adminOrTeacher/src/assets/img/dxyy1.jpg -------------------------------------------------------------------------------- /adminOrTeacher/src/assets/img/zipper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/adminOrTeacher/src/assets/img/zipper.png -------------------------------------------------------------------------------- /adminOrTeacher/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import http from './network/index' 5 | import './plugins/element_ui' 6 | 7 | Vue.config.productionTip = false 8 | Vue.prototype.$http = http//给vue原型上添加一个$http属性,用来发送请求,所有组件也都有了这个属性 9 | Vue.mixin({ 10 | computed: { 11 | //图片上传地址 12 | uploadUrl() { 13 | return this.$http.defaults.baseURL + '/upload' 14 | } 15 | }, 16 | methods: { 17 | //获取请求头 18 | getAuthHeaders() { 19 | return { 20 | Authorization: `${localStorage.a_token || ''}` 21 | } 22 | }, 23 | //图片的验证 24 | beforeAvatarUpload(file) { 25 | const imgType = ['image/jpeg', 'image/png'] 26 | const isJPG = imgType.includes(file.type); 27 | const isLt2M = file.size / 1024 / 1024 < 2; 28 | if (!isJPG) { 29 | this.$message.error('上传头像图片只能是 JPG 格式或 PNG 格式!'); 30 | } 31 | if (!isLt2M) { 32 | this.$message.error('上传头像图片大小不能超过 2MB!'); 33 | } 34 | return isJPG && isLt2M; 35 | }, 36 | } 37 | }) 38 | 39 | new Vue({ 40 | router, 41 | render: h => h(App) 42 | }).$mount('#app') -------------------------------------------------------------------------------- /adminOrTeacher/src/network/index.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | const http = axios.create({ 3 | baseURL: 'http://localhost:5000/api' 4 | }) 5 | // 添加请求拦截器 6 | http.interceptors.request.use(function (config) { 7 | // 在发送请求之前做些什么 8 | if (localStorage.a_token) {//发请求前判断本地是否有token,如果有,携带请求头过去 9 | config.headers.Authorization = localStorage.a_token; 10 | }else if (localStorage.t_user) { 11 | config.headers.Authorization = JSON.parse(localStorage.t_user).t_token; 12 | } 13 | 14 | return config; 15 | }, function (error) { 16 | // 对请求错误做些什么 17 | return Promise.reject(error); 18 | }); 19 | 20 | // 添加响应拦截器 21 | http.interceptors.response.use(function (response) { 22 | // 对响应数据做点什么 23 | return response; 24 | }, function (error) { 25 | // 对响应错误做点什么 26 | return Promise.reject(error); 27 | }); 28 | export default http -------------------------------------------------------------------------------- /adminOrTeacher/src/plugins/element_ui.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import ElementUI from 'element-ui'; 3 | import 'element-ui/lib/theme-chalk/index.css'; 4 | 5 | Vue.use(ElementUI);//全局,完整引入elementui框架 -------------------------------------------------------------------------------- /adminOrTeacher/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import { 4 | admin_main 5 | } from './admin_main'; 6 | import { 7 | teacher_main 8 | } from './teacher_main'; 9 | const Login = () => import('../views/Login.vue'); 10 | 11 | Vue.use(VueRouter) 12 | 13 | let routes = []; 14 | routes = [{ 15 | path: '/admin_main', 16 | redirect: '/admin_main/main' 17 | }, 18 | { 19 | path: '/teacher_main', 20 | redirect: '/teacher_main/main' 21 | }, 22 | //管理员的路由 23 | admin_main, 24 | //教师的路由 25 | teacher_main, 26 | { 27 | path: '/login', 28 | name: 'login', 29 | component: Login, 30 | meta: { 31 | isPublic: true //使用可以直接访问 32 | } 33 | } 34 | ] 35 | if (localStorage.t_user) { 36 | routes.push({ 37 | path: '/', 38 | redirect: '/teacher_main' 39 | }) 40 | } else if (localStorage.a_token) { 41 | routes.push({ 42 | path: '/', 43 | redirect: '/admin_main' 44 | }) 45 | } 46 | const router = new VueRouter({ 47 | mode: 'history', 48 | routes 49 | }) 50 | //to: 即将要进入的目标 路由对象 51 | //from: 当前导航正要离开的路由 52 | //next():接着走 53 | router.beforeEach((to, form, next) => { 54 | if (to.path == '/teacher_main/my') { 55 | return next(); 56 | } 57 | //每次路由跳转之前,去本地看看有没有管理员的token,但是teacher的存在也可以 58 | if (!to.meta.isPublic && !localStorage.a_token && !localStorage.t_user) { 59 | return next('/login'); 60 | } 61 | //每次路由跳转之前,去本地看看有没有教师的token 62 | if (localStorage.t_user) { 63 | if (!to.meta.isPublic && !JSON.parse(localStorage.t_user).t_token) { 64 | return next('/login'); 65 | } 66 | if (localStorage.personalDetails) { 67 | let personalDetails = JSON.parse(localStorage.personalDetails) 68 | if (!personalDetails.college || !personalDetails.profession || !personalDetails.class) { 69 | //如果不创建不知道怎么办 70 | let a = new Vue() 71 | a.$message({ 72 | type: 'warning', 73 | message: '请完善个人信息在继续其他操作!' 74 | }); 75 | return next('/teacher_main/my') 76 | } 77 | } 78 | } 79 | next(); 80 | }) 81 | export default router -------------------------------------------------------------------------------- /adminOrTeacher/src/router/teacher_main.js: -------------------------------------------------------------------------------- 1 | //admin路由 2 | const TeacherMain = () => import("../views/teachers/TeacherMain.vue"); 3 | const CourseCardList = () => import("../views/teachers/Course/CourseCardList.vue"); 4 | const CourseStudentEdit = () => import("../views/teachers/Course/CourseStudentEdit.vue"); 5 | const CourseStudentList = () => import("../views/teachers/Course/CourseStudentList.vue"); 6 | const ProfessionCourseEdit = () => import("../views/teachers/Course/ProfessionCourseEdit.vue"); 7 | const ProfessionCourseList = () => import("../views/teachers/Course/ProfessionCourseList.vue"); 8 | const CourseTestPaperEdit = () => import("../views/teachers/TestPaper/CourseTestPaperEdit.vue"); 9 | const CourseTestPaperList = () => import("../views/teachers/TestPaper/CourseTestPaperList.vue"); 10 | const CoursePublishedPaperList = () => import("../views/teachers/TestPaper/CoursePublishedPaperList.vue"); 11 | const CourseGradeList = () => import("../views/teachers/ResultsQuery/CourseGradeList.vue"); 12 | const StudentScoreList = () => import("../views/teachers/ResultsQuery/StudentScoreList.vue"); 13 | const My = () => import('../views/teachers/My/My.vue'); 14 | const setPassword = () => import('../views/teachers/My/setPassword.vue'); 15 | const Main = () => import('../views/teachers/Main.vue'); 16 | export let teacher_main = { 17 | path: '/teacher_main', 18 | name: 'teacher_main', 19 | component: TeacherMain, 20 | children: [{ 21 | path: 'main', 22 | component: Main 23 | }, { 24 | path: 'course_card/list', 25 | component: CourseCardList, 26 | }, 27 | { 28 | path: 'course_student/create', 29 | component: CourseStudentEdit, 30 | // props($route) { 31 | // return { 32 | // id: $route.query.id 33 | // } 34 | // } 35 | }, 36 | { 37 | path: 'course_student/list', 38 | component: CourseStudentList, 39 | props($route) { 40 | return { 41 | name: $route.query.name 42 | } 43 | } 44 | }, 45 | { 46 | path: 'profession_course/create', 47 | component: ProfessionCourseEdit, 48 | props($route) { 49 | return { 50 | id: $route.query.id 51 | } 52 | } 53 | }, 54 | { 55 | path: 'profession_course/list', 56 | component: ProfessionCourseList 57 | }, 58 | { 59 | path: 'course_test_paper/create', 60 | component: CourseTestPaperEdit, 61 | props($route) { 62 | return { 63 | id: $route.query.id 64 | } 65 | } 66 | }, 67 | { 68 | path: 'course_test_paper/list', 69 | component: CourseTestPaperList 70 | }, 71 | { 72 | path: 'course_published_papers/list', 73 | component: CoursePublishedPaperList 74 | }, 75 | { 76 | path: 'my', 77 | name: 'My', 78 | component: My 79 | }, 80 | { 81 | path: 'set_pwd', 82 | component: setPassword 83 | }, 84 | { 85 | path: 'course_grade/list', 86 | component: CourseGradeList 87 | }, 88 | { 89 | path: 'student_score/list', 90 | component: StudentScoreList, 91 | props($route) { 92 | return { 93 | id: $route.query.id 94 | } 95 | } 96 | } 97 | ] 98 | } -------------------------------------------------------------------------------- /adminOrTeacher/src/views/Login.vue: -------------------------------------------------------------------------------- 1 | 39 | 99 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Admin/AdminEdit.vue: -------------------------------------------------------------------------------- 1 | 60 | 168 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Admin/AdminList.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 118 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Class/ClassList.vue: -------------------------------------------------------------------------------- 1 | 58 | 59 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/College/CollegeEdit.vue: -------------------------------------------------------------------------------- 1 | 39 | 139 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/College/CollegeList.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Course/CourseEdit.vue: -------------------------------------------------------------------------------- 1 | 44 | 137 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Course/CourseList.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/My/My.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 52 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/My/setPassword.vue: -------------------------------------------------------------------------------- 1 | 26 | 84 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Profession/ProfessionEdit.vue: -------------------------------------------------------------------------------- 1 | 50 | 154 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Profession/ProfessionList.vue: -------------------------------------------------------------------------------- 1 | 56 | 57 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/ResultsQuery/ClassCardList.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 52 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/ResultsQuery/ClassScoreList.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 69 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/ResultsQuery/CollegeCardList.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 43 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/ResultsQuery/CourseCardList.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 47 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/ResultsQuery/ProfessionCardList.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 62 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Student/StudentEdit.vue: -------------------------------------------------------------------------------- 1 | 42 | 151 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/Teacher/TeacherEdit.vue: -------------------------------------------------------------------------------- 1 | 42 | 139 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/TestPaper/Childre/MultipleChoice.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 101 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/TestPaper/Childre/SingleTopicSelection.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 101 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/TestPaper/Childre/TrueFalse.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/echarts/PeopleEcharts.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 80 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/administrators/echarts/PeopleSexEcharts.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 63 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/Course/CourseCardList.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 56 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/Course/CourseStudentList.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/Course/ProfessionCourseEdit.vue: -------------------------------------------------------------------------------- 1 | 39 | 127 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/Course/ProfessionCourseList.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/Main.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 64 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/My/setPassword.vue: -------------------------------------------------------------------------------- 1 | 26 | 94 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/ResultsQuery/CourseGradeList.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 49 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/ResultsQuery/StudentScoreList.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 69 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/Student/StudentEdit.vue: -------------------------------------------------------------------------------- 1 | 38 | 141 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/Student/StudentList.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/TestPaper/Childre/MultipleChoice.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 101 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/TestPaper/Childre/SingleTopicSelection.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 102 | -------------------------------------------------------------------------------- /adminOrTeacher/src/views/teachers/TestPaper/Childre/TrueFalse.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | -------------------------------------------------------------------------------- /adminOrTeacher/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | configureWebpack: { 3 | resolve: { 4 | alias: { 5 | 'assets': '@/assets', 6 | 'components': '@/components', 7 | 'network': '@/network', 8 | 'views': '@/views', 9 | 'store': '@/store', 10 | } 11 | } 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /img/学生端图片/studentHome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/学生端图片/studentHome.png -------------------------------------------------------------------------------- /img/学生端图片/发布的试卷.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/学生端图片/发布的试卷.png -------------------------------------------------------------------------------- /img/学生端图片/时间过期进入不了.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/学生端图片/时间过期进入不了.png -------------------------------------------------------------------------------- /img/学生端图片/查看已考试卷.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/学生端图片/查看已考试卷.png -------------------------------------------------------------------------------- /img/学生端图片/考试提示.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/学生端图片/考试提示.png -------------------------------------------------------------------------------- /img/学生端图片/考试页面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/学生端图片/考试页面.png -------------------------------------------------------------------------------- /img/打开数据库.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/打开数据库.png -------------------------------------------------------------------------------- /img/教师图片/image-20211127122945482.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/教师图片/image-20211127122945482.png -------------------------------------------------------------------------------- /img/教师图片/为课程添加学生.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/教师图片/为课程添加学生.png -------------------------------------------------------------------------------- /img/教师图片/修改查询个人信息.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/教师图片/修改查询个人信息.png -------------------------------------------------------------------------------- /img/教师图片/已保存的时间_是否发布可以看右边的按钮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/教师图片/已保存的时间_是否发布可以看右边的按钮.png -------------------------------------------------------------------------------- /img/教师图片/已发布的时间.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/教师图片/已发布的时间.png -------------------------------------------------------------------------------- /img/教师图片/查看课程成绩.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/教师图片/查看课程成绩.png -------------------------------------------------------------------------------- /img/教师图片/点击可以查看课程中的学生.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/教师图片/点击可以查看课程中的学生.png -------------------------------------------------------------------------------- /img/管理员图片/image-20211127122654977.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/image-20211127122654977.png -------------------------------------------------------------------------------- /img/管理员图片/专业列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/专业列表.png -------------------------------------------------------------------------------- /img/管理员图片/修改密码.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/修改密码.png -------------------------------------------------------------------------------- /img/管理员图片/双击查看学生详情.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/双击查看学生详情.png -------------------------------------------------------------------------------- /img/管理员图片/学生列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/学生列表.png -------------------------------------------------------------------------------- /img/管理员图片/学院列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/学院列表.png -------------------------------------------------------------------------------- /img/管理员图片/已发试卷.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/已发试卷.png -------------------------------------------------------------------------------- /img/管理员图片/成绩管理_查看成绩.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/成绩管理_查看成绩.png -------------------------------------------------------------------------------- /img/管理员图片/教师列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/教师列表.png -------------------------------------------------------------------------------- /img/管理员图片/查看成绩.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/查看成绩.png -------------------------------------------------------------------------------- /img/管理员图片/添加学院.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/添加学院.png -------------------------------------------------------------------------------- /img/管理员图片/管理员列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/管理员列表.png -------------------------------------------------------------------------------- /img/管理员图片/试卷列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/试卷列表.png -------------------------------------------------------------------------------- /img/管理员图片/课程列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/管理员图片/课程列表.png -------------------------------------------------------------------------------- /img/运行项目.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/运行项目.png -------------------------------------------------------------------------------- /img/项目初始化.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/img/项目初始化.png -------------------------------------------------------------------------------- /server/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const history = require('connect-history-api-fallback'); 3 | const app = express() 4 | app.set('secret','asdf');//第二个参数随便写,第一个参数要记得,取的时候get('secret'); 5 | // app.use(history()); //解决history模式下刷新浏览器,返回404的问题 6 | 7 | app.use(require('cors')()); //解决跨区问题 8 | app.use(express.json()); //返回仅解析 JSON 并仅查看Content-Type标头与type选项匹配的请求的中间件 9 | app.use('/uploads',express.static(__dirname + '/uploads'))//访问这个路由时,拿到uploads文件夹里面的静态资源 10 | 11 | require('./plugins/index')(); 12 | require('./routes/admin')(app); 13 | // require('./routes/student')(app); 14 | // require('./routes/teacher')(app); 15 | 16 | app.listen(5000, () => console.log(`http://127.0.0.1:5000`)) -------------------------------------------------------------------------------- /server/models/AdminUser.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | name:{ 5 | type:String 6 | }, 7 | password:{ 8 | type: String, 9 | // select:false,//点击编辑的时候密码不要被查出来,这样密码就不会被多次散列 10 | // //给密码加密 11 | // set(val){ 12 | // return require('bcrypt').hashSync(val,10);//这里数字越高越安全,但是耗时越多 13 | // } 14 | }, 15 | icon:{ 16 | type:String 17 | }, 18 | date:{ 19 | type:String, 20 | default:new Date().toLocaleDateString() 21 | } 22 | }) 23 | module.exports = mongoose.model('AdminUser', schema) -------------------------------------------------------------------------------- /server/models/Class.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | name:String,//班级名称 5 | // pName:String,//专业名称 6 | //关联专业表 7 | profession:{ 8 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 9 | ref:'Profession' 10 | }, 11 | //关联学院表 12 | college:{ 13 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 14 | ref:'College' 15 | }, 16 | logoImg:{ 17 | type:String 18 | }, 19 | date:{ 20 | type:String, 21 | default:new Date().toLocaleDateString() 22 | } 23 | }) 24 | module.exports = mongoose.model('Class', schema) -------------------------------------------------------------------------------- /server/models/College.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | name:{ 5 | type:String//学院名称 6 | }, 7 | logoImg:{ 8 | type:String//学院图片 9 | }, 10 | date:{ 11 | type:String, 12 | default:new Date().toLocaleDateString() 13 | }, 14 | }) 15 | module.exports = mongoose.model('College', schema) -------------------------------------------------------------------------------- /server/models/Course.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | name:String,//课程名称 5 | logoImg:{ 6 | type:String 7 | }, 8 | date:{ 9 | type:String, 10 | default:new Date().toLocaleDateString() 11 | }, 12 | writer:String 13 | }) 14 | module.exports = mongoose.model('Course', schema) -------------------------------------------------------------------------------- /server/models/CourseStudent.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | sId:Number, 5 | tId:Number, 6 | profession_course: { 7 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 8 | ref: 'ProfessionCourse' 9 | }, //假如的课程 10 | //学生属于哪个专业的,关联专业表 11 | profession: { 12 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 13 | ref: 'Profession' 14 | }, 15 | //关联学院表 16 | college: { 17 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 18 | ref: 'College' 19 | }, 20 | class: { 21 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 22 | ref: 'Class' 23 | }, 24 | date: { //学生进入课程的时间 25 | type: String, 26 | default: new Date().toLocaleDateString() 27 | } 28 | }) 29 | module.exports = mongoose.model('CourseStudent', schema) -------------------------------------------------------------------------------- /server/models/CourseTestPaper.js: -------------------------------------------------------------------------------- 1 | //课程考试 2 | const mongoose = require('mongoose'); 3 | const Schema = mongoose.Schema; 4 | const schema = new Schema({ 5 | profession_course:{ 6 | type: mongoose.SchemaTypes.ObjectId, 7 | ref:'ProfessionCourse' 8 | }, 9 | tId:Number, 10 | //试卷标题 11 | title: { 12 | type: String, 13 | }, 14 | //单选题 15 | singleTopicSelection: Array, 16 | //多选题 17 | multipleChoice: Array, 18 | //判断题 19 | trueFalse: Array, 20 | //试卷提数 21 | number: { 22 | type:Number, 23 | default:0 24 | }, 25 | //试卷分值, 26 | total: { 27 | type:Number, 28 | default:0 29 | }, 30 | //考试时长,时间戳 31 | duration: Number, 32 | //考试时间,时间戳 33 | time: Array, 34 | //考试时长,字符串格式 35 | durationStr: String, 36 | //考试时间,字符串格式 37 | timeStr: Array, 38 | isTitleRandon: { 39 | type:Boolean, 40 | default:false 41 | }, //题目是否随机排序 42 | isOptionsRandon: { 43 | type:Boolean, 44 | default:false 45 | }, //选项是否随机排序 46 | isInspect:{ 47 | type:Boolean, 48 | default:true 49 | },//作答后是否可以查看试卷 50 | isSave:{ 51 | type:Boolean, 52 | default:false 53 | },//试卷是否已发布 54 | isTotal:{ 55 | type:Boolean, 56 | default:true 57 | },//学生提交试卷后可以看到分数 58 | isRepetition:{ 59 | type:Boolean, 60 | default:false 61 | },//是否可以重复考试 62 | repetition:{ 63 | type:Number, 64 | default:0 65 | }, 66 | date: { 67 | type: String, 68 | default: new Date().toLocaleDateString() 69 | }, 70 | //考试时间是否开始,true开始 71 | isStart:{ 72 | type:Boolean, 73 | default:false//默认还没开始考试 74 | }, 75 | //考试时间是否过期,true为过期 76 | isEnd:{ 77 | type:Boolean, 78 | default:false//默认还没结束 79 | }, 80 | }) 81 | module.exports = mongoose.model('CourseTestPaper', schema); -------------------------------------------------------------------------------- /server/models/CourseTestPaperScore.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | // 学生的学号,姓名,成绩,学院,专业,班级 5 | sId: Number, 6 | name: String, 7 | score: { 8 | type:Number, 9 | default:2//不设置分数默认2分 10 | }, 11 | profession_course:{ 12 | type: mongoose.SchemaTypes.ObjectId, 13 | ref:'ProfessionCourse' 14 | }, 15 | //查看成绩的时候需要用 16 | college: { 17 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 18 | ref: 'College' 19 | }, //学院 20 | profession: { 21 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 22 | ref: 'Profession' 23 | }, 24 | class: { 25 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 26 | ref: 'Class' 27 | }, ///班级 28 | //单选题答案 29 | singleTopicSelection:Array, 30 | //多选题答案 31 | multipleChoice:Array, 32 | //判断题答案 33 | trueFalse:Array, 34 | //考的试卷 35 | course_test_paper:{ 36 | type: mongoose.SchemaTypes.ObjectId, 37 | ref:"CourseTestPaper" 38 | }, 39 | //当前考试时间 40 | time: { 41 | type: String, 42 | default: new Date().toLocaleDateString() 43 | } 44 | }) 45 | module.exports = mongoose.model('CourseTestPaperScore', schema) -------------------------------------------------------------------------------- /server/models/Profession.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | name:{ 5 | type:String 6 | }, 7 | // cName:String, 8 | // 关联学院表 9 | college:{ 10 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 11 | ref:'College' 12 | }, 13 | logoImg:{ 14 | type:String 15 | }, 16 | date:{ 17 | type:String, 18 | default:new Date().toLocaleDateString() 19 | } 20 | }) 21 | module.exports = mongoose.model('Profession', schema) -------------------------------------------------------------------------------- /server/models/ProfessionCourse.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | name:String,//课程名称 5 | tId:Number, 6 | writer:String,//课程作者 7 | //关联专业表 8 | profession:{ 9 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 10 | ref:'Profession' 11 | }, 12 | //关联学院表 13 | college:{ 14 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 15 | ref:'College' 16 | }, 17 | logoImg:{ 18 | type:String 19 | }, 20 | date:{//课程创建时间 21 | type:String, 22 | default:new Date().toLocaleDateString() 23 | } 24 | }) 25 | module.exports = mongoose.model('ProfessionCourse', schema) -------------------------------------------------------------------------------- /server/models/PublishedPaper.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | //试卷标题 5 | name:{ 6 | type:String, 7 | }, 8 | //单选题 9 | singleTopicSelection:Array, 10 | //多选题 11 | multipleChoice:Array, 12 | //判断题 13 | trueFalse:Array, 14 | //试卷提数 15 | number:Number, 16 | //试卷分值, 17 | total:Number, 18 | //考试时长,时间戳 19 | duration:Number, 20 | //考试时间,时间戳 21 | time:Array, 22 | //考试时长,字符串格式 23 | durationStr:String, 24 | //考试时间,字符串格式 25 | timeStr:Array, 26 | date:{ 27 | type:String, 28 | default:new Date().toLocaleDateString() 29 | } 30 | }) 31 | module.exports = mongoose.model('PublishedPaper', schema); -------------------------------------------------------------------------------- /server/models/StudentUser.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | //姓名 5 | name:String, 6 | //密码 7 | password:String, 8 | //学号 9 | sId:{type:Number}, 10 | icon:{ 11 | type:String 12 | }, 13 | //创建时间 14 | date:{ 15 | type:String, 16 | default:new Date().toLocaleDateString() 17 | }, 18 | age:Number,//年龄 19 | gender:String,//性别 20 | college:{ 21 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 22 | ref:'College' 23 | },//学院 24 | profession:{ 25 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 26 | ref:'Profession' 27 | }, 28 | class:{ 29 | type: mongoose.SchemaTypes.ObjectId,//_id的特殊类型 30 | ref:'Class' 31 | },///班级 32 | //简介 33 | introductionToThe:{ 34 | phone:Number,//电话号码 35 | address:String,//家庭地址 36 | eMain:String,//邮箱 37 | dateOfBirth:String,//出生日期 38 | } 39 | 40 | }) 41 | module.exports = mongoose.model('StudentUser', schema) -------------------------------------------------------------------------------- /server/models/TeacherUser.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | //教师名 5 | name: String, 6 | //密码 7 | password: String, 8 | //教师号 9 | tId: { 10 | type: Number 11 | }, 12 | icon: { 13 | type: String 14 | }, 15 | //创建时间 16 | date: { 17 | type: String, 18 | default: new Date().toLocaleDateString() 19 | }, 20 | age: { 21 | type: Number, 22 | default: 0 23 | }, //年龄 24 | // gender: { 25 | // type: String, 26 | // default: "1" 27 | // }, //性别 28 | gender:String,//性别 29 | college: { 30 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 31 | ref: 'College' 32 | }, //学院 33 | profession: { 34 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 35 | ref: 'Profession' 36 | }, 37 | class: { 38 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 39 | ref: 'Class' 40 | }, ///班级 41 | //简介 42 | introductionToThe: { 43 | teachersTitle: String, //教师职称 44 | phone: Number, //电话号码 45 | // address:String,//家庭住址 46 | eMain: String, //邮箱 47 | dateOfBirth: Number, //出生日期,时间戳 48 | dateOfBirthStr: String, //出生日期,字符串 49 | } 50 | 51 | }) 52 | module.exports = mongoose.model('TeacherUser', schema) -------------------------------------------------------------------------------- /server/models/TestPaper.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | //试卷标题 5 | name: { 6 | type: String, 7 | }, 8 | course:{//课程 9 | type:mongoose.SchemaTypes.ObjectId, 10 | ref:"Course" 11 | }, 12 | //单选题 13 | singleTopicSelection: Array, 14 | //多选题 15 | multipleChoice: Array, 16 | //判断题 17 | trueFalse: Array, 18 | //试卷提数 19 | number: { 20 | type:Number, 21 | default:0 22 | }, 23 | //试卷分值, 24 | total: { 25 | type:Number, 26 | default:0 27 | }, 28 | //考试时长,时间戳 29 | duration: Number, 30 | //考试时间,时间戳 31 | time: Array, 32 | //考试时长,字符串格式 33 | durationStr: String, 34 | //考试时间,字符串格式 35 | timeStr: Array, 36 | //题目是否随机排序 37 | isTitleRandon: { 38 | type:Boolean, 39 | default:false 40 | }, 41 | //选项是否随机排序 42 | isOptionsRandon: { 43 | type:Boolean, 44 | default:false 45 | }, 46 | //作答后是否可以查看试卷 47 | isInspect:{ 48 | type:Boolean, 49 | default:true 50 | }, 51 | //试卷是否已发布 52 | isSave:{ 53 | type:Boolean, 54 | default:false 55 | }, 56 | //学生提交试卷后可以看到分数 57 | isTotal:{ 58 | type:Boolean, 59 | default:true 60 | }, 61 | //是否可以重复考试 62 | isRepetition:{ 63 | type:Boolean, 64 | default:false 65 | }, 66 | //重复次数 67 | repetition:{ 68 | type:Number, 69 | default:0 70 | }, 71 | date: { 72 | type: String, 73 | default: new Date().toLocaleDateString() 74 | }, 75 | //考试时间是否开始,true开始 76 | isStart:{ 77 | type:Boolean, 78 | default:false//默认还没开始考试 79 | }, 80 | //考试时间是否过期,true为过期 81 | isEnd:{ 82 | type:Boolean, 83 | default:false//默认还没结束 84 | }, 85 | }) 86 | module.exports = mongoose.model('TestPaper', schema); -------------------------------------------------------------------------------- /server/models/TestPaperScore.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Schema = mongoose.Schema; 3 | const schema = new Schema({ 4 | // 学生的姓名,id,成绩,学院,专业,班级 5 | sId: Number, 6 | name: String, 7 | score: { 8 | type: Number, 9 | default: 2 //不设置分数默认2分 10 | }, 11 | course: { 12 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 13 | ref: 'Course' 14 | }, 15 | //查看成绩的时候需要用 16 | college: { 17 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 18 | ref: 'College' 19 | }, //学院 20 | profession: { 21 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 22 | ref: 'Profession' 23 | }, 24 | class: { 25 | type: mongoose.SchemaTypes.ObjectId, //_id的特殊类型 26 | ref: 'Class' 27 | }, ///班级 28 | //单选题答案 29 | singleTopicSelection: Array, 30 | //多选题答案 31 | multipleChoice: Array, 32 | //判断题答案 33 | trueFalse: Array, 34 | //考的试卷 35 | test_paper: { 36 | type: mongoose.SchemaTypes.ObjectId, 37 | ref: "TestPaper" 38 | }, 39 | //当前考试时间 40 | time: { 41 | type: String, 42 | default: new Date().toLocaleDateString() 43 | } 44 | }) 45 | module.exports = mongoose.model('TestPaperScore', schema) -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "serve": "nodemon index.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "bcrypt": "^5.0.1", 15 | "connect-history-api-fallback": "^1.6.0", 16 | "cors": "^2.8.5", 17 | "express": "^5.0.0-alpha.8", 18 | "http-assert": "^1.5.0", 19 | "inflection": "^1.13.1", 20 | "jsonwebtoken": "^8.5.1", 21 | "mongoose": "^6.0.12", 22 | "multer": "^1.4.3" 23 | }, 24 | "devDependencies": { 25 | "nodemon": "^2.0.15" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/plugins/index.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | const mongoose = require('mongoose') 3 | mongoose.connect('mongodb://127.0.0.1:27017/test_system', { 4 | useNewUrlParser: true 5 | }) 6 | mongoose.connection.once("open",function(){ 7 | console.log("数据库连接成功~~~"); 8 | }); 9 | } -------------------------------------------------------------------------------- /server/routes/admin/tool.js: -------------------------------------------------------------------------------- 1 | module.exports = (resource) => { 2 | let date = new Date(); 3 | let time = date.getTime(); 4 | if (resource && resource.length > 0) { 5 | resource.forEach(item => { //如果试卷的开始时间小于当前时间,这表示开始 6 | if (item.time[0] < time) { 7 | item.isStart = true; 8 | } 9 | //如果试卷的结束时间小于当前时间,表示为过期 10 | if (item.time[1] < time) { 11 | item.isEnd = true; 12 | } 13 | }) 14 | } 15 | } -------------------------------------------------------------------------------- /server/uploads/105-1638707644404-17021444845865896.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/105-1638707644404-17021444845865896.jpg -------------------------------------------------------------------------------- /server/uploads/107-1638707515381-33905725661431263.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/107-1638707515381-33905725661431263.jpg -------------------------------------------------------------------------------- /server/uploads/1133-1638706370404-11503081187992814.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/1133-1638706370404-11503081187992814.jpg -------------------------------------------------------------------------------- /server/uploads/154-1638706327753-40278043690084187.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/154-1638706327753-40278043690084187.jpg -------------------------------------------------------------------------------- /server/uploads/162-1638706636812-6925329176058272.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/162-1638706636812-6925329176058272.jpg -------------------------------------------------------------------------------- /server/uploads/ec0346c22c1a22117d5c35b73d8b1131-1638706355203-49428216796329694.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/ec0346c22c1a22117d5c35b73d8b1131-1638706355203-49428216796329694.jpeg -------------------------------------------------------------------------------- /server/uploads/f8bba026c9c981e2e64883c2401095ba-1638705742774-21076726149562552.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/f8bba026c9c981e2e64883c2401095ba-1638705742774-21076726149562552.jpg -------------------------------------------------------------------------------- /server/uploads/f8bba026c9c981e2e64883c2401095ba-1638705750580-954636825210601.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/f8bba026c9c981e2e64883c2401095ba-1638705750580-954636825210601.jpg -------------------------------------------------------------------------------- /server/uploads/fdb09701464f481aa9e52d68aa38e0f7-1638706406720-7306530212142099.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/fdb09701464f481aa9e52d68aa38e0f7-1638706406720-7306530212142099.jpeg -------------------------------------------------------------------------------- /server/uploads/微信图片_20200728212948-1638705885630-6168440191545215.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/微信图片_20200728212948-1638705885630-6168440191545215.jpg -------------------------------------------------------------------------------- /server/uploads/微信图片_20200729222951-1638705874566-646082976537605.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/微信图片_20200729222951-1638705874566-646082976537605.jpg -------------------------------------------------------------------------------- /server/uploads/微信图片_20200804162337-1638705859324-6958982340464892.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/微信图片_20200804162337-1638705859324-6958982340464892.jpg -------------------------------------------------------------------------------- /server/uploads/微信图片_20200906225604-1640915095265-1234780995818332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/微信图片_20200906225604-1640915095265-1234780995818332.jpg -------------------------------------------------------------------------------- /server/uploads/电信学院-1638705797999-28499394079109686.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/电信学院-1638705797999-28499394079109686.jpg -------------------------------------------------------------------------------- /server/uploads/电信学院-1638705842948-7615712295337584.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/电信学院-1638705842948-7615712295337584.jpg -------------------------------------------------------------------------------- /server/uploads/电信学院-1638706032073-7540723842114565.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/电信学院-1638706032073-7540723842114565.jpg -------------------------------------------------------------------------------- /server/uploads/电信学院-1638706037227-21866449252151887.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/电信学院-1638706037227-21866449252151887.jpg -------------------------------------------------------------------------------- /server/uploads/电信学院-1638706042698-990705742910003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/电信学院-1638706042698-990705742910003.jpg -------------------------------------------------------------------------------- /server/uploads/艺设-1638706150341-14147153410714886.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/艺设-1638706150341-14147153410714886.jpg -------------------------------------------------------------------------------- /server/uploads/高等数学-1638705999668-010306619521483595.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/server/uploads/高等数学-1638705999668-010306619521483595.jpeg -------------------------------------------------------------------------------- /student/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /student/README.md: -------------------------------------------------------------------------------- 1 | # student 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Customize configuration 19 | See [Configuration Reference](https://cli.vuejs.org/config/). 20 | -------------------------------------------------------------------------------- /student/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ], 5 | plugins: [ 6 | ['import', { 7 | libraryName: 'vant', 8 | libraryDirectory: 'es', 9 | style: true 10 | }, 'vant'] 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /student/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "student", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.24.0", 11 | "core-js": "^3.6.5", 12 | "vant": "^2.0.5", 13 | "vue": "^2.6.11", 14 | "vue-router": "^3.2.0" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "~4.5.0", 18 | "@vue/cli-plugin-router": "~4.5.0", 19 | "@vue/cli-service": "~4.5.0", 20 | "axios": "^0.18.0", 21 | "babel-plugin-import": "^1.13.3", 22 | "vue-cli-plugin-axios": "^0.0.4", 23 | "vue-cli-plugin-vant": "^1.0.1", 24 | "vue-template-compiler": "^2.6.11" 25 | }, 26 | "browserslist": [ 27 | "> 1%", 28 | "last 2 versions", 29 | "not dead" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /student/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/student/public/favicon.ico -------------------------------------------------------------------------------- /student/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /student/src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | 16 | 23 | -------------------------------------------------------------------------------- /student/src/assets/img/dxyy1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/student/src/assets/img/dxyy1.jpg -------------------------------------------------------------------------------- /student/src/assets/img/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxrxiaoha/campusExaminationSystem/ea1dabbba9fd0bdd422550a7c64ea15257822190/student/src/assets/img/none.png -------------------------------------------------------------------------------- /student/src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 91 | -------------------------------------------------------------------------------- /student/src/components/TabBar.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 26 | -------------------------------------------------------------------------------- /student/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import './plugins/vant.js' 5 | import http from './network/http'; 6 | import { Notify } from 'vant'; 7 | Vue.config.productionTip = false 8 | Vue.prototype.$http = http 9 | // Vue.prototype.$bus = new Vue() 10 | Vue.mixin({ 11 | methods: { 12 | getAuthHeaders() { 13 | if (localStorage.s_user) { 14 | return { 15 | Authorization: `${JSON.parse(localStorage.s_user).s_token}` 16 | } 17 | } else { 18 | return { 19 | Authorization: '' 20 | } 21 | } 22 | 23 | }, 24 | //图片的验证 25 | beforeAvatarUpload(file) { 26 | const imgType = ['image/jpeg', 'image/png'] 27 | const isJPG = imgType.includes(file.type); 28 | const isLt2M = file.size / 1024 / 1024 < 2; 29 | if (!isJPG) { 30 | Notify({ type: 'warning', message: '上传头像图片只能是 JPG 格式或 PNG 格式!' }); 31 | } 32 | if (!isLt2M) { 33 | Notify({ type: 'warning', message: '上传头像图片大小不能超过 2MB!' }); 34 | } 35 | return isJPG && isLt2M; 36 | }, 37 | } 38 | }) 39 | new Vue({ 40 | router, 41 | render: h => h(App), 42 | // beforeCreate() { 43 | // //安装全局事件总线 44 | // Vue.prototype.$bus = this 45 | // }, 46 | }).$mount('#app') -------------------------------------------------------------------------------- /student/src/network/http.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | const http = axios.create({ 3 | baseURL: 'http://localhost:5000/api' 4 | //baseURL: 'http://466x3521o6.qicp.vip:48921/api' 5 | }) 6 | // 添加请求拦截器 7 | http.interceptors.request.use(function (config) { 8 | // 在发送请求之前做些什么 9 | if (localStorage.s_user) { 10 | config.headers.Authorization = JSON.parse(localStorage.s_user).s_token; 11 | } 12 | return config; 13 | }, function (error) { 14 | // 对请求错误做些什么 15 | return Promise.reject(error); 16 | }); 17 | 18 | // 添加响应拦截器 19 | http.interceptors.response.use(function (response) { 20 | // 对响应数据做点什么 21 | return response; 22 | }, function (error) { 23 | // 对响应错误做点什么 24 | // location.replace("/student/login") 25 | return Promise.reject(error); 26 | }); 27 | export default http -------------------------------------------------------------------------------- /student/src/plugins/vant.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { Tabbar, TabbarItem } from 'vant'; 3 | import { NavBar } from 'vant'; 4 | import { Icon } from 'vant'; 5 | import { Tab, Tabs } from 'vant'; 6 | import { Form } from 'vant'; 7 | import { Field } from 'vant'; 8 | import { Button } from 'vant'; 9 | import { RadioGroup, Radio } from 'vant'; 10 | import { Checkbox, CheckboxGroup } from 'vant'; 11 | import { Uploader } from 'vant'; 12 | import { Cell, CellGroup } from 'vant'; 13 | import { Popup } from 'vant'; 14 | import { Picker } from 'vant'; 15 | import { Image as VanImage } from 'vant'; 16 | import { DatetimePicker } from 'vant'; 17 | import { Toast } from 'vant'; 18 | 19 | Vue.use(Toast); 20 | Vue.use(DatetimePicker); 21 | Vue.use(VanImage); 22 | Vue.use(Picker); 23 | Vue.use(Popup); 24 | Vue.use(Cell); 25 | Vue.use(CellGroup); 26 | Vue.use(Uploader); 27 | Vue.use(Checkbox); 28 | Vue.use(CheckboxGroup); 29 | Vue.use(Radio); 30 | Vue.use(RadioGroup); 31 | Vue.use(Button); 32 | Vue.use(Form); 33 | Vue.use(Field); 34 | Vue.use(Tab); 35 | Vue.use(Tabs); 36 | Vue.use(Tabbar); 37 | Vue.use(TabbarItem); 38 | Vue.use(NavBar); 39 | Vue.use(Icon); -------------------------------------------------------------------------------- /student/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import { Notify } from 'vant'; 4 | const Main = () => import("../views/Main.vue"); 5 | const Home = () => import("../views/home/Home.vue"); 6 | const My = () => import("../views/My/My.vue"); 7 | const TestParper = () => import("../components/TestParper.vue"); 8 | const CourseTestParper = () => import("../components/CourseTestParper.vue"); 9 | const AccomplishTestParper = () => import("../components/AccomplishTestParper.vue"); 10 | const Login = () => import('../components/Login.vue'); 11 | const SchoolExam = () => import('../views/home/child/school/SchoolExam.vue') 12 | const CourseExam = () => import('../views/home/child/course/CourseExam.vue') 13 | const Accomplish = () => import('../views/home/child/accomplish/Accomplish.vue') 14 | const AccomplishCourse = () => import('../views/home/child/accomplish/AccomplishCourse.vue') 15 | const EditPassword = () => import('../views/My/EditPassword.vue') 16 | 17 | Vue.use(VueRouter) 18 | 19 | const routes = [{ 20 | path: '/', 21 | redirect: '/main/home' 22 | }, 23 | { 24 | path: "/main", 25 | redirect: '/main/home', 26 | component: Main, 27 | children: [{ 28 | path: 'home', 29 | component: Home 30 | }, 31 | { 32 | path: 'my', 33 | name:My, 34 | component: My 35 | }, 36 | { 37 | path: 'edit_password/:sId', 38 | component: EditPassword, 39 | props:true 40 | }, 41 | { 42 | path:'school_exam/:id', 43 | component:SchoolExam, 44 | props:true 45 | }, 46 | { 47 | path:'course_exam/:id', 48 | component:CourseExam, 49 | props:true 50 | }, 51 | { 52 | path:'accomplish/:name/:id', 53 | component:Accomplish, 54 | props:true 55 | }, 56 | { 57 | path: "test_parper", 58 | name: 'test_parper', 59 | component: TestParper, 60 | props($route){ 61 | return {id:$route.query.id} 62 | } 63 | }, 64 | { 65 | path: "course_test_parper", 66 | name: 'course_test_parper', 67 | component: CourseTestParper, 68 | props($route){ 69 | return {id:$route.query.id} 70 | } 71 | }, 72 | { 73 | path: "accomplish_test_parper", 74 | name: 'accomplish_test_parper', 75 | component: AccomplishTestParper, 76 | props($route){ 77 | return {id:$route.query.id} 78 | } 79 | }, 80 | { 81 | path: "accomplish_course", 82 | name: 'accomplish_course', 83 | component: AccomplishCourse, 84 | props($route){ 85 | return {name:$route.query.name} 86 | } 87 | } 88 | ] 89 | }, 90 | { 91 | path: '/student/login', 92 | name: 'login', 93 | component: Login, 94 | meta: { 95 | isPublic: true //使用可以直接访问 96 | } 97 | } 98 | ] 99 | 100 | const router = new VueRouter({ 101 | mode: 'history', 102 | // base: process.env.BASE_URL, 103 | routes 104 | }) 105 | router.beforeEach((to, form, next) => { 106 | if (to.path == '/main/my') { 107 | return next(); 108 | } 109 | if (localStorage.s_user) { 110 | if (!to.meta.isPublic && !JSON.parse(localStorage.s_user).s_token) { 111 | return next('/student/login'); 112 | } 113 | if (localStorage.personalDetails) { 114 | let personalDetails = JSON.parse(localStorage.personalDetails) 115 | if (!personalDetails.college || !personalDetails.profession || !personalDetails.class) { 116 | Notify({ type: 'warning', message: '请完善个人信息在继续其他操作' }); 117 | return next('/main/my') 118 | } 119 | } 120 | } else if (!to.meta.isPublic && !localStorage.s_token) { 121 | return next('/student/login'); 122 | } 123 | next(); 124 | }) 125 | export default router -------------------------------------------------------------------------------- /student/src/views/Main.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 24 | -------------------------------------------------------------------------------- /student/src/views/My/EditPassword.vue: -------------------------------------------------------------------------------- 1 | 49 | 50 | 86 | -------------------------------------------------------------------------------- /student/src/views/home/Home.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 45 | -------------------------------------------------------------------------------- /student/src/views/home/child/accomplish/Accomplish.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 115 | -------------------------------------------------------------------------------- /student/src/views/home/child/accomplish/AccomplishCourse.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 71 | -------------------------------------------------------------------------------- /student/src/views/home/child/accomplish/FenLei.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 27 | -------------------------------------------------------------------------------- /student/src/views/home/child/course/CourseExam.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 90 | -------------------------------------------------------------------------------- /student/src/views/home/child/course/ProfessionCourse.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 54 | -------------------------------------------------------------------------------- /student/src/views/home/child/school/SchoolCourse.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 45 | -------------------------------------------------------------------------------- /student/src/views/home/child/school/SchoolExam.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 98 | -------------------------------------------------------------------------------- /student/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | configureWebpack: { 3 | resolve: { 4 | alias: { 5 | 'assets': '@/assets', 6 | 'components': '@/components', 7 | 'network': '@/network', 8 | 'views': '@/views', 9 | 'store': '@/store', 10 | } 11 | } 12 | } 13 | } 14 | 15 | --------------------------------------------------------------------------------