├── web
├── src
│ ├── store
│ │ ├── getter.js
│ │ ├── mutation-type.js
│ │ ├── store.js
│ │ ├── actions.js
│ │ ├── mutations.js
│ │ └── state.js
│ ├── assets
│ │ └── logo.png
│ ├── App.vue
│ ├── main.js
│ ├── router
│ │ └── index.js
│ └── components
│ │ ├── Login.vue
│ │ ├── Student
│ │ └── index.vue
│ │ ├── Teacher
│ │ └── index.vue
│ │ └── Administrator
│ │ └── index.vue
├── static
│ ├── .gitkeep
│ ├── css
│ │ └── error-mask.css
│ └── js
│ │ ├── clickoutside.js
│ │ ├── cookie.js
│ │ ├── date.js
│ │ ├── cloneObject.js
│ │ └── meteor.exec.js
├── config
│ ├── prod.env.js
│ ├── dev.env.js
│ └── index.js
├── .editorconfig
├── .gitignore
├── .babelrc
├── .postcssrc.js
├── index.html
├── README.md
├── build
│ ├── vue-loader.conf.js
│ ├── build.js
│ ├── check-versions.js
│ ├── webpack.base.conf.js
│ ├── utils.js
│ ├── webpack.dev.conf.js
│ └── webpack.prod.conf.js
└── package.json
└── service
├── demo
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── demo
│ │ │ └── DemoApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── DemoApplicationTests.java
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ ├── maven-wrapper.properties
│ │ └── MavenWrapperDownloader.java
├── .gitignore
├── pom.xml
├── mvnw.cmd
└── mvnw
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ ├── maven-wrapper.properties
│ └── MavenWrapperDownloader.java
├── src
├── main
│ ├── java
│ │ └── com
│ │ │ └── wanderpoet
│ │ │ └── experiment
│ │ │ ├── dao
│ │ │ ├── SelectionDao.java
│ │ │ ├── AdminDao.java
│ │ │ ├── CourseDao.java
│ │ │ ├── TeacherDao.java
│ │ │ └── StudentDao.java
│ │ │ ├── ExperimentApplication.java
│ │ │ ├── entity
│ │ │ ├── Admin.java
│ │ │ ├── Selection.java
│ │ │ ├── Teacher.java
│ │ │ ├── Course.java
│ │ │ └── Student.java
│ │ │ └── controller
│ │ │ ├── AdminController.java
│ │ │ ├── TeacherController.java
│ │ │ ├── StudentController.java
│ │ │ ├── LoginController.java
│ │ │ └── CourseController.java
│ └── resources
│ │ └── application.yml
└── test
│ └── java
│ └── com
│ └── wanderpoet
│ └── experiment
│ └── ExperimentApplicationTests.java
├── .gitignore
├── pom.xml
├── mvnw.cmd
└── mvnw
/web/src/store/getter.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/web/static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/service/demo/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/web/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/web/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMGO/CourseSystem/HEAD/web/src/assets/logo.png
--------------------------------------------------------------------------------
/service/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMGO/CourseSystem/HEAD/service/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/service/demo/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LMGO/CourseSystem/HEAD/service/demo/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/service/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
2 |
--------------------------------------------------------------------------------
/service/demo/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
2 |
--------------------------------------------------------------------------------
/web/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 | })
8 |
--------------------------------------------------------------------------------
/web/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/web/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/web/src/store/mutation-type.js:
--------------------------------------------------------------------------------
1 | export const RECEIVE_LIST = 'receive_list' //
2 | export const MOVIES_ARR = 'movies_arr' //
3 | export const OPENID = 'openId' //我的id
4 | export const MYWXINFO = 'myWxInfo' //我的微信资料
5 | export const MYCOSINFO = 'myCosInfo' //我的自定义资料
--------------------------------------------------------------------------------
/web/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/web/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | course-system
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/dao/SelectionDao.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.dao;
2 |
3 | import com.wanderpoet.experiment.entity.Selection;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | public interface SelectionDao extends JpaRepository {
7 | public Selection findByid(Integer id);
8 | }
9 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/dao/AdminDao.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.dao;
2 |
3 | import com.wanderpoet.experiment.entity.Admin;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | import java.util.Set;
7 |
8 | public interface AdminDao extends JpaRepository {
9 | public Admin findByAname(String aname);
10 | }
11 |
--------------------------------------------------------------------------------
/web/src/store/store.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | import store from './store'
4 | import state from './state'
5 | import actions from './actions'
6 | import mutations from './mutations'
7 | import getters from './getter'
8 |
9 |
10 | // 声明使用vuex
11 | Vue.use(Vuex)
12 |
13 | export default new Vuex.Store({
14 | state,
15 | actions,
16 | getters,
17 | mutations
18 | })
--------------------------------------------------------------------------------
/service/demo/src/main/java/com/example/demo/DemoApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class DemoApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(DemoApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/service/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8080
3 |
4 | spring:
5 | datasource:
6 | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
7 | url: jdbc:sqlserver://localhost:1433;DatabaseName=experiment
8 | username: root
9 | password: root
10 | jpa:
11 | database: sql_server
12 | hibernate:
13 | ddl-auto: update
14 | show-sql: true
15 | database-platform: org.hibernate.dialect.SQLServer2008Dialect
16 |
--------------------------------------------------------------------------------
/service/demo/src/test/java/com/example/demo/DemoApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class DemoApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/service/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**
5 | !**/src/test/**
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 |
30 | ### VS Code ###
31 | .vscode/
32 |
--------------------------------------------------------------------------------
/service/demo/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**
5 | !**/src/test/**
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 |
30 | ### VS Code ###
31 | .vscode/
32 |
--------------------------------------------------------------------------------
/service/src/test/java/com/wanderpoet/experiment/ExperimentApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class ExperimentApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/ExperimentApplication.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6 |
7 | @SpringBootApplication
8 | public class ExperimentApplication {
9 |
10 | public static void main(String[] args) {
11 | SpringApplication.run(ExperimentApplication.class, args);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/web/static/css/error-mask.css:
--------------------------------------------------------------------------------
1 | #mask > * {
2 | color: white;
3 | }
4 |
5 | /* 遮罩层 */
6 | #mask {
7 | background-color: rgb(0, 0, 0, 0.4);
8 | width: 100%;
9 | height: 100%;
10 | }
11 |
12 | /* 占位盒子 */
13 | #mask > div:first-child {
14 | height: 85px;
15 | }
16 |
17 | #mask > h1 {
18 | font-size: 84px;
19 | }
20 |
21 | #mask > h2 {
22 | font-size: 50px;
23 | }
24 |
25 | #mask > h2 > a {
26 | color: #fa8341;
27 | }
28 |
29 | #mask > h2 > a:hover {
30 | color: #409eff;
31 | }
--------------------------------------------------------------------------------
/web/README.md:
--------------------------------------------------------------------------------
1 | # course-system
2 |
3 | > A Vue.js project
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 |
17 | # build for production and view the bundle analyzer report
18 | npm run build --report
19 | ```
20 |
21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
22 |
--------------------------------------------------------------------------------
/web/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
31 |
--------------------------------------------------------------------------------
/web/src/store/actions.js:
--------------------------------------------------------------------------------
1 | import {RECEIVE_LIST, MOVIES_ARR, OPENID, MYWXINFO, MYCOSINFO} from './mutation-type'
2 | // import listData from '../datas/list-data'
3 |
4 | export default {
5 | // getList({commit}){
6 | // // 触发对应的mutation
7 | // console.log('actions');
8 | // commit(RECEIVE_LIST, listData)
9 | // },
10 | // getMoviesArr({commit}, data){
11 | // commit(MOVIES_ARR, data)
12 | // },
13 | getOpenId({commit}, data){
14 | commit(OPENID, data)
15 | },
16 | getMyWxInfo({commit}, data){
17 | commit(MYWXINFO, data)
18 | },
19 | getMyCosInfo({commit}, data){
20 | commit(MYCOSINFO, data)
21 | },
22 | }
--------------------------------------------------------------------------------
/web/static/js/clickoutside.js:
--------------------------------------------------------------------------------
1 | export default {
2 | bind (el, binding, vnode) {
3 | function documentHandler (e) {
4 | if (el.contains(e.target)) {
5 | return false;
6 | }
7 | if (binding.expression) {
8 | binding.value(e);
9 | }
10 | }
11 | el.__vueClickOutside__ = documentHandler;
12 | document.addEventListener('click', documentHandler);
13 | },
14 | update () {
15 |
16 | },
17 | unbind (el, binding) {
18 | document.removeEventListener('click', el.__vueClickOutside__);
19 | delete el.__vueClickOutside__;
20 | }
21 | };
--------------------------------------------------------------------------------
/web/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/web/src/store/mutations.js:
--------------------------------------------------------------------------------
1 | import {RECEIVE_LIST, MOVIES_ARR, OPENID, MYWXINFO, MYCOSINFO} from './mutation-type'
2 |
3 | export default {
4 | [RECEIVE_LIST](state, {list_data}){
5 | state.listTmp = list_data;
6 | console.log(state);
7 | },
8 | [MOVIES_ARR](state, data){
9 | state.moviesArr = data;
10 | console.log(state.moviesArr);
11 | },
12 | [OPENID](state, data){
13 | state.openId = data;
14 | console.log("openId获取成功");
15 | },
16 | [MYWXINFO](state, data){
17 | state.myWxInfo = data;
18 | console.log("我的微信信息获取成功");
19 | },
20 | [MYCOSINFO](state, data){
21 | state.myCosInfo = data;
22 | console.log("我的自定义信息获取成功");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/dao/CourseDao.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.dao;
2 |
3 | import com.wanderpoet.experiment.entity.Course;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.Query;
6 |
7 | import java.util.List;
8 | import java.util.Set;
9 |
10 | public interface CourseDao extends JpaRepository{
11 | public Course findByCname(String cname);
12 |
13 | public Course findByCid(Integer cid);
14 |
15 | public void deleteByCname(String cname);
16 | // @Query( "select c from Course c where c.logincid = ?1")
17 | // public List findCourse(String logincid);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/dao/TeacherDao.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.dao;
2 |
3 | import com.wanderpoet.experiment.entity.Teacher;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.Query;
6 |
7 | import java.util.List;
8 | import java.util.Set;
9 |
10 | public interface TeacherDao extends JpaRepository {
11 |
12 | public Teacher findByTname(String tname);
13 |
14 | public Teacher findByTid(Integer tid);
15 |
16 | public Teacher findByLogintid(String logintid);
17 |
18 | @Query( "select t from Teacher t where t.logintid = ?1")
19 | public List findTeacher(String logintid);
20 | }
21 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/dao/StudentDao.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.dao;
2 |
3 | import org.springframework.data.jpa.repository.JpaRepository;
4 |
5 | import com.wanderpoet.experiment.entity.Student;
6 | import org.springframework.data.jpa.repository.Query;
7 |
8 | import java.util.List;
9 | import java.util.Set;
10 |
11 |
12 | public interface StudentDao extends JpaRepository {
13 |
14 | public Student findBySname(String sname);
15 |
16 | public Student findBySid(Integer sid);
17 |
18 | @Query( "select s from Student s where s.loginsid = ?1")
19 | public List findStudent(String loginsid);
20 |
21 | public Student findByLoginsid(String loginsid);
22 | }
23 |
--------------------------------------------------------------------------------
/web/src/main.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue'
4 | import App from './App'
5 | import router from './router'
6 | import ElementUI from 'element-ui';
7 | import 'element-ui/lib/theme-chalk/index.css';
8 | import axios from 'axios'
9 | import qs from 'qs'
10 | // import VueAxios from 'vue-axios'
11 |
12 | Vue.prototype.$axios = axios;
13 | Vue.prototype.$qs = qs;
14 | // Vue.use(VueAxios, axios)
15 | Vue.config.productionTip = false
16 | Vue.use(ElementUI);
17 |
18 | /* eslint-disable no-new */
19 | new Vue({
20 | el: '#app',
21 | router,
22 | components: { App },
23 | template: '',
24 | // render: h => h(App)
25 | })
26 |
--------------------------------------------------------------------------------
/web/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 | import Login from '@/components/Login'
4 | import sindex from '@/components/Student/index'
5 | import tindex from '@/components/Teacher/index'
6 | import aindex from '@/components/Administrator/index'
7 |
8 | Vue.use(Router)
9 |
10 | export default new Router({
11 | routes: [
12 | {
13 | path: '/',
14 | name: 'Login',
15 | component:Login
16 | },
17 | {
18 | path: '/student',
19 | name: 'sindex',
20 | component:sindex,
21 | },
22 | {
23 | path: '/teacher',
24 | name: 'tindex',
25 | component:tindex
26 | },
27 | {
28 | path: '/administrator',
29 | name: 'aindex',
30 | component:aindex
31 | },
32 | {
33 | path: '*',
34 | redirect: '/'
35 | }
36 | ]
37 | })
38 |
--------------------------------------------------------------------------------
/web/static/js/cookie.js:
--------------------------------------------------------------------------------
1 | //设置cookie,增加到vue实例方便全局调用
2 | //vue全局调用的理由是,有些组件所用到的接口可能需要session验证,session从cookie获取
3 | //当然,如果session保存到vuex的话除外
4 | //全局引入vue
5 | var cookie = {
6 | setCookie(c_name, value, expiredays) {
7 | var exdate = new Date();
8 | exdate.setTime(exdate.getTime() + expiredays);
9 | exdate.setDate(exdate.getDate() + expiredays);
10 | document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
11 | },
12 | getCookie(name) {
13 | var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
14 | if (arr = document.cookie.match(reg))
15 | return (arr[2]);
16 | else
17 | return null;
18 | },
19 | delCookie(name) {
20 | var exp = new Date();
21 | exp.setTime(exp.getTime() - 1);
22 | var cval = cookie.getCookie(name);
23 | if (cval != null)
24 | document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
25 | }
26 | }
27 |
28 | export default cookie;
29 |
--------------------------------------------------------------------------------
/web/src/store/state.js:
--------------------------------------------------------------------------------
1 | export default {
2 | listTmp: [],
3 | moviesArr: [],
4 | openId: "",
5 | myWxInfo: {},
6 | myCosInfo: {},
7 | getTime: () => {
8 | let date = new Date(),
9 | year = date.getFullYear(),
10 | month = date.getMonth()+1,
11 | day = date.getDate(),
12 | hour = date.getHours(),
13 | minute = date.getMinutes(),
14 | second = date.getSeconds();
15 | return year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second;
16 | },
17 | getPid: () => {
18 | let mydate = new Date();
19 | return "zb"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds();
20 | },
21 | createComparison: property => {
22 | return function (object1, object2) {
23 | var value1 = object1[property];
24 | var value2 = object2[property];
25 | if (value1 < value2) {
26 | return -1;
27 | } else if (value1 > value2) {
28 | return 1;
29 | } else {
30 | return 0;
31 | }
32 | };
33 | }
34 | }
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/entity/Admin.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.entity;
2 |
3 | import javax.persistence.Entity;
4 | import javax.persistence.GeneratedValue;
5 | import javax.persistence.GenerationType;
6 | import javax.persistence.Id;
7 |
8 | /**
9 | *
10 | */
11 | @Entity
12 | public class Admin {
13 |
14 | @Id
15 | private String aname;
16 |
17 | private String password;
18 |
19 | public Admin() {
20 | }
21 |
22 | public String getAname() {
23 | return aname;
24 | }
25 |
26 | public void setAname(String aname) {
27 | this.aname = aname;
28 | }
29 |
30 | public String getPassword() {
31 | return password;
32 | }
33 |
34 | public void setPassword(String password) {
35 | this.password = password;
36 | }
37 |
38 | @Override
39 | public String toString() {
40 | return "Admin{" +
41 | "aname='" + aname + '\'' +
42 | ", password='" + password + '\'' +
43 | '}';
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/web/static/js/date.js:
--------------------------------------------------------------------------------
1 | export function formatDate(date, fmt) {
2 | //正则匹配/(y+)/ 字符串fmt--'yyyy-MM-dd hh:mm',如果匹配到,就获取第一个匹配的文本,即yyyy,
3 | if (/(y+)/.test(fmt)) {
4 | // console.log(typeof (date.getFullYear()));
5 | fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
6 | //将yyyy替换成年份,如1970
7 | // date.getFullYear()的类型是number,(date.getFullYear() + '') 加个空字符串将number转成字符串类型
8 | // substr() 方法可在字符串中抽取从 start 下标开始的指定数目的字符。
9 | }
10 | let o = {
11 | 'M+': date.getMonth() + 1,
12 | 'd+': date.getDate(),
13 | 'h+': date.getHours(),
14 | 'm+': date.getMinutes(),
15 | 's+': date.getSeconds()
16 | };
17 | for (let k in o) {
18 | if (new RegExp(`(${k})`).test(fmt)) {
19 | let str = o[k] + '';
20 | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
21 | }
22 | }
23 | return fmt;
24 | };
25 |
26 |
27 | function padLeftZero(str) {
28 | return ('00' + str).substr(str.length);
29 | }
--------------------------------------------------------------------------------
/web/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | require('./check-versions')()
3 |
4 | process.env.NODE_ENV = 'production'
5 |
6 | const ora = require('ora')
7 | const rm = require('rimraf')
8 | const path = require('path')
9 | const chalk = require('chalk')
10 | const webpack = require('webpack')
11 | const config = require('../config')
12 | const webpackConfig = require('./webpack.prod.conf')
13 |
14 | const spinner = ora('building for production...')
15 | spinner.start()
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop()
21 | if (err) throw err
22 | process.stdout.write(stats.toString({
23 | colors: true,
24 | modules: false,
25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26 | chunks: false,
27 | chunkModules: false
28 | }) + '\n\n')
29 |
30 | if (stats.hasErrors()) {
31 | console.log(chalk.red(' Build failed with errors.\n'))
32 | process.exit(1)
33 | }
34 |
35 | console.log(chalk.cyan(' Build complete.\n'))
36 | console.log(chalk.yellow(
37 | ' Tip: built files are meant to be served over an HTTP server.\n' +
38 | ' Opening index.html over file:// won\'t work.\n'
39 | ))
40 | })
41 | })
42 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/controller/AdminController.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.controller;
2 |
3 | import com.wanderpoet.experiment.dao.CourseDao;
4 | import com.wanderpoet.experiment.dao.StudentDao;
5 | import com.wanderpoet.experiment.dao.TeacherDao;
6 | import com.wanderpoet.experiment.entity.Course;
7 | import com.wanderpoet.experiment.entity.Teacher;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.*;
10 | import com.wanderpoet.experiment.entity.Student;
11 |
12 | import java.util.List;
13 | import java.util.Set;
14 |
15 | @CrossOrigin
16 | @RestController
17 | @RequestMapping(value = "/admin")
18 | public class AdminController {
19 |
20 |
21 | // @Autowired
22 | // private StudentDao studentDao;
23 | //
24 | // @Autowired
25 | // private CourseDao courseDao;
26 | //
27 | // @Autowired
28 | // private TeacherDao teacherDao;
29 |
30 |
31 | /*
32 | * 对学生进行操作
33 | * */
34 |
35 | // //查询所有学生
36 | // @GetMapping(value = "/student/getAll")
37 | // public List findAllStudent(){
38 | // return studentDao.findAll();
39 | // }
40 | //
41 | // //按名字查询学生
42 | // @GetMapping("/student/get")
43 | // public Student findByName(String sname){
44 | // return studentDao.findBySname(sname);
45 | // }
46 |
47 |
48 |
49 |
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/web/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/service/demo/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.1.6.RELEASE
9 |
10 |
11 | com.example
12 | demo
13 | 0.0.1-SNAPSHOT
14 | demo
15 | Demo project for Spring Boot
16 |
17 |
18 | 11
19 |
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-web
25 |
26 |
27 |
28 | org.springframework.boot
29 | spring-boot-starter-test
30 | test
31 |
32 |
33 |
34 |
35 |
36 |
37 | org.springframework.boot
38 | spring-boot-maven-plugin
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/web/static/js/cloneObject.js:
--------------------------------------------------------------------------------
1 | export const isArray = (arr) => {
2 | return Object.prototype.toString.call(arr) === '[object Array]';
3 | };
4 |
5 |
6 | export const isPlain = (obj) => {
7 | let hasOwnProperty = Object.prototype.hasOwnProperty;
8 | let key;
9 | // 一般的情况,直接用toString判断
10 | // IE下,window/document/document.body/HTMLElement/HTMLCollection/NodeList等DOM对象上一个语句为true
11 | // isPrototypeOf挂在Object.prototype上的,因此所有的字面量都应该会有这个属性
12 | // 对于在window上挂了isPrototypeOf属性的情况,直接忽略不考虑
13 | if (!obj || Object.prototype.toString.call(obj) !== '[object Object]' || !('isPrototypeOf' in obj)) {
14 | return false;
15 | }
16 | // 判断new fun()自定义对象的情况
17 | // constructor不是继承自原型链的
18 | // 并且原型中有isPrototypeOf方法才是Object
19 | if (obj.constructor && !hasOwnProperty.call(obj, 'constructor') && !hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) {
20 | return false;
21 | }
22 | // 判断有继承的情况
23 | // 如果有一项是继承过来的,那么一定不是字面量Object
24 | // OwnProperty会首先被遍历,为了加速遍历过程,直接看最后一项
25 | for (key in obj) {}
26 | return key === undefined || hasOwnProperty.call(obj, key);
27 | };
28 |
29 |
30 |
31 | export const cloneObject = (src) => {
32 | let tar = src;
33 | let i;
34 | let len;
35 | if (!src || src instanceof Number || src instanceof String || src instanceof Boolean) {
36 | return src;
37 | } else if (isArray(src)) {
38 | tar = [];
39 | var tarLen = 0;
40 | for (i = 0, len = src.length; i < len; i++) {
41 | tar[tarLen++] = cloneObject(src[i]);
42 | }
43 | } else if (isPlain(src)) {
44 | tar = {};
45 | for (i in src) {
46 | if (src.hasOwnProperty(i)) {
47 | tar[i] = cloneObject(src[i]);
48 | }
49 | }
50 | }
51 | return tar;
52 | };
53 |
54 |
55 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/entity/Selection.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.entity;
2 |
3 | import javax.persistence.*;
4 |
5 | /**
6 | *
7 | */
8 | @Entity
9 | public class Selection {
10 |
11 | @Id
12 | @GeneratedValue(strategy = GenerationType.IDENTITY)
13 | private Integer id;
14 |
15 | private String score;
16 |
17 | //与学生有多对一关系
18 | @ManyToOne(targetEntity = Student.class)
19 | //@JoinColumn(name = "sid", referencedColumnName = "sid")
20 | private Student student;
21 |
22 | //与课程有多对一关系
23 | @ManyToOne(targetEntity = Course.class)
24 | // @JoinColumn(name = "cid", referencedColumnName = "cid")
25 | private Course course;
26 |
27 | public Selection() {
28 | }
29 |
30 | public Integer getId() {
31 | return id;
32 | }
33 |
34 | public void setId(Integer id) {
35 | this.id = id;
36 | }
37 |
38 | public String getScore() {
39 | return score;
40 | }
41 |
42 | public void setScore(String score) {
43 | this.score = score;
44 | }
45 |
46 | public Student getStudent() {
47 | return student;
48 | }
49 |
50 | public void setStudent(Student student) {
51 | this.student = student;
52 | }
53 |
54 | public Course getCourse() {
55 | return course;
56 | }
57 |
58 | public void setCourse(Course course) {
59 | this.course = course;
60 | }
61 |
62 | @Override
63 | public String toString() {
64 | return "Selection{" +
65 | "id=" + id +
66 | ", score='" + score + '\'' +
67 | ", student=" + student +
68 | ", course=" + course +
69 | '}';
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/entity/Teacher.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.entity;
2 |
3 | import javax.persistence.*;
4 | import java.util.HashSet;
5 | import java.util.Set;
6 |
7 | /**
8 | *教师信息
9 | */
10 | @Entity
11 | public class Teacher {
12 | @Id
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
14 | private Integer tid;
15 |
16 | private String tname;
17 |
18 | private String logintid;
19 |
20 | private String password;
21 |
22 | @OneToMany(mappedBy = "teacher", cascade = CascadeType.ALL)
23 | private Set courses = new HashSet<>();
24 |
25 | public Teacher() {
26 | }
27 |
28 | public Integer getTid() {
29 | return tid;
30 | }
31 |
32 | public void setTid(Integer tid) {
33 | this.tid = tid;
34 | }
35 |
36 | public String getTname() {
37 | return tname;
38 | }
39 |
40 | public void setTname(String tname) {
41 | this.tname = tname;
42 | }
43 |
44 | public String getLogintid() {
45 | return logintid;
46 | }
47 |
48 | public void setLogintid(String logintid) {
49 | this.logintid = logintid;
50 | }
51 |
52 | public String getPassword() {
53 | return password;
54 | }
55 |
56 | public void setPassword(String password) {
57 | this.password = password;
58 | }
59 |
60 | public Set getCourses() {
61 | return courses;
62 | }
63 |
64 | public void setCourses(Set courses) {
65 | this.courses = courses;
66 | }
67 |
68 | @Override
69 | public String toString() {
70 | return "Teacher{" +
71 | "tid=" + tid +
72 | ", tname='" + tname + '\'' +
73 | ", logintid='" + logintid + '\'' +
74 | ", password='" + password + '\'' +
75 | ", courses=" + courses +
76 | '}';
77 | }
78 | }
79 |
80 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/entity/Course.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.entity;
2 |
3 | import javax.persistence.*;
4 | import java.util.HashSet;
5 | import java.util.Set;
6 |
7 | @Entity
8 | public class Course {
9 |
10 | @Id
11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
12 | private Integer cid;
13 |
14 | private String cname;
15 |
16 | private String address;
17 |
18 | //与教师有多对一关系
19 | @ManyToOne(targetEntity = Teacher.class)
20 | @JoinColumn(name = "tid", referencedColumnName = "tid")
21 | private Teacher teacher;
22 |
23 | //与选课表有一对多关系
24 | @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER, mappedBy = "course")
25 | private Set selections = new HashSet<>();
26 |
27 | public Course() {
28 | }
29 |
30 | public Integer getCid() {
31 | return cid;
32 | }
33 |
34 | public void setCid(Integer cid) {
35 | this.cid = cid;
36 | }
37 |
38 | public String getCname() {
39 | return cname;
40 | }
41 |
42 | public void setCname(String cname) {
43 | this.cname = cname;
44 | }
45 |
46 | public String getAddress() {
47 | return address;
48 | }
49 |
50 | public void setAddress(String address) {
51 | this.address = address;
52 | }
53 |
54 | public Teacher getTeacher() {
55 | return teacher;
56 | }
57 |
58 | public void setTeacher(Teacher teacher) {
59 | this.teacher = teacher;
60 | }
61 |
62 | public Set getSelections() {
63 | return selections;
64 | }
65 |
66 | public void setSelections(Set selections) {
67 | this.selections = selections;
68 | }
69 |
70 | @Override
71 | public String toString() {
72 | return "Course{" +
73 | "cid=" + cid +
74 | ", cname='" + cname + '\'' +
75 | ", address='" + address + '\'' +
76 | ", teacher=" + teacher +
77 | ", selections=" + selections +
78 | '}';
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/web/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "course-system",
3 | "version": "1.0.0",
4 | "description": "A Vue.js project",
5 | "author": "LGMO <506986879@qq.com>",
6 | "private": true,
7 | "scripts": {
8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9 | "start": "npm run dev",
10 | "build": "node build/build.js"
11 | },
12 | "dependencies": {
13 | "axios": "^0.19.0",
14 | "element-ui": "^2.9.2",
15 | "qs": "^6.7.0",
16 | "vue": "^2.5.2",
17 | "vue-axios": "^2.1.4",
18 | "vue-router": "^3.0.1"
19 | },
20 | "devDependencies": {
21 | "autoprefixer": "^7.1.2",
22 | "babel-core": "^6.22.1",
23 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
24 | "babel-loader": "^7.1.1",
25 | "babel-plugin-syntax-jsx": "^6.18.0",
26 | "babel-plugin-transform-runtime": "^6.22.0",
27 | "babel-plugin-transform-vue-jsx": "^3.5.0",
28 | "babel-preset-env": "^1.3.2",
29 | "babel-preset-stage-2": "^6.22.0",
30 | "chalk": "^2.0.1",
31 | "copy-webpack-plugin": "^4.0.1",
32 | "css-loader": "^0.28.0",
33 | "extract-text-webpack-plugin": "^3.0.0",
34 | "file-loader": "^1.1.4",
35 | "friendly-errors-webpack-plugin": "^1.6.1",
36 | "html-webpack-plugin": "^2.30.1",
37 | "node-notifier": "^5.1.2",
38 | "optimize-css-assets-webpack-plugin": "^3.2.0",
39 | "ora": "^1.2.0",
40 | "portfinder": "^1.0.13",
41 | "postcss-import": "^11.0.0",
42 | "postcss-loader": "^2.0.8",
43 | "postcss-url": "^7.2.1",
44 | "rimraf": "^2.6.0",
45 | "semver": "^5.3.0",
46 | "shelljs": "^0.7.6",
47 | "uglifyjs-webpack-plugin": "^1.1.1",
48 | "url-loader": "^0.5.8",
49 | "vue-loader": "^13.3.0",
50 | "vue-style-loader": "^3.0.1",
51 | "vue-template-compiler": "^2.5.2",
52 | "webpack": "^3.6.0",
53 | "webpack-bundle-analyzer": "^2.9.0",
54 | "webpack-dev-server": "^2.9.1",
55 | "webpack-merge": "^4.1.0"
56 | },
57 | "engines": {
58 | "node": ">= 6.0.0",
59 | "npm": ">= 3.0.0"
60 | },
61 | "browserslist": [
62 | "> 1%",
63 | "last 2 versions",
64 | "not ie <= 8"
65 | ]
66 | }
67 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/controller/TeacherController.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.controller;
2 |
3 | import com.wanderpoet.experiment.dao.TeacherDao;
4 | import com.wanderpoet.experiment.entity.Teacher;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.*;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | *
13 | */
14 | @CrossOrigin
15 | @RestController
16 | @RequestMapping(value = "/teacher")
17 | public class TeacherController {
18 |
19 | /*
20 | * 对教师进行操作
21 | * */
22 |
23 | @Autowired
24 | private TeacherDao teacherDao;
25 |
26 | //添加教师
27 | @PostMapping(value = "/add")
28 | public Teacher teacherAdd(Teacher teacher){
29 | return teacherDao.save(teacher);
30 | }
31 |
32 | //修改教师
33 | @PutMapping(value = "/update")
34 | public Teacher teacherUpdate(Teacher teacher){
35 | if(teacherDao.findById(teacher.getTid()) == null){
36 | return teacherDao.save(teacher);
37 | }
38 | else{
39 | Teacher teacherBase = teacherDao.findByTid(teacher.getTid());
40 | if(teacher.getTname() != null)
41 | teacherBase.setTname(teacher.getTname());
42 | if(teacher.getLogintid() != null)
43 | teacherBase.setLogintid(teacher.getLogintid());
44 | if(teacher.getPassword() != null)
45 | teacherBase.setPassword(teacher.getPassword());
46 | return teacherDao.save(teacherBase);
47 | }
48 | }
49 |
50 | //删除教师
51 | @DeleteMapping(value = "/delete/{logintid}")
52 | public void teacherDelete(@PathVariable("logintid") String logintid){
53 | teacherDao.deleteById(teacherDao.findByLogintid(logintid).getTid()
54 | );
55 | }
56 |
57 | //查询所有教师
58 | @GetMapping(value = "getall")
59 | public List getAll(){
60 | return teacherDao.findAll();
61 | }
62 |
63 | //查询一位教师
64 | @GetMapping(value = "/getone")
65 | public Teacher getOne(@RequestParam("tid") Integer tid){
66 | return teacherDao.findByTid(tid);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/web/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | // Template version: 1.3.1
3 | // see http://vuejs-templates.github.io/webpack for documentation.
4 |
5 | const path = require('path')
6 |
7 | module.exports = {
8 | dev: {
9 |
10 | // Paths
11 | assetsSubDirectory: 'static',
12 | assetsPublicPath: '/',
13 | proxyTable: {},
14 |
15 | // Various Dev Server settings
16 | host: 'localhost', // can be overwritten by process.env.HOST
17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18 | autoOpenBrowser: true,
19 | errorOverlay: true,
20 | notifyOnErrors: true,
21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
22 |
23 |
24 | /**
25 | * Source Maps
26 | */
27 |
28 | // https://webpack.js.org/configuration/devtool/#development
29 | devtool: 'cheap-module-eval-source-map',
30 |
31 | // If you have problems debugging vue-files in devtools,
32 | // set this to false - it *may* help
33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting
34 | cacheBusting: true,
35 |
36 | cssSourceMap: true
37 | },
38 |
39 | build: {
40 | // Template for index.html
41 | index: path.resolve(__dirname, '../dist/index.html'),
42 |
43 | // Paths
44 | assetsRoot: path.resolve(__dirname, '../dist'),
45 | assetsSubDirectory: 'static',
46 | assetsPublicPath: '/',
47 |
48 | /**
49 | * Source Maps
50 | */
51 |
52 | productionSourceMap: true,
53 | // https://webpack.js.org/configuration/devtool/#production
54 | devtool: '#source-map',
55 |
56 | // Gzip off by default as many popular static hosts such as
57 | // Surge or Netlify already gzip all static assets for you.
58 | // Before setting to `true`, make sure to:
59 | // npm install --save-dev compression-webpack-plugin
60 | productionGzip: false,
61 | productionGzipExtensions: ['js', 'css'],
62 |
63 | // Run the build command with an extra argument to
64 | // View the bundle analyzer report after build finishes:
65 | // `npm run build --report`
66 | // Set to `true` or `false` to always turn it on or off
67 | bundleAnalyzerReport: process.env.npm_config_report
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/entity/Student.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.entity;
2 |
3 |
4 | import com.wanderpoet.experiment.entity.Course;
5 |
6 | import javax.persistence.*;
7 | import java.util.HashSet;
8 | import java.util.Set;
9 |
10 | @Entity
11 | public class Student {
12 |
13 | @Id
14 | @GeneratedValue(strategy = GenerationType.IDENTITY)
15 | private Integer sid;
16 |
17 | private String sname;
18 |
19 | private String gender;
20 |
21 | private String loginsid;
22 |
23 | private String password;
24 |
25 | //与选课表具有一对多关系
26 | @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER, mappedBy = "student" )
27 | private Set selections = new HashSet<>();
28 |
29 | public Student() {
30 | }
31 |
32 | public Integer getSid() {
33 | return sid;
34 | }
35 |
36 | public void setSid(Integer sid) {
37 | this.sid = sid;
38 | }
39 |
40 | public String getSname() {
41 | return sname;
42 | }
43 |
44 | public void setSname(String sname) {
45 | this.sname = sname;
46 | }
47 |
48 | public String getGender() {
49 | return gender;
50 | }
51 |
52 | public void setGender(String gender) {
53 | this.gender = gender;
54 | }
55 |
56 | public String getLoginsid() {
57 | return loginsid;
58 | }
59 |
60 | public void setLoginsid(String loginsid) {
61 | this.loginsid = loginsid;
62 | }
63 |
64 | public String getPassword() {
65 | return password;
66 | }
67 |
68 | public void setPassword(String password) {
69 | this.password = password;
70 | }
71 |
72 | public Set getSelections() {
73 | return selections;
74 | }
75 |
76 | public void setSelections(Set selections) {
77 | this.selections = selections;
78 | }
79 |
80 | @Override
81 | public String toString() {
82 | return "Student{" +
83 | "sid=" + sid +
84 | ", sname='" + sname + '\'' +
85 | ", gender='" + gender + '\'' +
86 | ", loginsid='" + loginsid + '\'' +
87 | ", password='" + password + '\'' +
88 | ", selections=" + selections +
89 | '}';
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/web/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const config = require('../config')
5 | const vueLoaderConfig = require('./vue-loader.conf')
6 |
7 | function resolve (dir) {
8 | return path.join(__dirname, '..', dir)
9 | }
10 |
11 |
12 |
13 | module.exports = {
14 | context: path.resolve(__dirname, '../'),
15 | entry: {
16 | app: './src/main.js'
17 | },
18 | output: {
19 | path: config.build.assetsRoot,
20 | filename: '[name].js',
21 | publicPath: process.env.NODE_ENV === 'production'
22 | ? config.build.assetsPublicPath
23 | : config.dev.assetsPublicPath
24 | },
25 | resolve: {
26 | extensions: ['.js', '.vue', '.json'],
27 | alias: {
28 | 'vue$': 'vue/dist/vue.esm.js',
29 | '@': resolve('src'),
30 | }
31 | },
32 | module: {
33 | rules: [
34 | {
35 | test: /\.vue$/,
36 | loader: 'vue-loader',
37 | options: vueLoaderConfig
38 | },
39 | {
40 | test: /\.js$/,
41 | loader: 'babel-loader',
42 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
43 | },
44 | {
45 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
46 | loader: 'url-loader',
47 | options: {
48 | limit: 10000,
49 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
50 | }
51 | },
52 | {
53 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
54 | loader: 'url-loader',
55 | options: {
56 | limit: 10000,
57 | name: utils.assetsPath('media/[name].[hash:7].[ext]')
58 | }
59 | },
60 | {
61 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
62 | loader: 'url-loader',
63 | options: {
64 | limit: 10000,
65 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66 | }
67 | }
68 | ]
69 | },
70 | node: {
71 | // prevent webpack from injecting useless setImmediate polyfill because Vue
72 | // source contains it (although only uses it if it's native).
73 | setImmediate: false,
74 | // prevent webpack from injecting mocks to Node native modules
75 | // that does not make sense for the client
76 | dgram: 'empty',
77 | fs: 'empty',
78 | net: 'empty',
79 | tls: 'empty',
80 | child_process: 'empty'
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/controller/StudentController.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.controller;
2 |
3 | import com.wanderpoet.experiment.dao.StudentDao;
4 | import com.wanderpoet.experiment.entity.Student;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.web.bind.annotation.*;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | *
12 | */
13 | @CrossOrigin
14 | @RestController
15 | @RequestMapping(value = "/student")
16 | public class StudentController {
17 |
18 | @Autowired
19 | private StudentDao studentDao;
20 |
21 | // 添加学生
22 | @PostMapping(value = "/add")
23 | public Object studentAdd(Student student) {
24 | List list = studentDao.findStudent(student.getLoginsid());
25 |
26 |
27 | if(list.size() < 1){
28 | return studentDao.save(student);
29 | }
30 | // student.setSname(student.getSname());
31 | // student.setGender(student.getGender());
32 | else {
33 | return "123";
34 | }
35 | }
36 |
37 | //修改学生
38 | @PutMapping(value = "/update")
39 | public Object studentUpdate(Student student){
40 | List list = studentDao.findStudent(student.getLoginsid());
41 |
42 | if(list.size() < 1){
43 | return "1";
44 | }
45 | else{
46 | Student studentBase = studentDao.findByLoginsid(student.getLoginsid());
47 |
48 | studentBase.setSname(student.getSname());
49 |
50 | studentBase.setGender(student.getGender());
51 |
52 | studentBase.setLoginsid(student.getLoginsid());
53 |
54 | studentBase.setPassword(student.getPassword());
55 |
56 | return studentDao.save(studentBase);
57 | }
58 | }
59 |
60 | //删除学生
61 | @DeleteMapping(value = "/delete/{loginsid}")
62 | public Object studentDelete(@PathVariable("loginsid") String loginsid){
63 | List list = studentDao.findStudent(loginsid);
64 |
65 | if(list.size() < 1){
66 | return "1";
67 | }
68 | studentDao.deleteById(studentDao.findByLoginsid(loginsid).getSid());
69 | return "0";
70 | }
71 |
72 | //查询所有学生
73 | @GetMapping(value = "/getAll")
74 | public List findAllStudent(){
75 | return studentDao.findAll();
76 | }
77 |
78 | //按名字查询学生
79 | @GetMapping("/get")
80 | public Student findByName(String sname){
81 | return studentDao.findBySname(sname);
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/service/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.1.5.RELEASE
9 |
10 |
11 | com.wanderpoet
12 | experiment
13 | 0.0.1-SNAPSHOT
14 | experiment
15 | Demo project for Spring Boot
16 |
17 |
18 | 11
19 |
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-web
25 |
26 |
27 |
28 | org.springframework.boot
29 | spring-boot-starter-test
30 | test
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-data-jpa
36 |
37 |
38 |
39 | com.microsoft.sqlserver
40 | sqljdbc4
41 |
42 |
43 |
44 | com.microsoft.sqlserver
45 | mssql-jdbc
46 | compile
47 |
48 |
49 |
50 | javax.xml.bind
51 | jaxb-api
52 | 2.3.0
53 |
54 |
55 |
56 | org.springframework.boot
57 | spring-boot-devtools
58 | true
59 |
60 |
61 |
62 | org.json
63 | json
64 | 20160810
65 |
66 |
67 |
68 |
69 |
70 |
71 | org.springframework.boot
72 | spring-boot-maven-plugin
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/controller/LoginController.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.controller;
2 |
3 | import com.wanderpoet.experiment.dao.AdminDao;
4 | import com.wanderpoet.experiment.dao.StudentDao;
5 | import com.wanderpoet.experiment.dao.TeacherDao;
6 | import com.wanderpoet.experiment.entity.Admin;
7 | import com.wanderpoet.experiment.entity.Student;
8 | import com.wanderpoet.experiment.entity.Teacher;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.web.bind.annotation.*;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | *
16 | */
17 | @CrossOrigin
18 | @RestController
19 | @RequestMapping(value = "/login")
20 | public class LoginController {
21 |
22 | @Autowired
23 | private StudentDao studentDao;
24 |
25 | @Autowired
26 | private AdminDao adminDao;
27 |
28 | @Autowired
29 | private TeacherDao teacherDao;
30 |
31 | //管理员登录
32 | @PostMapping("/adminLogin")
33 | public String adminLogin(Admin admin){
34 | Admin adminbase = adminDao.findByAname(admin.getAname());
35 | if(adminDao.findByAname(admin.getAname()) == null){
36 | return "1";
37 | }
38 | else if((admin.getPassword().equals(adminDao.findByAname(admin.getAname()).getPassword()))){
39 | return "2";
40 | }
41 | else{
42 | return "3";
43 | }
44 |
45 | }
46 |
47 | //教师登录
48 | @PostMapping(value = "/teacherLogin")
49 | public String teacherLogin(Teacher teacher){
50 | List list = teacherDao.findTeacher(teacher.getLogintid());
51 |
52 | if(list.size() < 1){
53 | return "1";
54 | }else if(teacher.getPassword().equals(teacherDao.findByLogintid(teacher.getLogintid()).getPassword())){
55 | return "2";
56 | }
57 | else {
58 | return "3";
59 | }
60 | }
61 |
62 | //学生登录
63 | @PostMapping(value = "/studentLogin")
64 | public String studentLogin(Student student) {
65 |
66 | // JSONObject jsonObject = new JSONObject();
67 | List list = studentDao.findStudent(student.getLoginsid());
68 |
69 |
70 | if(list.size() < 1){
71 | // if (studentDao.findByLoginsid(student.getLoginsid()) != null) {
72 | // jsonObject.put("message", "登陆失败,用户名不存在");
73 | // return jsonObject;
74 | return "1";
75 | } else {
76 | if (student.getPassword().equals(studentDao.findByLoginsid(student.getLoginsid()).getPassword())) {
77 | // jsonObject.put("message", "登陆成功");
78 | // return jsonObject;
79 | return "2";
80 | }
81 | else{
82 | // jsonObject.put("message", "登陆失败,密码错误";
83 | // return jsonObject;
84 | return "3";
85 | }
86 | }
87 |
88 | }
89 |
90 | }
91 |
--------------------------------------------------------------------------------
/web/build/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const config = require('../config')
4 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
5 | const packageConfig = require('../package.json')
6 |
7 | exports.assetsPath = function (_path) {
8 | const assetsSubDirectory = process.env.NODE_ENV === 'production'
9 | ? config.build.assetsSubDirectory
10 | : config.dev.assetsSubDirectory
11 |
12 | return path.posix.join(assetsSubDirectory, _path)
13 | }
14 |
15 | exports.cssLoaders = function (options) {
16 | options = options || {}
17 |
18 | const cssLoader = {
19 | loader: 'css-loader',
20 | options: {
21 | sourceMap: options.sourceMap
22 | }
23 | }
24 |
25 | const postcssLoader = {
26 | loader: 'postcss-loader',
27 | options: {
28 | sourceMap: options.sourceMap
29 | }
30 | }
31 |
32 | // generate loader string to be used with extract text plugin
33 | function generateLoaders (loader, loaderOptions) {
34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
35 |
36 | if (loader) {
37 | loaders.push({
38 | loader: loader + '-loader',
39 | options: Object.assign({}, loaderOptions, {
40 | sourceMap: options.sourceMap
41 | })
42 | })
43 | }
44 |
45 | // Extract CSS when that option is specified
46 | // (which is the case during production build)
47 | if (options.extract) {
48 | return ExtractTextPlugin.extract({
49 | use: loaders,
50 | fallback: 'vue-style-loader'
51 | })
52 | } else {
53 | return ['vue-style-loader'].concat(loaders)
54 | }
55 | }
56 |
57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
58 | return {
59 | css: generateLoaders(),
60 | postcss: generateLoaders(),
61 | less: generateLoaders('less'),
62 | sass: generateLoaders('sass', { indentedSyntax: true }),
63 | scss: generateLoaders('sass'),
64 | stylus: generateLoaders('stylus'),
65 | styl: generateLoaders('stylus')
66 | }
67 | }
68 |
69 | // Generate loaders for standalone style files (outside of .vue)
70 | exports.styleLoaders = function (options) {
71 | const output = []
72 | const loaders = exports.cssLoaders(options)
73 |
74 | for (const extension in loaders) {
75 | const loader = loaders[extension]
76 | output.push({
77 | test: new RegExp('\\.' + extension + '$'),
78 | use: loader
79 | })
80 | }
81 |
82 | return output
83 | }
84 |
85 | exports.createNotifierCallback = () => {
86 | const notifier = require('node-notifier')
87 |
88 | return (severity, errors) => {
89 | if (severity !== 'error') return
90 |
91 | const error = errors[0]
92 | const filename = error.file && error.file.split('!').pop()
93 |
94 | notifier.notify({
95 | title: packageConfig.name,
96 | message: severity + ': ' + error.name,
97 | subtitle: filename || '',
98 | icon: path.join(__dirname, 'logo.png')
99 | })
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/web/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const webpack = require('webpack')
4 | const config = require('../config')
5 | const merge = require('webpack-merge')
6 | const path = require('path')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11 | const portfinder = require('portfinder')
12 |
13 | const HOST = process.env.HOST
14 | const PORT = process.env.PORT && Number(process.env.PORT)
15 |
16 | const devWebpackConfig = merge(baseWebpackConfig, {
17 | module: {
18 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
19 | },
20 | // cheap-module-eval-source-map is faster for development
21 | devtool: config.dev.devtool,
22 |
23 | // these devServer options should be customized in /config/index.js
24 | devServer: {
25 | clientLogLevel: 'warning',
26 | historyApiFallback: {
27 | rewrites: [
28 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
29 | ],
30 | },
31 | hot: true,
32 | contentBase: false, // since we use CopyWebpackPlugin.
33 | compress: true,
34 | host: HOST || config.dev.host,
35 | port: PORT || config.dev.port,
36 | open: config.dev.autoOpenBrowser,
37 | overlay: config.dev.errorOverlay
38 | ? { warnings: false, errors: true }
39 | : false,
40 | publicPath: config.dev.assetsPublicPath,
41 | proxy: config.dev.proxyTable,
42 | quiet: true, // necessary for FriendlyErrorsPlugin
43 | watchOptions: {
44 | poll: config.dev.poll,
45 | }
46 | },
47 | plugins: [
48 | new webpack.DefinePlugin({
49 | 'process.env': require('../config/dev.env')
50 | }),
51 | new webpack.HotModuleReplacementPlugin(),
52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
53 | new webpack.NoEmitOnErrorsPlugin(),
54 | // https://github.com/ampedandwired/html-webpack-plugin
55 | new HtmlWebpackPlugin({
56 | filename: 'index.html',
57 | template: 'index.html',
58 | inject: true
59 | }),
60 | // copy custom static assets
61 | new CopyWebpackPlugin([
62 | {
63 | from: path.resolve(__dirname, '../static'),
64 | to: config.dev.assetsSubDirectory,
65 | ignore: ['.*']
66 | }
67 | ])
68 | ]
69 | })
70 |
71 | module.exports = new Promise((resolve, reject) => {
72 | portfinder.basePort = process.env.PORT || config.dev.port
73 | portfinder.getPort((err, port) => {
74 | if (err) {
75 | reject(err)
76 | } else {
77 | // publish the new Port, necessary for e2e tests
78 | process.env.PORT = port
79 | // add port to devServer config
80 | devWebpackConfig.devServer.port = port
81 |
82 | // Add FriendlyErrorsPlugin
83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
84 | compilationSuccessInfo: {
85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
86 | },
87 | onErrors: config.dev.notifyOnErrors
88 | ? utils.createNotifierCallback()
89 | : undefined
90 | }))
91 |
92 | resolve(devWebpackConfig)
93 | }
94 | })
95 | })
96 |
--------------------------------------------------------------------------------
/service/src/main/java/com/wanderpoet/experiment/controller/CourseController.java:
--------------------------------------------------------------------------------
1 | package com.wanderpoet.experiment.controller;
2 |
3 | import com.wanderpoet.experiment.dao.CourseDao;
4 | import com.wanderpoet.experiment.dao.SelectionDao;
5 | import com.wanderpoet.experiment.dao.StudentDao;
6 | import com.wanderpoet.experiment.entity.Course;
7 | import com.wanderpoet.experiment.entity.Selection;
8 | import com.wanderpoet.experiment.entity.Teacher;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.web.bind.annotation.*;
11 |
12 | import java.util.List;
13 |
14 | @CrossOrigin
15 | @RestController
16 | @RequestMapping(value = "/course")
17 | public class CourseController {
18 |
19 | @Autowired
20 | private SelectionDao selectionDao;
21 |
22 | @Autowired
23 | private CourseDao courseDao;
24 |
25 | @Autowired
26 | private StudentDao studentDao;
27 |
28 | //学生选课
29 | @PostMapping(value = "/student/add/")
30 | public Selection selectCourse(@RequestParam("cname") String cname,@RequestParam("loginsid") String loginsid){
31 |
32 | //courseDao.findByCname(cname).getCid();
33 | // studentDao.findByLoginsid(loginsid).getSid();
34 | Selection selection = new Selection();
35 | selection.setCourse(courseDao.findByCname(cname));
36 | selection.setStudent(studentDao.findByLoginsid(loginsid));
37 |
38 | return selectionDao.save(selection);
39 | }
40 |
41 | //学生退课
42 | @DeleteMapping(value = "/student/delete")
43 | public void dropCourse(Selection selection){
44 | selectionDao.delete(selection);
45 | }
46 |
47 | //老师选课
48 | @PostMapping(value = "/teacher/add")
49 | public void selectCourse(Teacher teacher, Course course){
50 |
51 | course.setTeacher(teacher);
52 | }
53 |
54 | //老师退课
55 | @DeleteMapping(value = "/teacher/delete")
56 | public void dropCourse(Course course){
57 | courseDao.delete(course);
58 | }
59 |
60 | //评分
61 | @PutMapping(value = "grade")
62 | public Selection grade(Selection selection){
63 |
64 | Selection selectionBase = selectionDao.findByid(selection.getId());
65 | selectionBase.setScore(selection.getScore());
66 | return selectionDao.save(selectionBase);
67 |
68 | }
69 |
70 |
71 | /*
72 | * 对课程进行操作
73 | * */
74 |
75 | //添加课程
76 | @PostMapping(value = "/add")
77 | public Course cuurseAdd(Course course){
78 |
79 | return courseDao.save(course);
80 | }
81 |
82 | //修改课程
83 | @PutMapping(value = "/update")
84 | public Course courseUpdate(Course course){
85 | if(courseDao.findById(course.getCid()) == null){
86 | return courseDao.save(course);
87 | }
88 | else{
89 | Course courseBase = courseDao.findByCid(course.getCid());
90 | if(course.getCname() != null)
91 | courseBase.setCname(course.getCname());
92 | if(course.getAddress() != null)
93 | courseBase.setAddress(course.getAddress());
94 | return courseDao.save(courseBase);
95 | }
96 | }
97 |
98 | //删除课程
99 | @DeleteMapping(value = "/delete/{cname}")
100 | public String courseDelete(@PathVariable("cname") String cname){
101 |
102 | courseDao.deleteById(courseDao.findByCname(cname).getCid());
103 |
104 | return "1";
105 | }
106 |
107 | //查询一门课程
108 | @GetMapping(value = "getone")
109 | public Course findOne(@RequestParam("cid") Integer cid){
110 | return courseDao.findByCid(cid);
111 | }
112 |
113 | //查询所有课程
114 | @GetMapping(value = "getall")
115 | public List getAll(){
116 | return courseDao.findAll();
117 | }
118 |
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/service/.mvn/wrapper/MavenWrapperDownloader.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | https://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | import java.io.File;
21 | import java.io.FileInputStream;
22 | import java.io.FileOutputStream;
23 | import java.io.IOException;
24 | import java.net.URL;
25 | import java.nio.channels.Channels;
26 | import java.nio.channels.ReadableByteChannel;
27 | import java.util.Properties;
28 |
29 | public class MavenWrapperDownloader {
30 |
31 | /**
32 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
33 | */
34 | private static final String DEFAULT_DOWNLOAD_URL =
35 | "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
36 |
37 | /**
38 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
39 | * use instead of the default one.
40 | */
41 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
42 | ".mvn/wrapper/maven-wrapper.properties";
43 |
44 | /**
45 | * Path where the maven-wrapper.jar will be saved to.
46 | */
47 | private static final String MAVEN_WRAPPER_JAR_PATH =
48 | ".mvn/wrapper/maven-wrapper.jar";
49 |
50 | /**
51 | * Name of the property which should be used to override the default download url for the wrapper.
52 | */
53 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
54 |
55 | public static void main(String args[]) {
56 | System.out.println("- Downloader started");
57 | File baseDirectory = new File(args[0]);
58 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
59 |
60 | // If the maven-wrapper.properties exists, read it and check if it contains a custom
61 | // wrapperUrl parameter.
62 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
63 | String url = DEFAULT_DOWNLOAD_URL;
64 | if (mavenWrapperPropertyFile.exists()) {
65 | FileInputStream mavenWrapperPropertyFileInputStream = null;
66 | try {
67 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
68 | Properties mavenWrapperProperties = new Properties();
69 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
70 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
71 | } catch (IOException e) {
72 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
73 | } finally {
74 | try {
75 | if (mavenWrapperPropertyFileInputStream != null) {
76 | mavenWrapperPropertyFileInputStream.close();
77 | }
78 | } catch (IOException e) {
79 | // Ignore ...
80 | }
81 | }
82 | }
83 | System.out.println("- Downloading from: : " + url);
84 |
85 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
86 | if (!outputFile.getParentFile().exists()) {
87 | if (!outputFile.getParentFile().mkdirs()) {
88 | System.out.println(
89 | "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
90 | }
91 | }
92 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
93 | try {
94 | downloadFileFromURL(url, outputFile);
95 | System.out.println("Done");
96 | System.exit(0);
97 | } catch (Throwable e) {
98 | System.out.println("- Error downloading");
99 | e.printStackTrace();
100 | System.exit(1);
101 | }
102 | }
103 |
104 | private static void downloadFileFromURL(String urlString, File destination) throws Exception {
105 | URL website = new URL(urlString);
106 | ReadableByteChannel rbc;
107 | rbc = Channels.newChannel(website.openStream());
108 | FileOutputStream fos = new FileOutputStream(destination);
109 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
110 | fos.close();
111 | rbc.close();
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/service/demo/.mvn/wrapper/MavenWrapperDownloader.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | https://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | import java.io.File;
21 | import java.io.FileInputStream;
22 | import java.io.FileOutputStream;
23 | import java.io.IOException;
24 | import java.net.URL;
25 | import java.nio.channels.Channels;
26 | import java.nio.channels.ReadableByteChannel;
27 | import java.util.Properties;
28 |
29 | public class MavenWrapperDownloader {
30 |
31 | /**
32 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
33 | */
34 | private static final String DEFAULT_DOWNLOAD_URL =
35 | "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
36 |
37 | /**
38 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
39 | * use instead of the default one.
40 | */
41 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
42 | ".mvn/wrapper/maven-wrapper.properties";
43 |
44 | /**
45 | * Path where the maven-wrapper.jar will be saved to.
46 | */
47 | private static final String MAVEN_WRAPPER_JAR_PATH =
48 | ".mvn/wrapper/maven-wrapper.jar";
49 |
50 | /**
51 | * Name of the property which should be used to override the default download url for the wrapper.
52 | */
53 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
54 |
55 | public static void main(String args[]) {
56 | System.out.println("- Downloader started");
57 | File baseDirectory = new File(args[0]);
58 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
59 |
60 | // If the maven-wrapper.properties exists, read it and check if it contains a custom
61 | // wrapperUrl parameter.
62 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
63 | String url = DEFAULT_DOWNLOAD_URL;
64 | if (mavenWrapperPropertyFile.exists()) {
65 | FileInputStream mavenWrapperPropertyFileInputStream = null;
66 | try {
67 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
68 | Properties mavenWrapperProperties = new Properties();
69 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
70 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
71 | } catch (IOException e) {
72 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
73 | } finally {
74 | try {
75 | if (mavenWrapperPropertyFileInputStream != null) {
76 | mavenWrapperPropertyFileInputStream.close();
77 | }
78 | } catch (IOException e) {
79 | // Ignore ...
80 | }
81 | }
82 | }
83 | System.out.println("- Downloading from: : " + url);
84 |
85 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
86 | if (!outputFile.getParentFile().exists()) {
87 | if (!outputFile.getParentFile().mkdirs()) {
88 | System.out.println(
89 | "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
90 | }
91 | }
92 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
93 | try {
94 | downloadFileFromURL(url, outputFile);
95 | System.out.println("Done");
96 | System.exit(0);
97 | } catch (Throwable e) {
98 | System.out.println("- Error downloading");
99 | e.printStackTrace();
100 | System.exit(1);
101 | }
102 | }
103 |
104 | private static void downloadFileFromURL(String urlString, File destination) throws Exception {
105 | URL website = new URL(urlString);
106 | ReadableByteChannel rbc;
107 | rbc = Channels.newChannel(website.openStream());
108 | FileOutputStream fos = new FileOutputStream(destination);
109 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
110 | fos.close();
111 | rbc.close();
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/web/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const webpack = require('webpack')
5 | const config = require('../config')
6 | const merge = require('webpack-merge')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13 |
14 | const env = require('../config/prod.env')
15 |
16 | const webpackConfig = merge(baseWebpackConfig, {
17 | module: {
18 | rules: utils.styleLoaders({
19 | sourceMap: config.build.productionSourceMap,
20 | extract: true,
21 | usePostCSS: true
22 | })
23 | },
24 | devtool: config.build.productionSourceMap ? config.build.devtool : false,
25 | output: {
26 | path: config.build.assetsRoot,
27 | filename: utils.assetsPath('js/[name].[chunkhash].js'),
28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
29 | },
30 | plugins: [
31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
32 | new webpack.DefinePlugin({
33 | 'process.env': env
34 | }),
35 | new UglifyJsPlugin({
36 | uglifyOptions: {
37 | compress: {
38 | warnings: false
39 | }
40 | },
41 | sourceMap: config.build.productionSourceMap,
42 | parallel: true
43 | }),
44 | // extract css into its own file
45 | new ExtractTextPlugin({
46 | filename: utils.assetsPath('css/[name].[contenthash].css'),
47 | // Setting the following option to `false` will not extract CSS from codesplit chunks.
48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
51 | allChunks: true,
52 | }),
53 | // Compress extracted CSS. We are using this plugin so that possible
54 | // duplicated CSS from different components can be deduped.
55 | new OptimizeCSSPlugin({
56 | cssProcessorOptions: config.build.productionSourceMap
57 | ? { safe: true, map: { inline: false } }
58 | : { safe: true }
59 | }),
60 | // generate dist index.html with correct asset hash for caching.
61 | // you can customize output by editing /index.html
62 | // see https://github.com/ampedandwired/html-webpack-plugin
63 | new HtmlWebpackPlugin({
64 | filename: config.build.index,
65 | template: 'index.html',
66 | inject: true,
67 | minify: {
68 | removeComments: true,
69 | collapseWhitespace: true,
70 | removeAttributeQuotes: true
71 | // more options:
72 | // https://github.com/kangax/html-minifier#options-quick-reference
73 | },
74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin
75 | chunksSortMode: 'dependency'
76 | }),
77 | // keep module.id stable when vendor modules does not change
78 | new webpack.HashedModuleIdsPlugin(),
79 | // enable scope hoisting
80 | new webpack.optimize.ModuleConcatenationPlugin(),
81 | // split vendor js into its own file
82 | new webpack.optimize.CommonsChunkPlugin({
83 | name: 'vendor',
84 | minChunks (module) {
85 | // any required modules inside node_modules are extracted to vendor
86 | return (
87 | module.resource &&
88 | /\.js$/.test(module.resource) &&
89 | module.resource.indexOf(
90 | path.join(__dirname, '../node_modules')
91 | ) === 0
92 | )
93 | }
94 | }),
95 | // extract webpack runtime and module manifest to its own file in order to
96 | // prevent vendor hash from being updated whenever app bundle is updated
97 | new webpack.optimize.CommonsChunkPlugin({
98 | name: 'manifest',
99 | minChunks: Infinity
100 | }),
101 | // This instance extracts shared chunks from code splitted chunks and bundles them
102 | // in a separate chunk, similar to the vendor chunk
103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
104 | new webpack.optimize.CommonsChunkPlugin({
105 | name: 'app',
106 | async: 'vendor-async',
107 | children: true,
108 | minChunks: 3
109 | }),
110 |
111 | // copy custom static assets
112 | new CopyWebpackPlugin([
113 | {
114 | from: path.resolve(__dirname, '../static'),
115 | to: config.build.assetsSubDirectory,
116 | ignore: ['.*']
117 | }
118 | ])
119 | ]
120 | })
121 |
122 | if (config.build.productionGzip) {
123 | const CompressionWebpackPlugin = require('compression-webpack-plugin')
124 |
125 | webpackConfig.plugins.push(
126 | new CompressionWebpackPlugin({
127 | asset: '[path].gz[query]',
128 | algorithm: 'gzip',
129 | test: new RegExp(
130 | '\\.(' +
131 | config.build.productionGzipExtensions.join('|') +
132 | ')$'
133 | ),
134 | threshold: 10240,
135 | minRatio: 0.8
136 | })
137 | )
138 | }
139 |
140 | if (config.build.bundleAnalyzerReport) {
141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
143 | }
144 |
145 | module.exports = webpackConfig
146 |
--------------------------------------------------------------------------------
/service/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven2 Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
124 | FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
125 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
126 | )
127 |
128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130 | if exist %WRAPPER_JAR% (
131 | echo Found %WRAPPER_JAR%
132 | ) else (
133 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
134 | echo Downloading from: %DOWNLOAD_URL%
135 | powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
136 | echo Finished downloading %WRAPPER_JAR%
137 | )
138 | @REM End of extension
139 |
140 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
141 | if ERRORLEVEL 1 goto error
142 | goto end
143 |
144 | :error
145 | set ERROR_CODE=1
146 |
147 | :end
148 | @endlocal & set ERROR_CODE=%ERROR_CODE%
149 |
150 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
151 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
152 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
153 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
154 | :skipRcPost
155 |
156 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
157 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
158 |
159 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
160 |
161 | exit /B %ERROR_CODE%
162 |
--------------------------------------------------------------------------------
/service/demo/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven2 Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
124 | FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
125 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
126 | )
127 |
128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130 | if exist %WRAPPER_JAR% (
131 | echo Found %WRAPPER_JAR%
132 | ) else (
133 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
134 | echo Downloading from: %DOWNLOAD_URL%
135 | powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
136 | echo Finished downloading %WRAPPER_JAR%
137 | )
138 | @REM End of extension
139 |
140 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
141 | if ERRORLEVEL 1 goto error
142 | goto end
143 |
144 | :error
145 | set ERROR_CODE=1
146 |
147 | :end
148 | @endlocal & set ERROR_CODE=%ERROR_CODE%
149 |
150 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
151 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
152 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
153 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
154 | :skipRcPost
155 |
156 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
157 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
158 |
159 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
160 |
161 | exit /B %ERROR_CODE%
162 |
--------------------------------------------------------------------------------
/web/src/components/Login.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 学生课程管理系统
7 |
8 |
9 |
10 |
11 | 请选择身份登录
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 请选择您的身份
20 |
21 | 学生
22 | 老师
23 | 管理员
24 |
25 |
26 | 登录
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
160 |
--------------------------------------------------------------------------------
/service/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # https://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven2 Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /etc/mavenrc ] ; then
40 | . /etc/mavenrc
41 | fi
42 |
43 | if [ -f "$HOME/.mavenrc" ] ; then
44 | . "$HOME/.mavenrc"
45 | fi
46 |
47 | fi
48 |
49 | # OS specific support. $var _must_ be set to either true or false.
50 | cygwin=false;
51 | darwin=false;
52 | mingw=false
53 | case "`uname`" in
54 | CYGWIN*) cygwin=true ;;
55 | MINGW*) mingw=true;;
56 | Darwin*) darwin=true
57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59 | if [ -z "$JAVA_HOME" ]; then
60 | if [ -x "/usr/libexec/java_home" ]; then
61 | export JAVA_HOME="`/usr/libexec/java_home`"
62 | else
63 | export JAVA_HOME="/Library/Java/Home"
64 | fi
65 | fi
66 | ;;
67 | esac
68 |
69 | if [ -z "$JAVA_HOME" ] ; then
70 | if [ -r /etc/gentoo-release ] ; then
71 | JAVA_HOME=`java-config --jre-home`
72 | fi
73 | fi
74 |
75 | if [ -z "$M2_HOME" ] ; then
76 | ## resolve links - $0 may be a link to maven's home
77 | PRG="$0"
78 |
79 | # need this for relative symlinks
80 | while [ -h "$PRG" ] ; do
81 | ls=`ls -ld "$PRG"`
82 | link=`expr "$ls" : '.*-> \(.*\)$'`
83 | if expr "$link" : '/.*' > /dev/null; then
84 | PRG="$link"
85 | else
86 | PRG="`dirname "$PRG"`/$link"
87 | fi
88 | done
89 |
90 | saveddir=`pwd`
91 |
92 | M2_HOME=`dirname "$PRG"`/..
93 |
94 | # make it fully qualified
95 | M2_HOME=`cd "$M2_HOME" && pwd`
96 |
97 | cd "$saveddir"
98 | # echo Using m2 at $M2_HOME
99 | fi
100 |
101 | # For Cygwin, ensure paths are in UNIX format before anything is touched
102 | if $cygwin ; then
103 | [ -n "$M2_HOME" ] &&
104 | M2_HOME=`cygpath --unix "$M2_HOME"`
105 | [ -n "$JAVA_HOME" ] &&
106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107 | [ -n "$CLASSPATH" ] &&
108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109 | fi
110 |
111 | # For Mingw, ensure paths are in UNIX format before anything is touched
112 | if $mingw ; then
113 | [ -n "$M2_HOME" ] &&
114 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
115 | [ -n "$JAVA_HOME" ] &&
116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117 | # TODO classpath?
118 | fi
119 |
120 | if [ -z "$JAVA_HOME" ]; then
121 | javaExecutable="`which javac`"
122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
123 | # readlink(1) is not available as standard on Solaris 10.
124 | readLink=`which readlink`
125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
126 | if $darwin ; then
127 | javaHome="`dirname \"$javaExecutable\"`"
128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
129 | else
130 | javaExecutable="`readlink -f \"$javaExecutable\"`"
131 | fi
132 | javaHome="`dirname \"$javaExecutable\"`"
133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
134 | JAVA_HOME="$javaHome"
135 | export JAVA_HOME
136 | fi
137 | fi
138 | fi
139 |
140 | if [ -z "$JAVACMD" ] ; then
141 | if [ -n "$JAVA_HOME" ] ; then
142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
143 | # IBM's JDK on AIX uses strange locations for the executables
144 | JAVACMD="$JAVA_HOME/jre/sh/java"
145 | else
146 | JAVACMD="$JAVA_HOME/bin/java"
147 | fi
148 | else
149 | JAVACMD="`which java`"
150 | fi
151 | fi
152 |
153 | if [ ! -x "$JAVACMD" ] ; then
154 | echo "Error: JAVA_HOME is not defined correctly." >&2
155 | echo " We cannot execute $JAVACMD" >&2
156 | exit 1
157 | fi
158 |
159 | if [ -z "$JAVA_HOME" ] ; then
160 | echo "Warning: JAVA_HOME environment variable is not set."
161 | fi
162 |
163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164 |
165 | # traverses directory structure from process work directory to filesystem root
166 | # first directory with .mvn subdirectory is considered project base directory
167 | find_maven_basedir() {
168 |
169 | if [ -z "$1" ]
170 | then
171 | echo "Path not specified to find_maven_basedir"
172 | return 1
173 | fi
174 |
175 | basedir="$1"
176 | wdir="$1"
177 | while [ "$wdir" != '/' ] ; do
178 | if [ -d "$wdir"/.mvn ] ; then
179 | basedir=$wdir
180 | break
181 | fi
182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
183 | if [ -d "${wdir}" ]; then
184 | wdir=`cd "$wdir/.."; pwd`
185 | fi
186 | # end of workaround
187 | done
188 | echo "${basedir}"
189 | }
190 |
191 | # concatenates all lines of a file
192 | concat_lines() {
193 | if [ -f "$1" ]; then
194 | echo "$(tr -s '\n' ' ' < "$1")"
195 | fi
196 | }
197 |
198 | BASE_DIR=`find_maven_basedir "$(pwd)"`
199 | if [ -z "$BASE_DIR" ]; then
200 | exit 1;
201 | fi
202 |
203 | ##########################################################################################
204 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
205 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
206 | ##########################################################################################
207 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
208 | if [ "$MVNW_VERBOSE" = true ]; then
209 | echo "Found .mvn/wrapper/maven-wrapper.jar"
210 | fi
211 | else
212 | if [ "$MVNW_VERBOSE" = true ]; then
213 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
214 | fi
215 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
216 | while IFS="=" read key value; do
217 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
218 | esac
219 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
220 | if [ "$MVNW_VERBOSE" = true ]; then
221 | echo "Downloading from: $jarUrl"
222 | fi
223 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
224 |
225 | if command -v wget > /dev/null; then
226 | if [ "$MVNW_VERBOSE" = true ]; then
227 | echo "Found wget ... using wget"
228 | fi
229 | wget "$jarUrl" -O "$wrapperJarPath"
230 | elif command -v curl > /dev/null; then
231 | if [ "$MVNW_VERBOSE" = true ]; then
232 | echo "Found curl ... using curl"
233 | fi
234 | curl -o "$wrapperJarPath" "$jarUrl"
235 | else
236 | if [ "$MVNW_VERBOSE" = true ]; then
237 | echo "Falling back to using Java to download"
238 | fi
239 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
240 | if [ -e "$javaClass" ]; then
241 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
242 | if [ "$MVNW_VERBOSE" = true ]; then
243 | echo " - Compiling MavenWrapperDownloader.java ..."
244 | fi
245 | # Compiling the Java class
246 | ("$JAVA_HOME/bin/javac" "$javaClass")
247 | fi
248 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
249 | # Running the downloader
250 | if [ "$MVNW_VERBOSE" = true ]; then
251 | echo " - Running MavenWrapperDownloader.java ..."
252 | fi
253 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
254 | fi
255 | fi
256 | fi
257 | fi
258 | ##########################################################################################
259 | # End of extension
260 | ##########################################################################################
261 |
262 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
263 | if [ "$MVNW_VERBOSE" = true ]; then
264 | echo $MAVEN_PROJECTBASEDIR
265 | fi
266 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
267 |
268 | # For Cygwin, switch paths to Windows format before running java
269 | if $cygwin; then
270 | [ -n "$M2_HOME" ] &&
271 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
272 | [ -n "$JAVA_HOME" ] &&
273 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
274 | [ -n "$CLASSPATH" ] &&
275 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
276 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
277 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
278 | fi
279 |
280 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
281 |
282 | exec "$JAVACMD" \
283 | $MAVEN_OPTS \
284 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
285 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
286 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
287 |
--------------------------------------------------------------------------------
/service/demo/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # https://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven2 Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /etc/mavenrc ] ; then
40 | . /etc/mavenrc
41 | fi
42 |
43 | if [ -f "$HOME/.mavenrc" ] ; then
44 | . "$HOME/.mavenrc"
45 | fi
46 |
47 | fi
48 |
49 | # OS specific support. $var _must_ be set to either true or false.
50 | cygwin=false;
51 | darwin=false;
52 | mingw=false
53 | case "`uname`" in
54 | CYGWIN*) cygwin=true ;;
55 | MINGW*) mingw=true;;
56 | Darwin*) darwin=true
57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59 | if [ -z "$JAVA_HOME" ]; then
60 | if [ -x "/usr/libexec/java_home" ]; then
61 | export JAVA_HOME="`/usr/libexec/java_home`"
62 | else
63 | export JAVA_HOME="/Library/Java/Home"
64 | fi
65 | fi
66 | ;;
67 | esac
68 |
69 | if [ -z "$JAVA_HOME" ] ; then
70 | if [ -r /etc/gentoo-release ] ; then
71 | JAVA_HOME=`java-config --jre-home`
72 | fi
73 | fi
74 |
75 | if [ -z "$M2_HOME" ] ; then
76 | ## resolve links - $0 may be a link to maven's home
77 | PRG="$0"
78 |
79 | # need this for relative symlinks
80 | while [ -h "$PRG" ] ; do
81 | ls=`ls -ld "$PRG"`
82 | link=`expr "$ls" : '.*-> \(.*\)$'`
83 | if expr "$link" : '/.*' > /dev/null; then
84 | PRG="$link"
85 | else
86 | PRG="`dirname "$PRG"`/$link"
87 | fi
88 | done
89 |
90 | saveddir=`pwd`
91 |
92 | M2_HOME=`dirname "$PRG"`/..
93 |
94 | # make it fully qualified
95 | M2_HOME=`cd "$M2_HOME" && pwd`
96 |
97 | cd "$saveddir"
98 | # echo Using m2 at $M2_HOME
99 | fi
100 |
101 | # For Cygwin, ensure paths are in UNIX format before anything is touched
102 | if $cygwin ; then
103 | [ -n "$M2_HOME" ] &&
104 | M2_HOME=`cygpath --unix "$M2_HOME"`
105 | [ -n "$JAVA_HOME" ] &&
106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107 | [ -n "$CLASSPATH" ] &&
108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109 | fi
110 |
111 | # For Mingw, ensure paths are in UNIX format before anything is touched
112 | if $mingw ; then
113 | [ -n "$M2_HOME" ] &&
114 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
115 | [ -n "$JAVA_HOME" ] &&
116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117 | # TODO classpath?
118 | fi
119 |
120 | if [ -z "$JAVA_HOME" ]; then
121 | javaExecutable="`which javac`"
122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
123 | # readlink(1) is not available as standard on Solaris 10.
124 | readLink=`which readlink`
125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
126 | if $darwin ; then
127 | javaHome="`dirname \"$javaExecutable\"`"
128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
129 | else
130 | javaExecutable="`readlink -f \"$javaExecutable\"`"
131 | fi
132 | javaHome="`dirname \"$javaExecutable\"`"
133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
134 | JAVA_HOME="$javaHome"
135 | export JAVA_HOME
136 | fi
137 | fi
138 | fi
139 |
140 | if [ -z "$JAVACMD" ] ; then
141 | if [ -n "$JAVA_HOME" ] ; then
142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
143 | # IBM's JDK on AIX uses strange locations for the executables
144 | JAVACMD="$JAVA_HOME/jre/sh/java"
145 | else
146 | JAVACMD="$JAVA_HOME/bin/java"
147 | fi
148 | else
149 | JAVACMD="`which java`"
150 | fi
151 | fi
152 |
153 | if [ ! -x "$JAVACMD" ] ; then
154 | echo "Error: JAVA_HOME is not defined correctly." >&2
155 | echo " We cannot execute $JAVACMD" >&2
156 | exit 1
157 | fi
158 |
159 | if [ -z "$JAVA_HOME" ] ; then
160 | echo "Warning: JAVA_HOME environment variable is not set."
161 | fi
162 |
163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164 |
165 | # traverses directory structure from process work directory to filesystem root
166 | # first directory with .mvn subdirectory is considered project base directory
167 | find_maven_basedir() {
168 |
169 | if [ -z "$1" ]
170 | then
171 | echo "Path not specified to find_maven_basedir"
172 | return 1
173 | fi
174 |
175 | basedir="$1"
176 | wdir="$1"
177 | while [ "$wdir" != '/' ] ; do
178 | if [ -d "$wdir"/.mvn ] ; then
179 | basedir=$wdir
180 | break
181 | fi
182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
183 | if [ -d "${wdir}" ]; then
184 | wdir=`cd "$wdir/.."; pwd`
185 | fi
186 | # end of workaround
187 | done
188 | echo "${basedir}"
189 | }
190 |
191 | # concatenates all lines of a file
192 | concat_lines() {
193 | if [ -f "$1" ]; then
194 | echo "$(tr -s '\n' ' ' < "$1")"
195 | fi
196 | }
197 |
198 | BASE_DIR=`find_maven_basedir "$(pwd)"`
199 | if [ -z "$BASE_DIR" ]; then
200 | exit 1;
201 | fi
202 |
203 | ##########################################################################################
204 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
205 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
206 | ##########################################################################################
207 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
208 | if [ "$MVNW_VERBOSE" = true ]; then
209 | echo "Found .mvn/wrapper/maven-wrapper.jar"
210 | fi
211 | else
212 | if [ "$MVNW_VERBOSE" = true ]; then
213 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
214 | fi
215 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
216 | while IFS="=" read key value; do
217 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
218 | esac
219 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
220 | if [ "$MVNW_VERBOSE" = true ]; then
221 | echo "Downloading from: $jarUrl"
222 | fi
223 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
224 |
225 | if command -v wget > /dev/null; then
226 | if [ "$MVNW_VERBOSE" = true ]; then
227 | echo "Found wget ... using wget"
228 | fi
229 | wget "$jarUrl" -O "$wrapperJarPath"
230 | elif command -v curl > /dev/null; then
231 | if [ "$MVNW_VERBOSE" = true ]; then
232 | echo "Found curl ... using curl"
233 | fi
234 | curl -o "$wrapperJarPath" "$jarUrl"
235 | else
236 | if [ "$MVNW_VERBOSE" = true ]; then
237 | echo "Falling back to using Java to download"
238 | fi
239 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
240 | if [ -e "$javaClass" ]; then
241 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
242 | if [ "$MVNW_VERBOSE" = true ]; then
243 | echo " - Compiling MavenWrapperDownloader.java ..."
244 | fi
245 | # Compiling the Java class
246 | ("$JAVA_HOME/bin/javac" "$javaClass")
247 | fi
248 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
249 | # Running the downloader
250 | if [ "$MVNW_VERBOSE" = true ]; then
251 | echo " - Running MavenWrapperDownloader.java ..."
252 | fi
253 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
254 | fi
255 | fi
256 | fi
257 | fi
258 | ##########################################################################################
259 | # End of extension
260 | ##########################################################################################
261 |
262 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
263 | if [ "$MVNW_VERBOSE" = true ]; then
264 | echo $MAVEN_PROJECTBASEDIR
265 | fi
266 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
267 |
268 | # For Cygwin, switch paths to Windows format before running java
269 | if $cygwin; then
270 | [ -n "$M2_HOME" ] &&
271 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
272 | [ -n "$JAVA_HOME" ] &&
273 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
274 | [ -n "$CLASSPATH" ] &&
275 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
276 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
277 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
278 | fi
279 |
280 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
281 |
282 | exec "$JAVACMD" \
283 | $MAVEN_OPTS \
284 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
285 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
286 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
287 |
--------------------------------------------------------------------------------
/web/src/components/Student/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 学生选课系统
7 |
8 |
9 | 退出
10 |
11 |
12 |
13 |
14 |
15 |
16 |
管理个人课程
17 |
课程信息展示
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 新增
26 |
27 |
28 | 请输入课程号和您的学号
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
40 |
41 |
42 | 退选
43 |
44 |
45 | 请输入退选的课程号和您的学号
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
57 |
58 |
59 |
60 |
67 |
68 |
69 | {{scope.row.cid}}
70 |
71 |
72 |
73 |
74 | {{scope.row.cname}}
75 |
76 |
77 |
78 |
79 | {{scope.row.address}}
80 |
81 |
82 |
83 |
84 | {{scope.row.loginsid}}
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
101 |
102 |
103 | {{scope.row.cid}}
104 |
105 |
106 |
107 |
108 | {{scope.row.cname}}
109 |
110 |
111 |
112 |
113 | {{scope.row.address}}
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
283 |
--------------------------------------------------------------------------------
/web/static/js/meteor.exec.js:
--------------------------------------------------------------------------------
1 | /* -----------------------------------------------
2 | /* Author : Vincent Garreau - vincentgarreau.com
3 | /* MIT license: http://opensource.org/licenses/MIT
4 | /* GitHub : https://github.com/VincentGarreau/particles.js
5 | /* How to use? : Check the GitHub README
6 | /* v1.0.3
7 | /* ----------------------------------------------- */
8 | function launchParticlesJS(a, e) {
9 | var i = document.querySelector("#" + a + " > canvas");
10 | pJS = {
11 | canvas: {
12 | el: i,
13 | w: i.offsetWidth,
14 | h: i.offsetHeight
15 | },
16 | particles: {
17 | color: "#fff",
18 | shape: "circle",
19 | opacity: 1,
20 | size: 2.5,
21 | size_random: true,
22 | nb: 200,
23 | line_linked: {
24 | enable_auto: true,
25 | distance: 100,
26 | color: "#fff",
27 | opacity: 1,
28 | width: 1,
29 | condensed_mode: {
30 | enable: true,
31 | rotateX: 65000,
32 | rotateY: 65000
33 | }
34 | },
35 | anim: {
36 | enable: true,
37 | speed: 1
38 | },
39 | array: []
40 | },
41 | interactivity: {
42 | enable: true,
43 | mouse: {
44 | distance: 100
45 | },
46 | detect_on: "canvas",
47 | mode: "grab",
48 | line_linked: {
49 | opacity: 1
50 | },
51 | events: {
52 | onclick: {
53 | enable: true,
54 | mode: "push",
55 | nb: 4
56 | }
57 | }
58 | },
59 | retina_detect: false,
60 | fn: {
61 | vendors: {
62 | interactivity: {}
63 | }
64 | }
65 | };
66 | if (e) {
67 | if (e.particles) {
68 | var b = e.particles;
69 | if (b.color) {
70 | pJS.particles.color = b.color
71 | }
72 | if (b.shape) {
73 | pJS.particles.shape = b.shape
74 | }
75 | if (b.opacity) {
76 | pJS.particles.opacity = b.opacity
77 | }
78 | if (b.size) {
79 | pJS.particles.size = b.size
80 | }
81 | if (b.size_random == false) {
82 | pJS.particles.size_random = b.size_random
83 | }
84 | if (b.nb) {
85 | pJS.particles.nb = b.nb
86 | }
87 | if (b.line_linked) {
88 | var j = b.line_linked;
89 | if (j.enable_auto == false) {
90 | pJS.particles.line_linked.enable_auto = j.enable_auto
91 | }
92 | if (j.distance) {
93 | pJS.particles.line_linked.distance = j.distance
94 | }
95 | if (j.color) {
96 | pJS.particles.line_linked.color = j.color
97 | }
98 | if (j.opacity) {
99 | pJS.particles.line_linked.opacity = j.opacity
100 | }
101 | if (j.width) {
102 | pJS.particles.line_linked.width = j.width
103 | }
104 | if (j.condensed_mode) {
105 | var g = j.condensed_mode;
106 | if (g.enable == false) {
107 | pJS.particles.line_linked.condensed_mode.enable = g.enable
108 | }
109 | if (g.rotateX) {
110 | pJS.particles.line_linked.condensed_mode.rotateX = g.rotateX
111 | }
112 | if (g.rotateY) {
113 | pJS.particles.line_linked.condensed_mode.rotateY = g.rotateY
114 | }
115 | }
116 | }
117 | if (b.anim) {
118 | var k = b.anim;
119 | if (k.enable == false) {
120 | pJS.particles.anim.enable = k.enable
121 | }
122 | if (k.speed) {
123 | pJS.particles.anim.speed = k.speed
124 | }
125 | }
126 | }
127 | if (e.interactivity) {
128 | var c = e.interactivity;
129 | if (c.enable == false) {
130 | pJS.interactivity.enable = c.enable
131 | }
132 | if (c.mouse) {
133 | if (c.mouse.distance) {
134 | pJS.interactivity.mouse.distance = c.mouse.distance
135 | }
136 | }
137 | if (c.detect_on) {
138 | pJS.interactivity.detect_on = c.detect_on
139 | }
140 | if (c.mode) {
141 | pJS.interactivity.mode = c.mode
142 | }
143 | if (c.line_linked) {
144 | if (c.line_linked.opacity) {
145 | pJS.interactivity.line_linked.opacity = c.line_linked.opacity
146 | }
147 | }
148 | if (c.events) {
149 | var d = c.events;
150 | if (d.onclick) {
151 | var h = d.onclick;
152 | if (h.enable == false) {
153 | pJS.interactivity.events.onclick.enable = false
154 | }
155 | if (h.mode != "push") {
156 | pJS.interactivity.events.onclick.mode = h.mode
157 | }
158 | if (h.nb) {
159 | pJS.interactivity.events.onclick.nb = h.nb
160 | }
161 | }
162 | }
163 | }
164 | pJS.retina_detect = e.retina_detect
165 | }
166 | pJS.particles.color_rgb = hexToRgb(pJS.particles.color);
167 | pJS.particles.line_linked.color_rgb_line = hexToRgb(pJS.particles.line_linked.color);
168 | if (pJS.retina_detect && window.devicePixelRatio > 1) {
169 | pJS.retina = true;
170 | pJS.canvas.pxratio = window.devicePixelRatio;
171 | pJS.canvas.w = pJS.canvas.el.offsetWidth * pJS.canvas.pxratio;
172 | pJS.canvas.h = pJS.canvas.el.offsetHeight * pJS.canvas.pxratio;
173 | pJS.particles.anim.speed = pJS.particles.anim.speed * pJS.canvas.pxratio;
174 | pJS.particles.line_linked.distance = pJS.particles.line_linked.distance * pJS.canvas.pxratio;
175 | pJS.particles.line_linked.width = pJS.particles.line_linked.width * pJS.canvas.pxratio;
176 | pJS.interactivity.mouse.distance = pJS.interactivity.mouse.distance * pJS.canvas.pxratio
177 | }
178 | pJS.fn.canvasInit = function() {
179 | pJS.canvas.ctx = pJS.canvas.el.getContext("2d")
180 | };
181 | pJS.fn.canvasSize = function() {
182 | pJS.canvas.el.width = pJS.canvas.w;
183 | pJS.canvas.el.height = pJS.canvas.h;
184 | window.onresize = function() {
185 | if (pJS) {
186 | pJS.canvas.w = pJS.canvas.el.offsetWidth;
187 | pJS.canvas.h = pJS.canvas.el.offsetHeight;
188 | if (pJS.retina) {
189 | pJS.canvas.w *= pJS.canvas.pxratio;
190 | pJS.canvas.h *= pJS.canvas.pxratio
191 | }
192 | pJS.canvas.el.width = pJS.canvas.w;
193 | pJS.canvas.el.height = pJS.canvas.h;
194 | pJS.fn.canvasPaint();
195 | if (!pJS.particles.anim.enable) {
196 | pJS.fn.particlesRemove();
197 | pJS.fn.canvasRemove();
198 | f()
199 | }
200 | }
201 | }
202 | };
203 | pJS.fn.canvasPaint = function() {
204 | pJS.canvas.ctx.fillRect(0, 0, pJS.canvas.w, pJS.canvas.h)
205 | };
206 | pJS.fn.canvasRemove = function() {
207 | pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h)
208 | };
209 | pJS.fn.particle = function(n, o, m) {
210 | this.x = m ? m.x : Math.random() * pJS.canvas.w;
211 | this.y = m ? m.y : Math.random() * pJS.canvas.h;
212 | this.radius = (pJS.particles.size_random ? Math.random() : 1) * pJS.particles.size;
213 | if (pJS.retina) {
214 | this.radius *= pJS.canvas.pxratio
215 | }
216 | this.color = n;
217 | this.opacity = o;
218 | this.vx = -0.5 + Math.random();
219 | this.vy = -0.5 + Math.random();
220 | this.draw = function() {
221 | pJS.canvas.ctx.fillStyle = "rgba(" + this.color.r + "," + this.color.g + "," + this.color.b + "," + this.opacity + ")";
222 | pJS.canvas.ctx.beginPath();
223 | switch (pJS.particles.shape) {
224 | case "circle":
225 | pJS.canvas.ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);
226 | break;
227 | case "edge":
228 | pJS.canvas.ctx.rect(this.x, this.y, this.radius * 2, this.radius * 2);
229 | break;
230 | case "triangle":
231 | pJS.canvas.ctx.moveTo(this.x, this.y - this.radius);
232 | pJS.canvas.ctx.lineTo(this.x + this.radius, this.y + this.radius);
233 | pJS.canvas.ctx.lineTo(this.x - this.radius, this.y + this.radius);
234 | pJS.canvas.ctx.closePath();
235 | break
236 | }
237 | pJS.canvas.ctx.fill()
238 | }
239 | };
240 | pJS.fn.particlesCreate = function() {
241 | for (var m = 0; m < pJS.particles.nb; m++) {
242 | pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color_rgb, pJS.particles.opacity))
243 | }
244 | };
245 | pJS.fn.particlesAnimate = function() {
246 | for (var n = 0; n < pJS.particles.array.length; n++) {
247 | var q = pJS.particles.array[n];
248 | q.x += q.vx * (pJS.particles.anim.speed / 2);
249 | q.y += q.vy * (pJS.particles.anim.speed / 2);
250 | if (q.x - q.radius > pJS.canvas.w) {
251 | q.x = q.radius
252 | } else {
253 | if (q.x + q.radius < 0) {
254 | q.x = pJS.canvas.w + q.radius
255 | }
256 | }
257 | if (q.y - q.radius > pJS.canvas.h) {
258 | q.y = q.radius
259 | } else {
260 | if (q.y + q.radius < 0) {
261 | q.y = pJS.canvas.h + q.radius
262 | }
263 | }
264 | for (var m = n + 1; m < pJS.particles.array.length; m++) {
265 | var o = pJS.particles.array[m];
266 | if (pJS.particles.line_linked.enable_auto) {
267 | pJS.fn.vendors.distanceParticles(q, o)
268 | }
269 | if (pJS.interactivity.enable) {
270 | switch (pJS.interactivity.mode) {
271 | case "grab":
272 | pJS.fn.vendors.interactivity.grabParticles(q, o);
273 | break
274 | }
275 | }
276 | }
277 | }
278 | };
279 | pJS.fn.particlesDraw = function() {
280 | pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);
281 | pJS.fn.particlesAnimate();
282 | for (var m = 0; m < pJS.particles.array.length; m++) {
283 | var n = pJS.particles.array[m];
284 | n.draw("rgba(" + n.color.r + "," + n.color.g + "," + n.color.b + "," + n.opacity + ")")
285 | }
286 | };
287 | pJS.fn.particlesRemove = function() {
288 | pJS.particles.array = []
289 | };
290 | pJS.fn.vendors.distanceParticles = function(t, r) {
291 | var o = t.x - r.x,
292 | n = t.y - r.y,
293 | s = Math.sqrt(o * o + n * n);
294 | if (s <= pJS.particles.line_linked.distance) {
295 | var m = pJS.particles.line_linked.color_rgb_line;
296 | pJS.canvas.ctx.beginPath();
297 | pJS.canvas.ctx.strokeStyle = "rgba(" + m.r + "," + m.g + "," + m.b + "," + (pJS.particles.line_linked.opacity - s / pJS.particles.line_linked.distance) + ")";
298 | pJS.canvas.ctx.moveTo(t.x, t.y);
299 | pJS.canvas.ctx.lineTo(r.x, r.y);
300 | pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;
301 | pJS.canvas.ctx.stroke();
302 | pJS.canvas.ctx.closePath();
303 | if (pJS.particles.line_linked.condensed_mode.enable) {
304 | var o = t.x - r.x,
305 | n = t.y - r.y,
306 | q = o / (pJS.particles.line_linked.condensed_mode.rotateX * 1000),
307 | p = n / (pJS.particles.line_linked.condensed_mode.rotateY * 1000);
308 | r.vx += q;
309 | r.vy += p
310 | }
311 | }
312 | };
313 | pJS.fn.vendors.interactivity.listeners = function() {
314 | if (pJS.interactivity.detect_on == "window") {
315 | var m = window
316 | } else {
317 | var m = pJS.canvas.el
318 | }
319 | m.onmousemove = function(p) {
320 | if (m == window) {
321 | var o = p.clientX,
322 | n = p.clientY
323 | } else {
324 | var o = p.offsetX || p.clientX,
325 | n = p.offsetY || p.clientY
326 | }
327 | if (pJS) {
328 | pJS.interactivity.mouse.pos_x = o;
329 | pJS.interactivity.mouse.pos_y = n;
330 | if (pJS.retina) {
331 | pJS.interactivity.mouse.pos_x *= pJS.canvas.pxratio;
332 | pJS.interactivity.mouse.pos_y *= pJS.canvas.pxratio
333 | }
334 | pJS.interactivity.status = "mousemove"
335 | }
336 | };
337 | m.onmouseleave = function(n) {
338 | if (pJS) {
339 | pJS.interactivity.mouse.pos_x = 0;
340 | pJS.interactivity.mouse.pos_y = 0;
341 | pJS.interactivity.status = "mouseleave"
342 | }
343 | };
344 | if (pJS.interactivity.events.onclick.enable) {
345 | switch (pJS.interactivity.events.onclick.mode) {
346 | case "push":
347 | m.onclick = function(o) {
348 | if (pJS) {
349 | for (var n = 0; n < pJS.interactivity.events.onclick.nb; n++) {
350 | pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color_rgb, pJS.particles.opacity, {
351 | x: pJS.interactivity.mouse.pos_x,
352 | y: pJS.interactivity.mouse.pos_y
353 | }))
354 | }
355 | }
356 | };
357 | break;
358 | case "remove":
359 | m.onclick = function(n) {
360 | pJS.particles.array.splice(0, pJS.interactivity.events.onclick.nb)
361 | };
362 | break
363 | }
364 | }
365 | };
366 | pJS.fn.vendors.interactivity.grabParticles = function(r, q) {
367 | var u = r.x - q.x,
368 | s = r.y - q.y,
369 | p = Math.sqrt(u * u + s * s);
370 | var t = r.x - pJS.interactivity.mouse.pos_x,
371 | n = r.y - pJS.interactivity.mouse.pos_y,
372 | o = Math.sqrt(t * t + n * n);
373 | if (p <= pJS.particles.line_linked.distance && o <= pJS.interactivity.mouse.distance && pJS.interactivity.status == "mousemove") {
374 | var m = pJS.particles.line_linked.color_rgb_line;
375 | pJS.canvas.ctx.beginPath();
376 | pJS.canvas.ctx.strokeStyle = "rgba(" + m.r + "," + m.g + "," + m.b + "," + (pJS.interactivity.line_linked.opacity - o / pJS.interactivity.mouse.distance) + ")";
377 | pJS.canvas.ctx.moveTo(r.x, r.y);
378 | pJS.canvas.ctx.lineTo(pJS.interactivity.mouse.pos_x, pJS.interactivity.mouse.pos_y);
379 | pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;
380 | pJS.canvas.ctx.stroke();
381 | pJS.canvas.ctx.closePath()
382 | }
383 | };
384 | pJS.fn.vendors.destroy = function() {
385 | cancelAnimationFrame(pJS.fn.requestAnimFrame);
386 | i.remove();
387 | delete pJS
388 | };
389 |
390 | function f() {
391 | pJS.fn.canvasInit();
392 | pJS.fn.canvasSize();
393 | pJS.fn.canvasPaint();
394 | pJS.fn.particlesCreate();
395 | pJS.fn.particlesDraw()
396 | }
397 |
398 | function l() {
399 | pJS.fn.particlesDraw();
400 | pJS.fn.requestAnimFrame = requestAnimFrame(l)
401 | }
402 | f();
403 | if (pJS.particles.anim.enable) {
404 | l()
405 | }
406 | if (pJS.interactivity.enable) {
407 | pJS.fn.vendors.interactivity.listeners()
408 | }
409 | }
410 | window.requestAnimFrame = (function() {
411 | return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(a) {
412 | window.setTimeout(a, 1000 / 60)
413 | }
414 | })();
415 | window.cancelRequestAnimFrame = (function() {
416 | return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout
417 | })();
418 |
419 | function hexToRgb(c) {
420 | var b = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
421 | c = c.replace(b, function(e, h, f, d) {
422 | return h + h + f + f + d + d
423 | });
424 | var a = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(c);
425 | return a ? {
426 | r: parseInt(a[1], 16),
427 | g: parseInt(a[2], 16),
428 | b: parseInt(a[3], 16)
429 | } : null
430 | }
431 | window.particlesJS = function(d, c) {
432 | if (typeof(d) != "string") {
433 | c = d;
434 | d = "particles-js"
435 | }
436 | if (!d) {
437 | d = "particles-js"
438 | }
439 | var b = document.createElement("canvas");
440 | b.style.width = "100%";
441 | b.style.height = "100%";
442 | var a = document.getElementById(d).appendChild(b);
443 | if (a != null) {
444 | launchParticlesJS(d, c)
445 | }
446 | };
--------------------------------------------------------------------------------
/web/src/components/Teacher/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 教师系统
7 |
8 |
9 | 退出
10 |
11 |
12 |
13 |
14 |
15 |
16 |
管理授课课程
17 |
课程信息展示
18 |
学生成绩管理
19 |
20 |
21 |
22 |
23 |
24 |
25 | 新增
26 |
27 |
28 | 请输入需要授课的课程号和您的教师编号
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
40 |
41 |
42 | 删除
43 |
44 |
45 | 请输入需要删除的课程号和您的教师编号
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
57 |
58 |
59 |
60 |
67 |
68 |
69 | {{scope.row.cid}}
70 |
71 |
72 |
73 |
74 | {{scope.row.cname}}
75 |
76 |
77 |
78 |
79 | {{scope.row.address}}
80 |
81 |
82 |
83 |
84 | {{scope.row.logintid}}
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
101 |
102 |
103 | {{scope.row.cid}}
104 |
105 |
106 |
107 |
108 | {{scope.row.cname}}
109 |
110 |
111 |
112 |
113 | {{scope.row.address}}
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | 评分
123 |
124 |
125 | 请课程号、学号和分数
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
140 |
141 |
142 |
143 |
150 |
151 |
152 | {{scope.row.cid}}
153 |
154 |
155 |
156 |
157 | {{scope.row.cname}}
158 |
159 |
160 |
161 |
162 | {{scope.row.address}}
163 |
164 |
165 |
166 |
167 | {{scope.row.loginsid}}
168 |
169 |
170 |
171 |
172 | {{scope.row.score}}
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
439 |
--------------------------------------------------------------------------------
/web/src/components/Administrator/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 管理系统
7 |
8 |
9 | 退出
10 |
11 |
12 |
13 |
14 |
15 |
16 |
管理学生
17 |
管理课程
18 |
管理老师
19 |
20 |
21 |
22 |
23 |
24 |
25 | 新增
26 |
27 |
28 | 请输入需要新增的学生信息
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
46 |
47 |
48 | 修改
49 |
50 |
51 | 请输入需要修改的学生信息
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
69 |
70 |
71 | 删除
72 |
73 |
74 | 请输入需要删除学生学号
75 |
76 |
77 |
78 |
79 |
83 |
84 |
85 |
86 |
93 |
94 |
95 | {{scope.row.loginsid}}
96 |
97 |
98 |
99 |
100 | {{scope.row.sname}}
101 |
102 |
103 |
104 |
105 | {{scope.row.password}}
106 |
107 |
108 |
109 |
110 | {{scope.row.gender}}
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | 新增
120 |
121 |
122 | 请输入新增课程信息
123 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
137 |
138 |
139 | 修改
140 |
141 |
142 | 请输入需要修改的课程信息
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
157 |
158 |
159 | 删除
160 |
161 |
162 | 请输入需要删除的课程名
163 |
164 |
165 |
166 |
167 |
171 |
172 |
173 |
174 |
175 |
176 |
183 |
184 |
185 | {{scope.row.cid}}
186 |
187 |
188 |
189 |
190 | {{scope.row.cname}}
191 |
192 |
193 |
194 |
195 | {{scope.row.address}}
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 | 新增
205 |
206 |
207 | 请输入新增教师信息
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
222 |
223 |
224 | 修改
225 |
226 |
227 | 请输入需要修改的教师信息
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
242 |
243 |
244 | 删除
245 |
246 |
247 | 请输入需要删除的教师编号
248 |
249 |
250 |
251 |
252 |
256 |
257 |
258 |
259 |
266 |
267 |
268 | {{scope.row.logintid}}
269 |
270 |
271 |
272 |
273 | {{scope.row.tname}}
274 |
275 |
276 |
277 |
278 | {{scope.row.password}}
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
720 |
--------------------------------------------------------------------------------