# vue工程项目初始化操作指南
- 强烈推荐在VM中完成如下实验,推荐使用virtualbox
- 如果是机房的电脑上实验,先关闭ReportServer服务,如下:

-
- 配置调试用chrome浏览器
- 在c盘建一个名为chrome的文件夹
- 右键点桌面chrome图标,打开属性,在对话框的"目标(T)"处,复制如下命令替换原有参数后点确定。

~~~
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-site-isolation-trials --disable-web-security --user-data-dir=c:\chrome
~~~
- 操作完后关闭浏览器,在重新打开
- 安装wampserver。
- 安装idea。
- 安装node.js。
- 进入命令行。
- 进入c盘根目录: cd/
- 在c盘根目录创建项目文件夹:md exam_app
- 进入项目文件夹:cd exam_app
- 配置镜像地址:npm config set registry https://registry.npmmirror.com
- 安装vue-cli:npm install -g @vue/cli
- 创建vue项目脚手架:vue create app_vue
- 进入vue项目文件夹:cd app_vue
- 安装router包:npm install vue-router@next
- 安装axios包:npm install axios
- 启动vue项目:npm run serve
- 启动idea,打开刚才创建的app_vue项目
- 安装vue的插件

- 配置vue
~~~json
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})
module.exports={
devServer:{
port:586xx,
allowedHosts:"all",
proxy: {
'/examServer': {
target: "http://10.128.128.xx:8022",
secure: false,
changeOrigin: true,
pathRewrite: {
'^/examServer': ''
}
},
'/springbootServer': {
target: "http://localhost:583xx",
secure: false,
changeOrigin: true,
pathRewrite: {
'^/springbootServer': ''
}
},
}
}
}
~~~
- 每次修改了vue配置文件后,要重启vue
- 准备好老师发送的考试服务器客户端,文件名为e_yyyymmdd.jar ,复制到c盘根下
- 进入命令行
- 进入c盘根目录: `cd /`
- 运行考试服务器:`java -jar e_yyyymmdd.jar`(原则上此文件的名称与考次号一致)
- 考试服务器窗口在运行过程中如果出现问题,请用ctrl+c中止程序。vue-cli窗口也是类似,不要直接关窗口。
- 如果出现

,请用`neststat -ano`找到8099端口对应的PID,后杀掉此进程解决。
- 配置router/index.js
# springboot工程项目初始化操作指南
- 新建工程项目

- 设置项目参数

- 设置项目参数

- 设置项目参数

- 设置编译参数

- 设置项目参数

- 设置项目参数

- 设置pom参数

~~~xml
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.6.3
com.luowei
app_sb
0.0.1-SNAPSHOT
app_sb
Demo project for Spring Boot
8
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-test
test
org.mybatis.spring.boot
mybatis-spring-boot-starter
2.3.1
com.mysql
mysql-connector-j
8.0.31
org.springframework.boot
spring-boot-maven-plugin
~~~
- 设置项目参数

- maven配置
~~~xml
alimaven
aliyun maven
http://maven.aliyun.com/nexus/content/groups/public/
central
uk
central
Human Readable Name for this Mirror.
http://uk.maven.org/maven2/
CN
OSChina Central
http://maven.oschina.net/content/groups/public/
central
nexus
internal nexus repository
http://repo.maven.apache.org/maven2
central
~~~
- 配置完后刷新maven
- 配置application.yml
~~~yml
server:
port: 583xx
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password:
url: jdbc:mysql://localhost:3306/exam_xxx?characterEncoding=utf-8&serverTimezone=UTC&useSSL=false
mybatis:
mapper-locations: classpath:mapper/*Mapper.xml
type-aliases-package: com.luowei.exam
configuration:
#log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
~~~
- 配置数据库与数据表(部分)
~~~sql
drop database exam_xxx;
create database exam_xxx;
use exam_xxx;
drop table person_base_info_881;
create table person_base_info_881(id varchar(18),name varchar(20),gender varchar(2),chronic_disease varchar(20),password varchar(20),address varchar(40),photo varchar(40),create_time int,update_time int)ENGINE=MyISAM DEFAULT CHARSET=utf8;
insert into person_base_info_881(id,name,gender,password,chronic_disease,address,photo,create_time,update_time)values('admin','罗维','01','123','c01,c02','510100','admin','-967796571','-967796571');
insert into person_base_info_881(id,name,gender,password,chronic_disease,address,photo,create_time,update_time)values('510103194610220234','洪七公','01','123','c01,c02','510100','510103194610220234','-967796571','-967796571');
insert into person_base_info_881(id,name,gender,password,chronic_disease,address,photo,create_time,update_time)values('510103194805030875','郭靖','02','123','c01,c03','500000','510103194610220234','-927796571','-927796571');
drop table person_health_info_881;
create table person_health_info_881(uuid varchar(50),id varchar(18),sbp int,dbp int,create_time int,update_time int)ENGINE=MyISAM DEFAULT CHARSET=utf8;
insert into person_health_info_881(uuid,id,sbp,dbp,create_time,update_time)values('1234567890','510103194610220234','110','80','1758399909','1758399909');
insert into person_health_info_881(uuid,id,sbp,dbp,create_time,update_time)values('1234567891','510103194610220234','120','85','1758399909','1758399909');
drop table person_base_info_881_1;
create table person_base_info_881_1(id varchar(18),name varchar(20),sbp int,dbp int)ENGINE=MyISAM DEFAULT CHARSET=utf8;
insert into person_base_info_881_1(id,name,sbp,dbp)values('510103234','罗维','114','70');
insert into person_base_info_881_1(id,name,sbp,dbp)values('510103239','洪七公','134','89');
~~~
- mapper.xml
~~~xml
~~~
- 如果调试时出现报错“java.lang.IllegalArgumentException: Source must not be null”,是你的代码有问题插入了null导致的,删除数据后可解决。
