diff --git a/README.md b/README.md new file mode 100644 index 00000000..51c27b11 --- /dev/null +++ b/README.md @@ -0,0 +1,92 @@ +# 详细配置指南 + + + +另见:[README_opreate](README_operate.md) 网页链接:[125.64.9.222:8022](http://125.64.9.222:8022/stuff/exam_operate/exam_operate_1.html) + +### 1️⃣vue工程: + +❗在 .env.development 文件中配置好相应变量: + +![](./doc/images/vue工程配置.png ) + +终端定位到工程根目录下(一般是:`C:\exam_app\app_vue` ) + +`cd C:\exam_app\app_vue` + +运行命令`npm run serve` + +运行成功如下: + +![](./doc/images/vue运行成功.png) + + + +### 2️⃣数据库配置: + +❗仅适用于本工程,不同题目应配置不同的Table,请注意识别 + +安装 wampserver 或其他 MAMP本地开发环境软件 ,本地数据库亦可 + +执行下列sql语句(仅适用本项目) + +*exam_xxxxxx_xxxxx* 替换为 *VPS database name* + +```sql +create database exam_xxxxxx_xxxxx; +use exam_xxxxxx_xxxxx; +create table user_70(name char(50),address char(50),password char(50))ENGINE=MyISAM DEFAULT CHARSET=utf8; +insert into user_70(name,address,password)values('mike','shanghai','c4ca4238a0b923820dcc509a6f75849b'); +insert into user_70(name,address,password)values('rose','beijing','c4ca4238a0b923820dcc509a6f75849b'); +create table person_805(id varchar(50),sfz_id varchar(20),name varchar(20),gender varchar(1),password varchar(20), hometown varchar(20),chronic_disease varchar(100),birthday int,emr text,create_time int,update_time int)ENGINE=MyISAM DEFAULT CHARSET=utf8; +create index `sfz_id` on `person_805` (sfz_id); +insert into person_805(id,sfz_id,name,gender,password,hometown,chronic_disease,birthday,emr,create_time,update_time)values ('001','510103198208210452','罗维','1','123','510101','hypertension','398748962','三年前确诊,病情控制良好','1636424977','1636424977'); +create table person_health_805(id varchar(50),sfz_id varchar(20),weight int,height int,heart_rate int,sbp int ,dbp int,blood_sugar DECIMAL(5,1),create_time int,update_time int)ENGINE=MyISAM DEFAULT CHARSET=utf8; +create index `sfz_id` on `person_health_805` (sfz_id); +insert into person_health_805(id,sfz_id,height,weight,heart_rate,sbp,dbp,blood_sugar,create_time,update_time)values('001','510103198208210452','176','71','78','120','75','4.1','1636424977','1636424977'); +insert into person_health_805(id,sfz_id,height,weight,heart_rate,sbp,dbp,blood_sugar,create_time,update_time)values('002','510103198208210452','176','72','73','126','80','6.8','1636511377','1636511377'); + +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'); + + +``` + + + +### 3️⃣Springboot配置 + + + +配置 **application.yml** + +```yml +server: + port: <你的springboot端口(VPS spring boot port)> # 替换<>内容 + +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: #默认密码为空 + url: jdbc:mysql://localhost:3306/?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 + +``` + + + +配置完成后 + +使用 IDEA 打开app_sb下项目后,直接运行 + +---- + +至此配置完成 \ No newline at end of file diff --git a/README_operate.md b/README_operate.md new file mode 100644 index 00000000..30aeac0f --- /dev/null +++ b/README_operate.md @@ -0,0 +1,293 @@ +# vue工程项目初始化操作指南 +
    +
  1. 强烈推荐在VM中完成如下实验,推荐使用virtualbox +
  2. 如果是机房的电脑上实验,先关闭ReportServer服务,如下: +![机房要处理的操作]( ./doc/images/机房要处理的操作_1.jpg "机房要处理的操作" ) +
  3. +
  4. 配置调试用chrome浏览器 +
  5. 在c盘建一个名为chrome的文件夹 +
  6. 右键点桌面chrome图标,打开属性,在对话框的"目标(T)"处,复制如下命令替换原有参数后点确定。 + +![chrome_nosafe]( ./doc/images/chrome_nosafe.png "chrome_nosafe") + +~~~ + "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-site-isolation-trials --disable-web-security --user-data-dir=c:\chrome +~~~ + +
  7. 操作完后关闭浏览器,在重新打开 +
  8. 安装wampserver。 +
  9. 安装idea。 +
  10. 安装node.js。 +
  11. 进入命令行。 +
  12. 进入c盘根目录: cd/ +
  13. 在c盘根目录创建项目文件夹:md exam_app +
  14. 进入项目文件夹:cd exam_app +
  15. 配置镜像地址:npm config set registry https://registry.npmmirror.com +
  16. 安装vue-cli:npm install -g @vue/cli +
  17. 创建vue项目脚手架:vue create app_vue +
  18. 进入vue项目文件夹:cd app_vue +
  19. 安装router包:npm install vue-router@next +
  20. 安装axios包:npm install axios +
  21. 启动vue项目:npm run serve +
  22. 启动idea,打开刚才创建的app_vue项目 +
  23. 安装vue的插件 + +![plugins_vue]( ./doc/images/plugins_vue.png "plugins_vue") +
  24. 配置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': '' + } + }, + } + + } +} +~~~ + +
  25. 每次修改了vue配置文件后,要重启vue +
  26. 准备好老师发送的考试服务器客户端,文件名为e_yyyymmdd.jar ,复制到c盘根下 +
  27. 进入命令行 +
  28. 进入c盘根目录: `cd /` +
  29. 运行考试服务器:`java -jar e_yyyymmdd.jar`(原则上此文件的名称与考次号一致) +
  30. 考试服务器窗口在运行过程中如果出现问题,请用ctrl+c中止程序。vue-cli窗口也是类似,不要直接关窗口。 +
  31. 如果出现 + +![java端口冲突]( ./doc/images/java端口冲突.png "java端口冲突") +,请用`neststat -ano`找到8099端口对应的PID,后杀掉此进程解决。 +
  32. 配置router/index.js +
+ + +# springboot工程项目初始化操作指南 +
    +
  1. 新建工程项目 + +![springboot1]( ./doc/images/springboot_1.png ) +

    +
  2. 设置项目参数 + +![springboot2](.\doc\images\springboot_2.png) +

    +
  3. 设置项目参数 + +![springboot3](./doc/images/springboot_3.png) + +

    +
  4. 设置项目参数 + +![](./doc/images/springboot_4.png) +

    +
  5. 设置编译参数 + +![springboot5](./doc/images/springboot_5.png) + +

    +
  6. 设置项目参数 + +![](./doc/images/springboot_7.png) +

    +
  7. 设置项目参数 + +![springboot8](./doc/images/springboot_8.png) +

    +
  8. 设置pom参数 + +![springboot6](./doc/images/springboot_6.png) + +~~~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 + + + + + +~~~ + + + +
  9. 设置项目参数 + +![]( ./doc/images/springboot_9.png ) + +
  10. 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 + + + +~~~ +
  11. 配置完后刷新maven +
  12. 配置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 +~~~ + + +
  13. 配置数据库与数据表(部分) + +~~~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'); +~~~ + +
  14. mapper.xml + +~~~xml + + + + + + + +~~~ + +
  15. 如果调试时出现报错“java.lang.IllegalArgumentException: Source must not be null”,是你的代码有问题插入了null导致的,删除数据后可解决。 + +![]( http://125.64.9.222:8022/stuff/image/%E6%95%B0%E6%8D%AE%E8%A1%A8%E5%AD%97%E6%AE%B5%E5%80%BC%E4%B8%BA%E7%A9%BA%E7%9A%84%E5%A4%84%E7%90%86_1.png) +
\ No newline at end of file diff --git a/doc/images/chrome_nosafe.png b/doc/images/chrome_nosafe.png new file mode 100644 index 00000000..2d51a1ac Binary files /dev/null and b/doc/images/chrome_nosafe.png differ diff --git a/doc/images/java端口冲突.png b/doc/images/java端口冲突.png new file mode 100644 index 00000000..78b5bfb8 Binary files /dev/null and b/doc/images/java端口冲突.png differ diff --git a/doc/images/plugins_vue.png b/doc/images/plugins_vue.png new file mode 100644 index 00000000..af0c269d Binary files /dev/null and b/doc/images/plugins_vue.png differ diff --git a/doc/images/springboot_1.png b/doc/images/springboot_1.png new file mode 100644 index 00000000..1e8150c7 Binary files /dev/null and b/doc/images/springboot_1.png differ diff --git a/doc/images/springboot_2.png b/doc/images/springboot_2.png new file mode 100644 index 00000000..a68514e8 Binary files /dev/null and b/doc/images/springboot_2.png differ diff --git a/doc/images/springboot_3.png b/doc/images/springboot_3.png new file mode 100644 index 00000000..5418c279 Binary files /dev/null and b/doc/images/springboot_3.png differ diff --git a/doc/images/springboot_4.png b/doc/images/springboot_4.png new file mode 100644 index 00000000..c5f041dd Binary files /dev/null and b/doc/images/springboot_4.png differ diff --git a/doc/images/springboot_5.png b/doc/images/springboot_5.png new file mode 100644 index 00000000..1467ab61 Binary files /dev/null and b/doc/images/springboot_5.png differ diff --git a/doc/images/springboot_6.png b/doc/images/springboot_6.png new file mode 100644 index 00000000..cc778131 Binary files /dev/null and b/doc/images/springboot_6.png differ diff --git a/doc/images/springboot_7.png b/doc/images/springboot_7.png new file mode 100644 index 00000000..4cf9ed6e Binary files /dev/null and b/doc/images/springboot_7.png differ diff --git a/doc/images/springboot_8.png b/doc/images/springboot_8.png new file mode 100644 index 00000000..eb021ceb Binary files /dev/null and b/doc/images/springboot_8.png differ diff --git a/doc/images/springboot_9.png b/doc/images/springboot_9.png new file mode 100644 index 00000000..7b54b58d Binary files /dev/null and b/doc/images/springboot_9.png differ diff --git a/doc/images/vue工程配置.png b/doc/images/vue工程配置.png new file mode 100644 index 00000000..29727b56 Binary files /dev/null and b/doc/images/vue工程配置.png differ diff --git a/doc/images/vue运行成功.png b/doc/images/vue运行成功.png new file mode 100644 index 00000000..baf36a22 Binary files /dev/null and b/doc/images/vue运行成功.png differ diff --git a/doc/images/数据表字段值为空的处理_1.png b/doc/images/数据表字段值为空的处理_1.png new file mode 100644 index 00000000..9da98f27 Binary files /dev/null and b/doc/images/数据表字段值为空的处理_1.png differ diff --git a/doc/images/机房要处理的操作_1.jpg b/doc/images/机房要处理的操作_1.jpg new file mode 100644 index 00000000..083a1935 Binary files /dev/null and b/doc/images/机房要处理的操作_1.jpg differ