Emos是一个前后端分离的在线办公系统,项目采用 SpringBoot+Uniapp 开发,项目加入常见的企业级应用所涉及到的技术点,例如 Redis、RabbitMQ 等。前端使用Uniapp开发微信小程序,员工可以在微信中通过小程序登录,实现在线办公。
1. SpringBoot
2. Shiro
3. MyBatis
4. MySQL
5. Redis
6. RabbitMQ
7. MongoDB
8. JWT
9. 腾讯云API(人脸识别 对象存储)
10. ...
1. Uniapp
2. 微信小程序
3. ...
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
1.去下载MySQL 的安装包,点击安装
"name": "mysql",
"port": 3306,
"user_name": "root",
"pwd": "安装时候设置的密码"
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb/brew/mongodb-community
mongo
use admin
db.createUser({
user:"xxx",
pwd:"xxx",
roles:[{
role:"xxx",
db:"xxx"
}]
})
brew install redis
/usr/local/Cellar/redis/6.2.1
/usr/local/etc/redis.conf
打开redis.conf文件,搜索 "requirepass" ,修改密码
redis-server
brew services start redis
brew install rabbitmq
rabbitmq-server
/usr/local/Cellar/rabbitmq/3.8.14/sbin/rabbitmq-server
brew services start rabbitmq
"name": "rabbitmq",
"url":"http://localhost:15672",
"port": 15672,
"user_name": "guest",
"pwd": "guest"
1.下载需要的 maven 压缩包,解压进入目录
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
Maven home directory: maven目录
User settings file: maven中conf/setting.xml的位置,勾选Override
Local repository: 自定义repository文件夹位置,勾选Override
Lombok 主要用于生成SET/GET方法
Free MyBatis plugin 主要用于生成MyBatis相关映射文件
1.下载微信开发者工具
下载HBuilder
yum install docker -y
vim /ect/docker/daemon.json
{
"registry-mirrors": ["https://mirror.ccs.tencentyun.com"]
}
service start docker
docker pull mysql:8.0.22
docker run -it -d --name mysql --net=host -m 500m -v /root/mysql/data:/var/lib/mysql -v /root/mysql/config:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=xxx -e TZ=Asia/Shanghai mysql:8.0.22
brew pull mongo
mkdir -p /root/mongo
vim /root/mongo/mongod.conf
net:
port: 27017
bindIp: "0.0.0.0"
storage:
dbPath: "/data/db"
security:
authorization: enabled
docker run -it -d --name mongo --net=host -v /root/mongo:/etc/mongo -m 500m -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=xxx mongo --config /etc/mongo/mongod.conf
brew pull redis:6.0.10
mkdir -p /root/redis/conf/
vim mkdir -p /root/redis/conf/redis.conf
bind 0.0.0.0
protected-mode yes
port 6379
tcp-backlog 511
timeout 0 6. tcp-keepalive 0 7. loglevel notice
logfile ""
databases 4
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
requirepass xxx
docker run -it -d --name redis -m 300m --net=host -v /root/redis/conf:/usr/local/etc/redis redis:6.0.10 redis-server /usr/local/etc/redis/redis.conf
brew pull rabbitmq
docker run -it -d --name mq -m 300m --net=host rabbitmq
去 https://hub.docker.com/_/openjdk?tab=tags 选择与开发环境对应的jdk版本进行安装
docker pull oopenjdk:11.0.9.1-oraclelinux7
#创建新的镜像引用
docker tag openjdk:11.0.9.1-oraclelinux7 jdk11
#删除原有镜像引用
docker rmi openjdk:11.0.9.1-oraclelinux7
点击右侧 Maven 面板中 Lifecycle-Install 进行打包,生成的jar包位置在 target 文件夹下,将jar文件重命名为 emos-wx-api.jar
scp emos-wx-api.jar name@ip:/root/emos/
nohup java -jar emos-wx-api.jar >> out.log 2>&1 &
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7- 0.el7.ngx.noarch.rpm
#执行安装
yum install nginx -y
#启动Nginx
service nginx start
1_域名_bundle.crt
2_域名_key
scp 1_域名_bundle.crt name@ip:/etc/nginx
scp 2_域名_key name@ip:/etc/nginx
vim /etc/nginx/nginx.conf
server {
#SSL 访问端口号为 443
listen 443 ssl;
#填写绑定证书的域名
server_name 域名;
#证书文件名称
ssl_certificate 1_域名.crt;
#私钥文件名称
ssl_certificate_key 2_域名.key;
ssl_session_timeout 5m;
#请按照以下协议配置
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
root /home ;
location / {
root /home;
index index.html index.htm;
}
location /emos-wx-api {
proxy_pass http://localhost:端口号/emos-wx-api;
}
}
service nginx start