同步操作将从 user_499098/oa-front-service 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
基于 Ant Design of Vue 开发的OA办公系统
Vue 开发的OA系统
Wiki文档:https://gitee.com/yunwisdoms/oa-front-service/wikis/OA%20System%20介绍
docker run -p 3306:3306 --name oa-mysql-service -v $PWD/conf/my.cnf:/etc/mysql/my.cnf -v $PWD/logs:/logs -v $PWD/data:/mysql_data -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
启动前请先准备数据库配置文件,my.cnf里面注意配置数据库大小写不明感,否则后端服务可能启动报错,数据库启动后请使用初始化脚本导入数据库即可。
最新数据库脚本地址:https://cdn.jsdelivr.net/gh/Miazzy/jeecg-database@lastest//2020-04-26-jeecg.sql.gz
。导入前先建数据库默认名称 jeecg
, 数据库脚本请用vim打开,否则乱码,然后:w xxx.sql
进行另存为SQL
数据库建表语句 CREATE DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
可以把字符集换成 utf8mb4
如果事先未准备配置文件,则直接启动 docker run -p 3306:3306 --name oa-mysql-service -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
然后手动到/etc/mysql/my.cnf修改配置即可,执行命令 vim /etc/mysql/mysql.conf.d/mysqld.cnf
, 配置文件里面添加一行 lower_case_table_names=1
注:
docker run -d -p 3306:3306 yunwisdom/oa-mysql-service
这个是预装后sql的docker容器
docker run --name oa-api-service -p 8082:8080 docker.io/yunwisdom/oa-api-service
[默认启动后连接的远程数据库地址,请启动后,进入find / -name application-dev.yml 里面修改mysql连接地址 redis连接地址]
输入以上命令,即可快速启动后端项目,访问地址 http://10.8.0.1:8082/jeecg-boot/
可以看见接口文档信息,即启动无误,启动无误后,请修改容器里面tomcat/webapps/.../application-dev.yml里面的数据库连接地址为你本地数据库连接地址
docker run --name oa-vue-service -p 8080:80 -p 8443:443 docker.io/yunwisdom/oa-vue-service
[默认启动后可以登录,但是请修改docker容器里面的/etc/nginx/nginx.conf里面配置,里面的服务连接的远程后端服务,改成本地后端服务的ip地址即可,重启nginx即可]
输入以上命令,即可快速启动前端项目,访问地址:http://127.0.0.1:8080
账户:zhaoziyu/Miazzy@163.com$
,如果端口占用,切换其他端口即可。
docker run -d --name oa-xmysql-service -p 3000:80 -e DATABASE_HOST=mysql_host -e DATABASE_USER=root -e DATABASE_PASSWORD=password -e DATABASE_NAME=sys markuman/xmysql:0.4.2
输入以上命令,即可快速启动RestAPI服务,访问 http://127.0.0.1:3000/_health
,如果看见如下信息:{"process_uptime":735.626,"mysql_uptime":"1691940"}
即启动成功,注意:数据库地址、账户、密码、数据库名请修改为本地数据库信息
docker run -d --name oa-fileview-service -p 30001:8012 --restart always docker.io/yunwisdom/oa-fileview-service
输入以上命令,即可快速启动文档预览服务,访问http://127.0.0.1:30001
,可以上传文档进行预览,关于文档预览服务更多信息,请搜索kkfileview
docker run -d -p 4999:80 --restart=always --name oa-showdoc-service yunwisdom/oa-showdoc-service
输入以上命令,即可快速启动showdoc文档服务,访问https://showdoc.shengtai.club/web/#/user/login
, 可以编辑文档进行预览类似雀语,第一次请默认创建公司账户admin/admin,后续会自动登录此账户,因为这个文档服务,主要是用于展示OA系统的规章制度,共享资料的,只需要一个账户就行了,关于文档预览服务更多信息,请搜索showdoc
注意:由于码云仓库最大只支持5G空间,现在容量不足,已经无法提交,故最新代码提交至github仓库,目前由于开发文档、部署文档尚未编写,在后续将抽空编写
## 使用PM2启动xmysql服务
pm2 start xmysql -h yourmysqlurl.mysql.rds.aliyuncs.com -u username -p password -d jeecg --watch -i 1
docker run --name docker-nginx -p 80:80 -p 8080:80 -p 443:443 -p 8443:443 nginx
(未安装docker不影响哈,自行在linux上部署nginx即可 ,然后把 打包后的前端目录放入Nginx对应的目录中,修改Nginx配置,在下文中列出了一个线上版本的Nginx配置文件)git clone https://gitee.com/yunwisdoms/oa-front-service.git .
yarn install
yarn run serve
yarn run build
yarn run lint
项目使用的 vue-cli3, 请更新您的 cli
关闭 Eslint (不推荐) 移除 package.json
中 eslintConfig
整个节点代码
修改 Ant Design 配色,在文件 vue.config.js
中,其他 less 变量覆盖参考 ant design
官方说明
css: {
loaderOptions: {
less: {
modifyVars: {
/* less 变量覆盖,用于自定义 ant design 主题 */
'primary-color': '#F5222D',
'link-color': '#F5222D',
'border-radius-base': '4px',
},
javascriptEnabled: true,
}
}
}
首页,含有我的待办,我的已办,行政公告,红头文件,新闻资讯,市场观察等内容,提交审批后,待处理人会收到我的待办消息,点击进入我的审批详情进行审批操作
其他待补充...
@vue/cli 升级后,eslint 规则更新了。由于影响到全部 .vue 文件,需要逐个验证。既暂时关闭部分原本不验证的规则,后期维护时,在逐步修正这些 rules
load_module modules/ngx_http_image_filter_module.so;
user root;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
client_max_body_size 200m;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
proxy_cache_path ./web_cache levels=1:2 keys_zone=web_cache:1024m inactive=1m max_size=1g;
upstream cwbase {
server 172.18.231.224:3000 weight=10 max_fails=3 fail_timeout=30s;
}
upstream xmysql {
server 172.18.231.224:3000 weight=10 max_fails=3 fail_timeout=30s;
}
upstream fileview {
#server 172.18.231.224:30000 weight=10 max_fails=3 fail_timeout=30;
server 172.18.231.224:30001 weight=10 max_fails=3 fail_timeout=30;
server 172.18.231.224:30002 weight=10 max_fails=3 fail_timeout=30;
}
upstream jeecg-api {
#server 172.18.231.224:8080 weight=10 max_fails=3 fail_timeout=30;
server 172.18.231.224:8082 weight=10 max_fails=3 fail_timeout=30;
#server 172.18.201.235:10000 weight=10 max_fails=3 fail_timeout=30;
#server 172.18.201.235:10002 weight=10 max_fails=3 fail_timeout=30;
}
server {
listen 80;
listen 443 ssl;
server_name www.shengtai.club;
ssl_certificate /cert/www.shengtai.club.pem;
ssl_certificate_key /cert/www.shengtai.club.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
root /usr/share/nginx/html;
gzip on;
gzip_min_length 1k;
gzip_comp_level 1;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
gzip_buffers 32 4k;
gzip_http_version 1.0;
location ^~ /api {
rewrite ^/(.*) /$1 break;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://cwbase/;
}
location ^~ /jeecg-boot {
proxy_pass http://jeecg-api/jeecg-boot/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_read_timeout 1800s;
}
location ^~ /sys/ {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://jeecg-api/jeecg-boot/sys/;
}
location ^~ /jeecg-boot/sys/common/view {
alias /root/jeecg/upFiles/;
index index.html index.htm;
}
location ^~ /files {
root /root/jeecg/upFiles/;
index index.html index.htm;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
#add_header Cache-Control "no-cache, no-store";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
proxy_cache web_cache;
proxy_cache_valid 200 206 304 301 302 10d;
proxy_cache_key $scheme$host$request_uri;
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_read_timeout 1800s;
gzip_static on;
expires 30d;
}
}
#配置文档预览
server {
listen 80;
listen 443 ssl;
server_name fileview.shengtai.club;
index index.html index.htm;
ssl_certificate /cert/fileview.shengtai.club.pem;
ssl_certificate_key /cert/fileview.shengtai.club.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
add_header Cache-Control no-cache;
proxy_pass http://fileview/;
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_read_timeout 1800s;
proxy_set_header Host fileview.shengtai.club;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
#配置API服务
server {
listen 80;
listen 443 ssl;
server_name api.shengtai.club;
ssl_certificate /cert/api.shengtai.club.pem;
ssl_certificate_key /cert/api.shengtai.club.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
root /workspace/oa-front-system;
gzip on;
gzip_min_length 1k;
gzip_comp_level 1;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
gzip_buffers 32 4k;
gzip_http_version 1.0;
location ^~ /api {
rewrite ^/(.*) /$1 break;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://cwbase/;
}
}
}
此处通过pm2 运行了“四个服务”,分别如下:
1). app , 全路径:/root/music-api-serivce/app.js, 为音乐频道的服务后端
2). app , 全路径:/root/wallpaper-api-service/node-spider-api/app.js, 为壁纸频道的服务后端
3). tank, 全路径:/root/tank/tank, 为网盘系统的服务后端
4). xmysql, 全路径:/root/xmysql/xmysql.sh, 为MySQL-Rest-API的服务后端
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。