已重命名1个文件
已添加8个文件
已修改24个文件
已删除5个文件
| | |
| | | /logs |
| | | *.jar |
| | | /docker-compose/nginx/html |
| | | /docker-compose/mysql/data |
¶Ô±ÈÐÂÎļþ |
| | |
| | | version : '3.8' |
| | | services: |
| | | # mysql |
| | | se-mysql: |
| | | image: mysql:5.7 |
| | | ports: |
| | | - 3307:3306 |
| | | volumes: |
| | | - ./mysql/logs:/logs |
| | | - ./mysql/data:/var/lib/mysql |
| | | - ./mysql/conf:/etc/mysql/conf.d |
| | | - ./mysql/initdb:/docker-entrypoint-initdb.d |
| | | command: [ |
| | | 'mysqld', |
| | | '--innodb-buffer-pool-size=80M', |
| | | '--character-set-server=utf8mb4', |
| | | '--collation-server=utf8mb4_unicode_ci', |
| | | '--default-time-zone=+8:00', |
| | | '--lower-case-table-names=1' |
| | | ] |
| | | environment: |
| | | TZ: Asia/Shanghai |
| | | MYSQL_DATABASE: 'se-cloud' |
| | | MYSQL_ROOT_PASSWORD: My_Sql_s!E_v5.7 |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # nacos |
| | | se-nacos: |
| | | image: nacos/nacos-server:v2.4.1 |
| | | environment: |
| | | MODE: standalone |
| | | TZ: Asia/Shanghai |
| | | volumes: |
| | | - ./nacos/logs/:/home/nacos/logs |
| | | - ./nacos/conf/application.properties:/home/nacos/conf/application.properties |
| | | ports: |
| | | - 8848:8848 |
| | | - 9848:9848 |
| | | - 9849:9849 |
| | | depends_on: |
| | | - se-mysql |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # redis,Redis_s!E_6.2.6 |
| | | se-redis: |
| | | image: redis:latest |
| | | ports: |
| | | - 6379:6379 |
| | | volumes: |
| | | - ./redis/data/redis.conf:/data/redis.conf |
| | | - ./redis/data:/data |
| | | command: redis-server /data/redis.conf |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # networks |
| | | networks: |
| | | network-se: |
| | | driver: bridge |
| | |
| | | TZ: Asia/Shanghai |
| | | MYSQL_DATABASE: 'se-cloud' |
| | | MYSQL_ROOT_PASSWORD: My_Sql_s!E_v5.7 |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # nacos |
| | | se-nacos: |
| | |
| | | - 9849:9849 |
| | | depends_on: |
| | | - se-mysql |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # redis |
| | | # redis,Redis_s!E_6.2.6 |
| | | se-redis: |
| | | image: redis:latest |
| | | ports: |
| | |
| | | - ./redis/data/redis.conf:/data/redis.conf |
| | | - ./redis/data:/data |
| | | command: redis-server /data/redis.conf |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # gateway |
| | | se-gateway: |
| | |
| | | links: |
| | | - se-redis |
| | | - se-nacos |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # auth |
| | | se-auth: |
| | |
| | | depends_on: |
| | | - se-redis |
| | | - se-nacos |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # system |
| | | se-system: |
| | |
| | | - se-redis |
| | | - se-nacos |
| | | - se-mysql |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # nginx |
| | | se-nginx: |
| | |
| | | - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf |
| | | depends_on: |
| | | - se-gateway |
| | | networks: |
| | | - network-se |
| | | restart: always |
| | | # networks |
| | | networks: |
| | | network-se: |
| | | driver: bridge |
| | |
| | | user_name varchar(30) not null comment 'ç¨æ·è´¦å·', |
| | | nick_name varchar(30) not null comment 'ç¨æ·æµç§°', |
| | | user_type varchar(2) default '00' comment 'ç¨æ·ç±»åï¼00ç³»ç»ç¨æ·ï¼', |
| | | secret_level varchar(2) default '1' comment 'å¯çº§ç±»å', |
| | | email varchar(50) default '' comment 'ç¨æ·é®ç®±', |
| | | phonenumber varchar(11) default '' comment 'ææºå·ç ', |
| | | sex char(1) default '0' comment 'ç¨æ·æ§å«ï¼0ç· 1女 2æªç¥ï¼', |
| | |
| | | -- ---------------------------- |
| | | -- åå§å-ç¨æ·ä¿¡æ¯è¡¨æ°æ® |
| | | -- ---------------------------- |
| | | insert into sys_user values(1, 103, 'admin', '', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管çå'); |
| | | insert into sys_user values(2, 105, 'ry', '', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, 'æµè¯å'); |
| | | |
| | | insert into sys_user values(1, 103, 'admin', '', '00', '1', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管çå'); |
| | | insert into sys_user values(2, 105, 'ry', '', '00', '1', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, 'æµè¯å'); |
| | | -- select * from sys_user; |
| | | |
| | | -- ---------------------------- |
| | | -- 3ãå²ä½ä¿¡æ¯è¡¨ |
| | |
| | | update_time datetime comment 'æ´æ°æ¶é´', |
| | | remark varchar(500) default null comment '夿³¨', |
| | | primary key (role_id) |
| | | ) engine=innodb auto_increment=3 comment = 'è§è²ä¿¡æ¯è¡¨'; |
| | | ) engine=innodb auto_increment=6 comment = 'è§è²ä¿¡æ¯è¡¨'; |
| | | |
| | | -- ---------------------------- |
| | | -- åå§å-è§è²ä¿¡æ¯è¡¨æ°æ® |
| | | -- ---------------------------- |
| | | insert into sys_role values('1', 'è¶
级管çå', 'admin', 1, 1, 1, 1, '0', '0', 'admin', sysdate(), '', null, 'è¶
级管çå'); |
| | | insert into sys_role values('2', 'æ®éè§è²', 'common', 2, 2, 1, 1, '0', '0', 'admin', sysdate(), '', null, 'æ®éè§è²'); |
| | | |
| | | insert into sys_role values('1', 'ç³»ç»ç®¡çå', 'admin', 1, 1, 1, 1, '0', '0', 'admin', sysdate(), '', null, 'ç³»ç»ç®¡çå'); |
| | | insert into sys_role values('2', 'è¶
çº§ç¨æ·', 'superuser', 2, 2, 1, 1, '0', '0', 'admin', sysdate(), '', null, 'è¶
çº§ç¨æ·'); |
| | | insert into sys_role values('3', 'æ®éç¨æ·', 'common', 3, 4, 1, 1, '0', '0', 'admin', sysdate(), '', null, 'æ®éç¨æ·'); |
| | | insert into sys_role values('4', 'åéç¨æ·', 'limited', 4, 4, 1, 1, '0', '0', 'admin', sysdate(), '', null, 'åéç¨æ·'); |
| | | insert into sys_role values('5', 'åªè¯»ç¨æ·', 'readonly', 5, 4, 1, 1, '0', '0', 'admin', sysdate(), '', null, 'åªè¯»ç¨æ·'); |
| | | -- select * from sys_role; |
| | | |
| | | -- ---------------------------- |
| | | -- 5ãèåæé表 |
| | |
| | | -- ---------------------------- |
| | | -- ä¸çº§èå |
| | | insert into sys_menu values('1', 'ç³»ç»ç®¡ç', '0', '1', 'system', null, '', '', 1, 0, 'M', '0', '0', '', 'system', 'admin', sysdate(), '', null, 'ç³»ç»ç®¡çç®å½'); |
| | | insert into sys_menu values('2', 'ç³»ç»çæ§', '0', '2', 'monitor', null, '', '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', sysdate(), '', null, 'ç³»ç»çæ§ç®å½'); |
| | | insert into sys_menu values('3', 'ç³»ç»å·¥å
·', '0', '3', 'tool', null, '', '', 1, 0, 'M', '0', '0', '', 'tool', 'admin', sysdate(), '', null, 'ç³»ç»å·¥å
·ç®å½'); |
| | | insert into sys_menu values('4', 'å®ç½', '0', '4', 'http://se.vip', null, '', '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, 'å®ç½å°å'); |
| | | -- insert into sys_menu values('2', 'ç³»ç»çæ§', '0', '2', 'monitor', null, '', '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', sysdate(), '', null, 'ç³»ç»çæ§ç®å½'); |
| | | -- insert into sys_menu values('3', 'ç³»ç»å·¥å
·', '0', '3', 'tool', null, '', '', 1, 0, 'M', '0', '0', '', 'tool', 'admin', sysdate(), '', null, 'ç³»ç»å·¥å
·ç®å½'); |
| | | -- insert into sys_menu values('4', 'å®ç½', '0', '4', 'http://se.vip', null, '', '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, 'å®ç½å°å'); |
| | | -- äºçº§èå |
| | | insert into sys_menu values('100', 'ç¨æ·ç®¡ç', '1', '1', 'user', 'system/user/index', '', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', sysdate(), '', null, 'ç¨æ·ç®¡çèå'); |
| | | insert into sys_menu values('101', 'è§è²ç®¡ç', '1', '2', 'role', 'system/role/index', '', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', sysdate(), '', null, 'è§è²ç®¡çèå'); |
| | |
| | | insert into sys_menu values('103', 'é¨é¨ç®¡ç', '1', '4', 'dept', 'system/dept/index', '', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', sysdate(), '', null, 'é¨é¨ç®¡çèå'); |
| | | insert into sys_menu values('104', 'å²ä½ç®¡ç', '1', '5', 'post', 'system/post/index', '', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', sysdate(), '', null, 'å²ä½ç®¡çèå'); |
| | | insert into sys_menu values('105', 'åå
¸ç®¡ç', '1', '6', 'dict', 'system/dict/index', '', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', sysdate(), '', null, 'åå
¸ç®¡çèå'); |
| | | insert into sys_menu values('106', 'åæ°è®¾ç½®', '1', '7', 'config', 'system/config/index', '', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', sysdate(), '', null, 'åæ°è®¾ç½®èå'); |
| | | insert into sys_menu values('107', 'éç¥å
¬å', '1', '8', 'notice', 'system/notice/index', '', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', sysdate(), '', null, 'éç¥å
¬åèå'); |
| | | -- insert into sys_menu values('106', 'åæ°è®¾ç½®', '1', '7', 'config', 'system/config/index', '', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', sysdate(), '', null, 'åæ°è®¾ç½®èå'); |
| | | -- insert into sys_menu values('107', 'éç¥å
¬å', '1', '8', 'notice', 'system/notice/index', '', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', sysdate(), '', null, 'éç¥å
¬åèå'); |
| | | insert into sys_menu values('108', 'æ¥å¿ç®¡ç', '1', '9', 'log', '', '', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', sysdate(), '', null, 'æ¥å¿ç®¡çèå'); |
| | | insert into sys_menu values('109', 'å¨çº¿ç¨æ·', '2', '1', 'online', 'monitor/online/index', '', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', sysdate(), '', null, 'å¨çº¿ç¨æ·èå'); |
| | | insert into sys_menu values('110', '宿¶ä»»å¡', '2', '2', 'job', 'monitor/job/index', '', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', sysdate(), '', null, '宿¶ä»»å¡èå'); |
| | | insert into sys_menu values('111', 'Sentinelæ§å¶å°', '2', '3', 'http://localhost:8718', '', '', '', 0, 0, 'C', '0', '0', 'monitor:sentinel:list', 'sentinel', 'admin', sysdate(), '', null, 'æµéæ§å¶èå'); |
| | | insert into sys_menu values('112', 'Nacosæ§å¶å°', '2', '4', 'http://localhost:8848/nacos', '', '', '', 0, 0, 'C', '0', '0', 'monitor:nacos:list', 'nacos', 'admin', sysdate(), '', null, 'æå¡æ²»çèå'); |
| | | insert into sys_menu values('113', 'Adminæ§å¶å°', '2', '5', 'http://localhost:9100/login', '', '', '', 0, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', sysdate(), '', null, 'æå¡çæ§èå'); |
| | | insert into sys_menu values('114', '表åæå»º', '3', '1', 'build', 'tool/build/index', '', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表åæå»ºèå'); |
| | | insert into sys_menu values('115', '代ç çæ', '3', '2', 'gen', 'tool/gen/index', '', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代ç çæèå'); |
| | | insert into sys_menu values('116', 'ç³»ç»æ¥å£', '3', '3', 'http://localhost:8080/swagger-ui/index.html', '', '', '', 0, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', sysdate(), '', null, 'ç³»ç»æ¥å£èå'); |
| | | -- insert into sys_menu values('109', 'å¨çº¿ç¨æ·', '2', '1', 'online', 'monitor/online/index', '', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', sysdate(), '', null, 'å¨çº¿ç¨æ·èå'); |
| | | -- insert into sys_menu values('110', '宿¶ä»»å¡', '2', '2', 'job', 'monitor/job/index', '', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', sysdate(), '', null, '宿¶ä»»å¡èå'); |
| | | -- insert into sys_menu values('111', 'Sentinelæ§å¶å°', '2', '3', 'http://localhost:8718', '', '', '', 0, 0, 'C', '0', '0', 'monitor:sentinel:list', 'sentinel', 'admin', sysdate(), '', null, 'æµéæ§å¶èå'); |
| | | -- insert into sys_menu values('112', 'Nacosæ§å¶å°', '2', '4', 'http://localhost:8848/nacos', '', '', '', 0, 0, 'C', '0', '0', 'monitor:nacos:list', 'nacos', 'admin', sysdate(), '', null, 'æå¡æ²»çèå'); |
| | | -- insert into sys_menu values('113', 'Adminæ§å¶å°', '2', '5', 'http://localhost:9100/login', '', '', '', 0, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', sysdate(), '', null, 'æå¡çæ§èå'); |
| | | -- insert into sys_menu values('114', '表åæå»º', '3', '1', 'build', 'tool/build/index', '', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表åæå»ºèå'); |
| | | -- insert into sys_menu values('115', '代ç çæ', '3', '2', 'gen', 'tool/gen/index', '', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代ç çæèå'); |
| | | -- insert into sys_menu values('116', 'ç³»ç»æ¥å£', '3', '3', 'http://localhost:8080/swagger-ui/index.html', '', '', '', 0, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', sysdate(), '', null, 'ç³»ç»æ¥å£èå'); |
| | | -- ä¸çº§èå |
| | | insert into sys_menu values('500', 'æä½æ¥å¿', '108', '1', 'operlog', 'system/operlog/index', '', '', 1, 0, 'C', '0', '0', 'system:operlog:list', 'form', 'admin', sysdate(), '', null, 'æä½æ¥å¿èå'); |
| | | insert into sys_menu values('501', 'ç»å½æ¥å¿', '108', '2', 'logininfor', 'system/logininfor/index', '', '', 1, 0, 'C', '0', '0', 'system:logininfor:list', 'logininfor', 'admin', sysdate(), '', null, 'ç»å½æ¥å¿èå'); |
| | |
| | | insert into sys_menu values('1028', 'åå
¸å é¤', '105', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1029', 'åå
¸å¯¼åº', '105', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', sysdate(), '', null, ''); |
| | | -- åæ°è®¾ç½®æé® |
| | | insert into sys_menu values('1030', 'åæ°æ¥è¯¢', '106', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1031', 'åæ°æ°å¢', '106', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1032', 'åæ°ä¿®æ¹', '106', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1033', 'åæ°å é¤', '106', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1034', '忰坼åº', '106', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1030', 'åæ°æ¥è¯¢', '106', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1031', 'åæ°æ°å¢', '106', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1032', 'åæ°ä¿®æ¹', '106', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1033', 'åæ°å é¤', '106', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1034', '忰坼åº', '106', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', sysdate(), '', null, ''); |
| | | -- éç¥å
¬åæé® |
| | | insert into sys_menu values('1035', 'å
¬åæ¥è¯¢', '107', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1036', 'å
¬åæ°å¢', '107', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1037', 'å
¬åä¿®æ¹', '107', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1038', 'å
¬åå é¤', '107', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1035', 'å
¬åæ¥è¯¢', '107', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1036', 'å
¬åæ°å¢', '107', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1037', 'å
¬åä¿®æ¹', '107', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1038', 'å
¬åå é¤', '107', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | -- æä½æ¥å¿æé® |
| | | insert into sys_menu values('1039', 'æä½æ¥è¯¢', '500', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:operlog:query', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1040', 'æä½å é¤', '500', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:operlog:remove', '#', 'admin', sysdate(), '', null, ''); |
| | |
| | | insert into sys_menu values('1044', 'æ¥å¿å¯¼åº', '501', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:export', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1045', 'è´¦æ·è§£é', '501', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:unlock', '#', 'admin', sysdate(), '', null, ''); |
| | | -- å¨çº¿ç¨æ·æé® |
| | | insert into sys_menu values('1046', 'å¨çº¿æ¥è¯¢', '109', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1047', 'æ¹é强é', '109', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1048', 'åæ¡å¼ºé', '109', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1046', 'å¨çº¿æ¥è¯¢', '109', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1047', 'æ¹é强é', '109', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1048', 'åæ¡å¼ºé', '109', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, ''); |
| | | -- 宿¶ä»»å¡æé® |
| | | insert into sys_menu values('1049', '任塿¥è¯¢', '110', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1050', '任塿°å¢', '110', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1051', 'ä»»å¡ä¿®æ¹', '110', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1052', 'ä»»å¡å é¤', '110', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1053', 'ç¶æä¿®æ¹', '110', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1054', 'ä»»å¡å¯¼åº', '110', '6', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1049', '任塿¥è¯¢', '110', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1050', '任塿°å¢', '110', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1051', 'ä»»å¡ä¿®æ¹', '110', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1052', 'ä»»å¡å é¤', '110', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1053', 'ç¶æä¿®æ¹', '110', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1054', 'ä»»å¡å¯¼åº', '110', '6', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', sysdate(), '', null, ''); |
| | | -- 代ç çææé® |
| | | insert into sys_menu values('1055', 'çææ¥è¯¢', '115', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1056', 'çæä¿®æ¹', '115', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1057', 'çæå é¤', '115', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1058', '导å
¥ä»£ç ', '115', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1059', 'é¢è§ä»£ç ', '115', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1060', 'çæä»£ç ', '115', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1055', 'çææ¥è¯¢', '115', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1056', 'çæä¿®æ¹', '115', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1057', 'çæå é¤', '115', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1058', '导å
¥ä»£ç ', '115', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1059', 'é¢è§ä»£ç ', '115', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate(), '', null, ''); |
| | | -- insert into sys_menu values('1060', 'çæä»£ç ', '115', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | |
| | | -- ---------------------------- |
| | |
| | | -- åå§å-è§è²åèåå
³èè¡¨æ°æ® |
| | | -- ---------------------------- |
| | | insert into sys_role_menu values ('2', '1'); |
| | | insert into sys_role_menu values ('2', '2'); |
| | | insert into sys_role_menu values ('2', '3'); |
| | | insert into sys_role_menu values ('2', '4'); |
| | | -- insert into sys_role_menu values ('2', '2'); |
| | | -- insert into sys_role_menu values ('2', '3'); |
| | | -- insert into sys_role_menu values ('2', '4'); |
| | | insert into sys_role_menu values ('2', '100'); |
| | | insert into sys_role_menu values ('2', '101'); |
| | | insert into sys_role_menu values ('2', '102'); |
| | | insert into sys_role_menu values ('2', '103'); |
| | | insert into sys_role_menu values ('2', '104'); |
| | | insert into sys_role_menu values ('2', '105'); |
| | | insert into sys_role_menu values ('2', '106'); |
| | | insert into sys_role_menu values ('2', '107'); |
| | | -- insert into sys_role_menu values ('2', '106'); |
| | | -- insert into sys_role_menu values ('2', '107'); |
| | | insert into sys_role_menu values ('2', '108'); |
| | | insert into sys_role_menu values ('2', '109'); |
| | | insert into sys_role_menu values ('2', '110'); |
| | | insert into sys_role_menu values ('2', '111'); |
| | | insert into sys_role_menu values ('2', '112'); |
| | | insert into sys_role_menu values ('2', '113'); |
| | | insert into sys_role_menu values ('2', '114'); |
| | | insert into sys_role_menu values ('2', '115'); |
| | | insert into sys_role_menu values ('2', '116'); |
| | | -- insert into sys_role_menu values ('2', '109'); |
| | | -- insert into sys_role_menu values ('2', '110'); |
| | | -- insert into sys_role_menu values ('2', '111'); |
| | | -- insert into sys_role_menu values ('2', '112'); |
| | | -- insert into sys_role_menu values ('2', '113'); |
| | | -- insert into sys_role_menu values ('2', '114'); |
| | | -- insert into sys_role_menu values ('2', '115'); |
| | | -- insert into sys_role_menu values ('2', '116'); |
| | | insert into sys_role_menu values ('2', '500'); |
| | | insert into sys_role_menu values ('2', '501'); |
| | | insert into sys_role_menu values ('2', '1000'); |
| | |
| | | insert into sys_role_menu values ('2', '1027'); |
| | | insert into sys_role_menu values ('2', '1028'); |
| | | insert into sys_role_menu values ('2', '1029'); |
| | | insert into sys_role_menu values ('2', '1030'); |
| | | insert into sys_role_menu values ('2', '1031'); |
| | | insert into sys_role_menu values ('2', '1032'); |
| | | insert into sys_role_menu values ('2', '1033'); |
| | | insert into sys_role_menu values ('2', '1034'); |
| | | insert into sys_role_menu values ('2', '1035'); |
| | | insert into sys_role_menu values ('2', '1036'); |
| | | insert into sys_role_menu values ('2', '1037'); |
| | | insert into sys_role_menu values ('2', '1038'); |
| | | -- insert into sys_role_menu values ('2', '1030'); |
| | | -- insert into sys_role_menu values ('2', '1031'); |
| | | -- insert into sys_role_menu values ('2', '1032'); |
| | | -- insert into sys_role_menu values ('2', '1033'); |
| | | -- insert into sys_role_menu values ('2', '1034'); |
| | | -- insert into sys_role_menu values ('2', '1035'); |
| | | -- insert into sys_role_menu values ('2', '1036'); |
| | | -- insert into sys_role_menu values ('2', '1037'); |
| | | -- insert into sys_role_menu values ('2', '1038'); |
| | | insert into sys_role_menu values ('2', '1039'); |
| | | insert into sys_role_menu values ('2', '1040'); |
| | | insert into sys_role_menu values ('2', '1041'); |
| | |
| | | insert into sys_role_menu values ('2', '1043'); |
| | | insert into sys_role_menu values ('2', '1044'); |
| | | insert into sys_role_menu values ('2', '1045'); |
| | | insert into sys_role_menu values ('2', '1046'); |
| | | insert into sys_role_menu values ('2', '1047'); |
| | | insert into sys_role_menu values ('2', '1048'); |
| | | insert into sys_role_menu values ('2', '1049'); |
| | | insert into sys_role_menu values ('2', '1050'); |
| | | insert into sys_role_menu values ('2', '1051'); |
| | | insert into sys_role_menu values ('2', '1052'); |
| | | insert into sys_role_menu values ('2', '1053'); |
| | | insert into sys_role_menu values ('2', '1054'); |
| | | insert into sys_role_menu values ('2', '1055'); |
| | | insert into sys_role_menu values ('2', '1056'); |
| | | insert into sys_role_menu values ('2', '1057'); |
| | | insert into sys_role_menu values ('2', '1058'); |
| | | insert into sys_role_menu values ('2', '1059'); |
| | | insert into sys_role_menu values ('2', '1060'); |
| | | -- insert into sys_role_menu values ('2', '1046'); |
| | | -- insert into sys_role_menu values ('2', '1047'); |
| | | -- insert into sys_role_menu values ('2', '1048'); |
| | | -- insert into sys_role_menu values ('2', '1049'); |
| | | -- insert into sys_role_menu values ('2', '1050'); |
| | | -- insert into sys_role_menu values ('2', '1051'); |
| | | -- insert into sys_role_menu values ('2', '1052'); |
| | | -- insert into sys_role_menu values ('2', '1053'); |
| | | -- insert into sys_role_menu values ('2', '1054'); |
| | | -- insert into sys_role_menu values ('2', '1055'); |
| | | -- insert into sys_role_menu values ('2', '1056'); |
| | | -- insert into sys_role_menu values ('2', '1057'); |
| | | -- insert into sys_role_menu values ('2', '1058'); |
| | | -- insert into sys_role_menu values ('2', '1059'); |
| | | -- insert into sys_role_menu values ('2', '1060'); |
| | | |
| | | -- ---------------------------- |
| | | -- 8ãè§è²åé¨é¨å
³è表 è§è²1-Né¨é¨ |
| | |
| | | remark varchar(500) default null comment '夿³¨', |
| | | primary key (dict_id), |
| | | unique (dict_type) |
| | | ) engine=innodb auto_increment=11 comment = 'åå
¸ç±»å表'; |
| | | ) engine=innodb auto_increment=13 comment = 'åå
¸ç±»å表'; |
| | | |
| | | insert into sys_dict_type values(1, 'ç¨æ·æ§å«', 'sys_user_sex', '0', 'admin', sysdate(), '', null, 'ç¨æ·æ§å«å表'); |
| | | insert into sys_dict_type values(2, 'èåç¶æ', 'sys_show_hide', '0', 'admin', sysdate(), '', null, 'èåç¶æå表'); |
| | |
| | | insert into sys_dict_type values(8, 'éç¥ç¶æ', 'sys_notice_status', '0', 'admin', sysdate(), '', null, 'éç¥ç¶æå表'); |
| | | insert into sys_dict_type values(9, 'æä½ç±»å', 'sys_oper_type', '0', 'admin', sysdate(), '', null, 'æä½ç±»åå表'); |
| | | insert into sys_dict_type values(10, 'ç³»ç»ç¶æ', 'sys_common_status', '0', 'admin', sysdate(), '', null, 'ç»å½ç¶æå表'); |
| | | |
| | | insert into sys_dict_type values(11, 'å å¯ç±»å', 'sys_encryption_method','0', 'admin', sysdate(), '', null, 'å å¯ç±»åå表'); |
| | | insert into sys_dict_type values(12, 'å¯çº§ç±»å', 'sys_secret_level', '0', 'admin', sysdate(), '', null, 'å¯çº§ç±»åå表'); |
| | | -- select * from sys_dict_type; |
| | | |
| | | -- ---------------------------- |
| | | -- 12ãåå
¸æ°æ®è¡¨ |
| | |
| | | update_time datetime comment 'æ´æ°æ¶é´', |
| | | remark varchar(500) default null comment '夿³¨', |
| | | primary key (dict_code) |
| | | ) engine=innodb auto_increment=30 comment = 'åå
¸æ°æ®è¡¨'; |
| | | ) engine=innodb auto_increment=37 comment = 'åå
¸æ°æ®è¡¨'; |
| | | |
| | | insert into sys_dict_data values(1, 1, 'ç·', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', sysdate(), '', null, 'æ§å«ç·'); |
| | | insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', sysdate(), '', null, 'æ§å«å¥³'); |
| | |
| | | insert into sys_dict_data values(27, 9, 'æ¸
ç©ºæ°æ®', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, 'æ¸
空æä½'); |
| | | insert into sys_dict_data values(28, 1, 'æå', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, 'æ£å¸¸ç¶æ'); |
| | | insert into sys_dict_data values(29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, 'åç¨ç¶æ'); |
| | | |
| | | -- https://blog.csdn.net/weixin_56154577/article/details/136803617 |
| | | insert into sys_dict_data values(30, 1, 'AESå å¯', '1', 'sys_encryption_method', '', '', 'Y', '0', 'admin', sysdate(), '', null, 'AESå å¯ç®æ³'); |
| | | insert into sys_dict_data values(31, 2, 'DESå å¯', '2', 'sys_encryption_method', '', '', 'N', '0', 'admin', sysdate(), '', null, 'DESå å¯ç®æ³'); |
| | | insert into sys_dict_data values(32, 3, 'RSAå å¯', '3', 'sys_encryption_method', '', '', 'N', '0', 'admin', sysdate(), '', null, 'RSAå å¯ç®æ³'); |
| | | insert into sys_dict_data values(33, 1, 'å
¬å¼', '1', 'sys_secret_level', '', '', 'Y', '0', 'admin', sysdate(), '', null, 'å
¬å¼å¯çº§'); |
| | | insert into sys_dict_data values(34, 2, 'ä¸è¬', '2', 'sys_secret_level', '', '', 'N', '0', 'admin', sysdate(), '', null, 'ä¸è¬å¯çº§'); |
| | | insert into sys_dict_data values(35, 3, 'éè¦', '3', 'sys_secret_level', '', '', 'N', '0', 'admin', sysdate(), '', null, 'éè¦å¯çº§'); |
| | | insert into sys_dict_data values(36, 4, 'æ ¸å¿', '4', 'sys_secret_level', '', '', 'N', '0', 'admin', sysdate(), '', null, 'æ ¸å¿å¯çº§'); |
| | | -- select * from sys_dict_data; |
| | | |
| | | -- ---------------------------- |
| | | -- 13ãåæ°é
置表 |
| | |
| | | DROP DATABASE IF EXISTS `se-config`; |
| | | -- DROP DATABASE IF EXISTS `se-config`; |
| | | |
| | | CREATE DATABASE `se-config` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
| | | CREATE DATABASE IF NOT EXISTS `se-config` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
| | | |
| | | SET NAMES utf8mb4; |
| | | SET FOREIGN_KEY_CHECKS = 0; |
| | |
| | | |
| | | insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema, encrypted_data_key) values |
| | | (1,'application-dev.yml','DEFAULT_GROUP','spring:\n autoconfigure:\n exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure\n mvc:\n pathmatch:\n matching-strategy: ant_path_matcher\n\n# feign é
ç½®\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n min-request-size: 8192\n response:\n enabled: true\n\n# æ´é²çæ§ç«¯ç¹\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n','58dde4e3760499d3bac2d77a3a1e9018','2020-05-20 12:00:00','2023-12-04 08:08:23','nacos','0:0:0:0:0:0:0:1','','','éç¨é
ç½®','null','null','yaml','',''), |
| | | (2,'se-gateway-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: se-redis\n port: 6379\n password: Redis_s!E_6.2.6\n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认è¯ä¸å¿\n - id: se-auth\n uri: lb://se-auth\n predicates:\n - Path=/auth/**\n filters:\n # éªè¯ç å¤ç\n - CacheRequestFilter\n - ValidateCodeFilter\n - StripPrefix=1\n # 代ç çæ\n - id: se-gen\n uri: lb://se-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 宿¶ä»»å¡\n - id: se-job\n uri: lb://se-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # ç³»ç»æ¨¡å\n - id: se-system\n uri: lb://se-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # æä»¶æå¡\n - id: se-file\n uri: lb://se-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# å®å
¨é
ç½®\nsecurity:\n # éªè¯ç math,char\n captcha:\n enabled: false\n type: math\n # 鲿¢XSSæ»å»\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n # 䏿 ¡éªç½åå\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /csrf\n','57cec5abd0e0a6b77d853750344a9dc0','2020-05-14 14:17:55','2022-09-29 02:48:32','nacos','0:0:0:0:0:0:0:1','','','ç½å
³æ¨¡å','null','null','yaml','',''), |
| | | (2,'se-gateway-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: se-redis\n port: 6379\n password: Redis_s!E_6.2.6\n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认è¯ä¸å¿\n - id: se-auth\n uri: lb://se-auth\n predicates:\n - Path=/auth/**\n filters:\n # éªè¯ç å¤ç\n - CacheRequestFilter\n - ValidateCodeFilter\n - StripPrefix=1\n # 代ç çæ\n - id: se-gen\n uri: lb://se-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 宿¶ä»»å¡\n - id: se-job\n uri: lb://se-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # ç³»ç»æ¨¡å\n - id: se-system\n uri: lb://se-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # æä»¶æå¡\n - id: se-file\n uri: lb://se-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# å®å
¨é
ç½®\nsecurity:\n # éªè¯ç math,char\n captcha:\n enabled: false\n type: math\n # 鲿¢XSSæ»å»\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n # 䏿 ¡éªç½åå\n ignore:\n whites:\n - /*/health\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /csrf\n','57cec5abd0e0a6b77d853750344a9dc0','2020-05-14 14:17:55','2022-09-29 02:48:32','nacos','0:0:0:0:0:0:0:1','','','ç½å
³æ¨¡å','null','null','yaml','',''), |
| | | (3,'se-auth-dev.yml','DEFAULT_GROUP','spring:\n redis:\n host: se-redis\n port: 6379\n password: Redis_s!E_6.2.6\n','8bd9dada9a94822feeab40de55efced6','2020-11-20 00:00:00','2022-09-29 02:48:42','nacos','0:0:0:0:0:0:0:1','','','认è¯ä¸å¿','null','null','yaml','',''), |
| | | (4,'se-monitor-dev.yml','DEFAULT_GROUP','# spring\nspring:\n security:\n user:\n name: se\n password: 123456\n boot:\n admin:\n ui:\n title: æå¡ç¶æçæ§\n','6f122fd2bfb8d45f858e7d6529a9cd44','2020-11-20 00:00:00','2022-09-29 02:48:54','nacos','0:0:0:0:0:0:0:1','','','çæ§ä¸å¿','null','null','yaml','',''), |
| | | (5,'se-system-dev.yml','DEFAULT_GROUP','# springé
ç½®\nspring:\n redis:\n host: se-redis\n port: 6379\n password: Redis_s!E_6.2.6\n datasource:\n druid:\n stat-view-servlet:\n enabled: false\n loginUsername: admin\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # ä¸»åºæ°æ®æº\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://se-mysql:3306/se-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: My_Sql_s!E_v5.7\n # ä»åºæ°æ®æº\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatisé
ç½®\nmybatis:\n # æç´¢æå®å
å«å\n typeAliasesPackage: com.se.system\n # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶\n mapperLocations: classpath:mapper/**/*.xml\n\n# swaggeré
ç½®\nswagger:\n title: ç³»ç»æ¨¡åæ¥å£ææ¡£\n license: Powered By se','00678c89684ec0b825cb9b71e032db64','2020-11-20 00:00:00','2023-12-04 07:51:28','nacos','0:0:0:0:0:0:0:1','','','ç³»ç»æ¨¡å','null','null','yaml','',''), |
| | |
| | | -- DROP DATABASE IF EXISTS `se-cloud`; |
| | | |
| | | CREATE DATABASE IF NOT EXISTS `se-cloud` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
| | | CREATE DATABASE IF NOT EXISTS `se-cloud` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
| | | |
| | | SET NAMES utf8mb4; |
| | | SET FOREIGN_KEY_CHECKS = 0; |
| | |
| | | DROP DATABASE IF EXISTS `se-seata`; |
| | | -- DROP DATABASE IF EXISTS `se-seata`; |
| | | |
| | | CREATE DATABASE `se-seata` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
| | | CREATE DATABASE IF NOT EXISTS `se-seata` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
| | | |
| | | SET NAMES utf8mb4; |
| | | SET FOREIGN_KEY_CHECKS = 0; |
| | |
| | | nacos.core.auth.caching.enabled=true |
| | | |
| | | ### Since 1.4.1, Turn on/off white auth for user-agent: nacos-server, only for upgrade from old version. |
| | | nacos.core.auth.enable.userAgentAuthWhite=false |
| | | nacos.core.auth.enable.userAgentAuthWhite=true |
| | | |
| | | ### Since 1.4.1, worked when nacos.core.auth.enabled=true and nacos.core.auth.enable.userAgentAuthWhite=false. |
| | | ### The two properties is the white list for auth and used by identity the request from other server. |
| | |
| | | nacos.core.auth.plugin.nacos.token.cache.enable=false |
| | | nacos.core.auth.plugin.nacos.token.expire.seconds=18000 |
| | | ### The default token (Base64 String): |
| | | nacos.core.auth.plugin.nacos.token.secret.key= |
| | | nacos.core.auth.plugin.nacos.token.secret.key=VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= |
| | | |
| | | ### worked when nacos.core.auth.system.type=ldapï¼{0} is Placeholder,replace login username |
| | | #nacos.core.auth.ldap.url=ldap://localhost:389 |
| | |
| | | try_files $uri $uri/ /index.html; |
| | | index index.html index.htm; |
| | | } |
| | | |
| | | location /prod-api/{ |
| | | |
| | | location /sso { |
| | | alias /usr/share/nginx/html/sso; |
| | | try_files $uri $uri/ /sso/; |
| | | #index index.html index.htm; |
| | | } |
| | | |
| | | location /sys { |
| | | alias /usr/share/nginx/html/sys; |
| | | try_files $uri $uri/ /sys/; |
| | | #index index.html index.htm; |
| | | } |
| | | |
| | | location /prod-api/ { |
| | | proxy_set_header Host $http_host; |
| | | proxy_set_header X-Real-IP $remote_addr; |
| | | proxy_set_header REMOTE-HOST $remote_addr; |
| | |
| | | proxy_pass http://se-gateway:8080/; |
| | | } |
| | | |
| | | # é¿å
actuatoræ´é² |
| | | # actuator |
| | | if ($request_uri ~ "/actuator") { |
| | | return 403; |
| | | } |
| | |
| | | @Excel(name = "ç¨æ·åç§°") |
| | | private String nickName; |
| | | |
| | | /** å¯çº§ç±»å */ |
| | | @Excel(name = "å¯çº§ç±»å") |
| | | private String secretLevel; |
| | | |
| | | /** ç¨æ·é®ç®± */ |
| | | @Excel(name = "ç¨æ·é®ç®±") |
| | | private String email; |
| | |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Xss(message = "å¯çº§ç±»åä¸è½å
å«èæ¬å符") |
| | | @Size(min = 1, max = 2, message = "å¯çº§ç±»åé¿åº¦ä¸è½è¶
è¿2个å符") |
| | | public String getSecretLevel() { |
| | | return secretLevel; |
| | | } |
| | | |
| | | public void setSecretLevel(String secretLevel) { |
| | | this.secretLevel = secretLevel; |
| | | } |
| | | |
| | | @Xss(message = "ç¨æ·æµç§°ä¸è½å
å«èæ¬å符") |
| | | @Size(min = 0, max = 30, message = "ç¨æ·æµç§°é¿åº¦ä¸è½è¶
è¿30个å符") |
| | | public String getNickName() |
| | |
| | | <groupId>com.se</groupId> |
| | | <artifactId>se-common-security</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <!--lombok--> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <version>1.18.22</version> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | </facet> |
| | | </component> |
| | | <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
| | | <output url="file://$MODULE_DIR$/../se-auth/target/classes" /> |
| | | <output-test url="file://$MODULE_DIR$/../se-auth/target/test-classes" /> |
| | | <content url="file://$MODULE_DIR$/../se-auth"> |
| | | <sourceFolder url="file://$MODULE_DIR$/../se-auth/src/main/java" isTestSource="false" /> |
| | | <sourceFolder url="file://$MODULE_DIR$/../se-auth/src/main/resources" type="java-resource" /> |
| | | <excludeFolder url="file://$MODULE_DIR$/../se-auth/target" /> |
| | | <output url="file://$MODULE_DIR$/target/classes" /> |
| | | <output-test url="file://$MODULE_DIR$/target/test-classes" /> |
| | | <content url="file://$MODULE_DIR$"> |
| | | <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
| | | <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
| | | <excludeFolder url="file://$MODULE_DIR$/target" /> |
| | | </content> |
| | | <orderEntry type="jdk" jdkName="jdk-1.8" jdkType="JavaSDK" /> |
| | | <orderEntry type="sourceFolder" forTests="false" /> |
| | |
| | | <orderEntry type="library" name="Maven: io.lettuce:lettuce-core:6.1.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.34" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.4" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.30" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-bootstrap:3.1.7" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:3.1.7" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.11.RELEASE" level="project" /> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.auth.controller; |
| | | |
| | | import com.se.common.core.web.controller.BaseController; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * å¥åº·æ§å¶å¨ |
| | | * |
| | | * @author WWW |
| | | * @date 2024-08-24 |
| | | */ |
| | | @RestController |
| | | public class HealthController extends BaseController { |
| | | @GetMapping("/health") |
| | | public long test() { |
| | | return System.currentTimeMillis(); |
| | | } |
| | | } |
| | |
| | | import com.se.auth.form.RegisterBody; |
| | | import com.se.auth.service.SysLoginService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.se.common.core.domain.R; |
| | | import com.se.common.core.utils.JwtUtils; |
| | | import com.se.common.core.utils.StringUtils; |
| | |
| | | return R.ok(tokenService.createToken(userInfo)); |
| | | } |
| | | |
| | | @GetMapping("validate") |
| | | @PostMapping("validate") |
| | | public R<Object> validate(HttpServletRequest request) { |
| | | try { |
| | | boolean flag = false; |
| | | String token = SecurityUtils.getToken(request); |
| | | if (!StringUtils.isNotEmpty(token)) { |
| | | String userName = JwtUtils.getUserName(token); |
| | | flag = !StringUtils.isEmpty(userName); |
| | | } |
| | | |
| | | return R.ok(flag); |
| | | } catch (Exception ex) { |
| | | return R.fail(ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @DeleteMapping("logout") |
| | | public R<?> logout(HttpServletRequest request) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.auth.service; |
| | | |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 弿¥æå¡ |
| | | * |
| | | * @author WWW |
| | | * @date 2024-08-25 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @SuppressWarnings("ALL") |
| | | public class AsyncService { |
| | | public void asyncCall() { |
| | | try { |
| | | ExecutorService executor = Executors.newSingleThreadExecutor(); |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | @SneakyThrows |
| | | public void run() { |
| | | // |
| | | } |
| | | }); |
| | | executor.shutdown(); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @author admin |
| | | */ |
| | | @Component |
| | | @SuppressWarnings("ALL") |
| | | public class SysPasswordService |
| | | { |
| | | @Autowired |
| | |
| | | retryCount = 0; |
| | | } |
| | | |
| | | if (retryCount >= Integer.valueOf(maxRetryCount).intValue()) |
| | | /*if (retryCount >= Integer.valueOf(maxRetryCount).intValue()) |
| | | { |
| | | String errMsg = String.format("å¯ç è¾å
¥é误%s次ï¼å¸æ·éå®%såé", maxRetryCount, lockTime); |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL,errMsg); |
| | | throw new ServiceException(errMsg); |
| | | } |
| | | }*/ |
| | | |
| | | if (!matches(user, password)) |
| | | { |
| | |
| | | nacos: |
| | | discovery: |
| | | # æå¡æ³¨åå°å |
| | | #server-addr: 192.168.11.203:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | config: |
| | | # é
ç½®ä¸å¿å°å |
| | | #server-addr: 192.168.11.203:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | # é
ç½®æä»¶æ ¼å¼ |
| | | file-extension: yml |
| | |
| | | * |
| | | * @author admin |
| | | */ |
| | | public class TokenConstants |
| | | { |
| | | public class TokenConstants { |
| | | /** |
| | | * ä»¤çæ è¯-URL |
| | | */ |
| | | public static final String TOKEN = "token"; |
| | | |
| | | /** |
| | | * ä»¤çæ è¯-URL |
| | | */ |
| | | public static final String ACCESS_TOKEN = "accessToken"; |
| | | |
| | | /** |
| | | * ä»¤çæ è¯-Cookie |
| | | */ |
| | | public static final String COOKIE_TOKEN = "Admin-Token"; |
| | | |
| | | /** |
| | | * 令çèªå®ä¹æ è¯ |
| | | */ |
| | |
| | | * 令çç§é¥ |
| | | */ |
| | | public final static String SECRET = "abcdefghijklmnopqrstuvwxyz"; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.common.core.utils; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.util.Base64; |
| | | |
| | | /** |
| | | * AESå å¯å·¥å
· |
| | | * |
| | | * @author WWW |
| | | * @date 2024-08-25 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class AesUtils { |
| | | /** |
| | | * å¯é¥é¿åº¦å¿
é¡»æ¯16 |
| | | */ |
| | | private static final String DEFAULT_KEY = "A#s_zZ_sErve_k.y"; |
| | | |
| | | private static final String KEY_ALGORITHM = "AES"; |
| | | |
| | | /** |
| | | * ç®æ³ |
| | | */ |
| | | private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding"; |
| | | |
| | | /** |
| | | * aesè§£å¯ |
| | | * |
| | | * @param encrypt å
容 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String decrypt(String encrypt) throws Exception { |
| | | return decrypt(encrypt, DEFAULT_KEY); |
| | | } |
| | | |
| | | /** |
| | | * aeså å¯ |
| | | * |
| | | * @param content å
容 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String encrypt(String content) throws Exception { |
| | | return encrypt(content, DEFAULT_KEY); |
| | | } |
| | | |
| | | /** |
| | | * base 64 encode |
| | | * |
| | | * @param bytes å¾
ç¼ç çbyte[] |
| | | * @return ç¼ç åçbase64 code |
| | | */ |
| | | private static String base64Encode(byte[] bytes) { |
| | | return Base64.getEncoder().encodeToString(bytes); |
| | | } |
| | | |
| | | /** |
| | | * base 64 decode |
| | | * |
| | | * @param base64Code å¾
è§£ç çbase64 code |
| | | * @return è§£ç åçbyte[] |
| | | * @throws Exception |
| | | */ |
| | | private static byte[] base64Decode(String base64Code) { |
| | | return StringUtils.isEmpty(base64Code) ? null : Base64.getDecoder().decode(base64Code); |
| | | } |
| | | |
| | | /** |
| | | * AESå å¯ |
| | | * |
| | | * @param content å¾
å å¯çå
容 |
| | | * @param encryptKey å å¯å¯é¥ |
| | | * @return å å¯åçbyte[] |
| | | * @throws Exception |
| | | */ |
| | | private static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception { |
| | | // KeyGenerator kGen = KeyGenerator.getInstance(KEY_ALGORITHM) |
| | | // kGen.init(128) |
| | | |
| | | Cipher cipher = Cipher.getInstance(ALGORITHMSTR); |
| | | cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), KEY_ALGORITHM)); |
| | | |
| | | return cipher.doFinal(content.getBytes("utf-8")); |
| | | } |
| | | |
| | | /** |
| | | * AESå å¯ä¸ºbase 64 code |
| | | * |
| | | * @param content å¾
å å¯çå
容 |
| | | * @param encryptKey å å¯å¯é¥ |
| | | * @return å å¯åçbase 64 code |
| | | * @throws Exception |
| | | */ |
| | | public static String encrypt(String content, String encryptKey) throws Exception { |
| | | return base64Encode(aesEncryptToBytes(content, encryptKey)); |
| | | } |
| | | |
| | | /** |
| | | * å°base 64 code AESè§£å¯ |
| | | * |
| | | * @param encryptStr å¾
è§£å¯çbase 64 code |
| | | * @param decryptKey è§£å¯å¯é¥ |
| | | * @return è§£å¯åçstring |
| | | * @throws Exception |
| | | */ |
| | | public static String decrypt(String encryptStr, String decryptKey) throws Exception { |
| | | return StringUtils.isEmpty(encryptStr) ? null : aesDecryptByBytes(base64Decode(encryptStr), decryptKey); |
| | | } |
| | | |
| | | /** |
| | | * AESè§£å¯ |
| | | * |
| | | * @param encryptBytes å¾
è§£å¯çbyte[] |
| | | * @param decryptKey è§£å¯å¯é¥ |
| | | * @return è§£å¯åçString |
| | | * @throws Exception |
| | | */ |
| | | private static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws Exception { |
| | | // KeyGenerator kGen = KeyGenerator.getInstance(KEY_ALGORITHM) |
| | | // kGen.init(128) |
| | | |
| | | Cipher cipher = Cipher.getInstance(ALGORITHMSTR); |
| | | cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(decryptKey.getBytes(), KEY_ALGORITHM)); |
| | | byte[] decryptBytes = cipher.doFinal(encryptBytes); |
| | | |
| | | return new String(decryptBytes); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.common.core.utils; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import java.io.*; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.*; |
| | | import java.security.interfaces.RSAPrivateKey; |
| | | import java.security.interfaces.RSAPublicKey; |
| | | import java.security.spec.PKCS8EncodedKeySpec; |
| | | import java.security.spec.X509EncodedKeySpec; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * RSAå·¥å
·ç±» |
| | | * |
| | | * @author WWW |
| | | * @date 2024-08-25 |
| | | */ |
| | | public class RsaUtils { |
| | | /** |
| | | * ç§é¥ |
| | | */ |
| | | private static String privateKey; |
| | | |
| | | /** |
| | | * å
¬é¥ |
| | | */ |
| | | private static String publicKey; |
| | | |
| | | /** |
| | | * å¯é¥ç®æ³ |
| | | */ |
| | | private static final String KEY_ALGORITHM = "RSA"; |
| | | |
| | | /** |
| | | * RSAå¯é¥é¿åº¦ï¼1024 æ 2048 |
| | | */ |
| | | private static final int DEFAULT_RSA_KEY_SIZE = 1024; |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private static final Logger log = LoggerFactory.getLogger(RsaUtils.class); |
| | | |
| | | /** |
| | | * çæå
¬ç§é¥ |
| | | */ |
| | | public static void generate() { |
| | | Map<String, String> result = generateRsaKey(DEFAULT_RSA_KEY_SIZE); |
| | | System.out.println("å
¬é¥ä¸ºï¼" + result.get("publicKey")); |
| | | System.out.println("ç§é¥ä¸ºï¼" + result.get("privateKey")); |
| | | } |
| | | |
| | | /** |
| | | * è·åRSAå å¯ç§é¥ |
| | | * |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static String getPrivateKey() throws IOException { |
| | | if (privateKey == null) { |
| | | InputStream inPrivate = new ClassPathResource("config" + File.separator + "rsa_private_key.txt").getInputStream(); |
| | | privateKey = inputStream2String(inPrivate); |
| | | inPrivate.close(); |
| | | } |
| | | |
| | | return privateKey; |
| | | } |
| | | |
| | | /** |
| | | * è·åRSAå å¯å
¬é¥ |
| | | * |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static String getPublicKey() throws IOException { |
| | | if (publicKey == null) { |
| | | InputStream inPrivate = new ClassPathResource("config" + File.separator + "rsa_public_key.txt").getInputStream(); |
| | | publicKey = inputStream2String(inPrivate); |
| | | inPrivate.close(); |
| | | } |
| | | |
| | | return publicKey; |
| | | } |
| | | |
| | | /** |
| | | * è¯»åææ¬æä»¶ |
| | | * |
| | | * @param fileName æä»¶è·¯å¾ |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static String readFile(String fileName) throws IOException { |
| | | File file = new File(fileName); |
| | | BufferedReader br = new BufferedReader(new FileReader(file)); |
| | | |
| | | StringBuilder result = new StringBuilder(); |
| | | |
| | | String line = null; |
| | | while ((line = br.readLine()) != null) { |
| | | result.append(System.lineSeparator() + line); |
| | | } |
| | | br.close(); |
| | | |
| | | return result.toString(); |
| | | } |
| | | |
| | | /** |
| | | * æinputStream转æString |
| | | * |
| | | * @param is |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | private static String inputStream2String(InputStream is) throws IOException { |
| | | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | | |
| | | int i = -1; |
| | | while ((i = is.read()) != -1) { |
| | | baos.write(i); |
| | | } |
| | | |
| | | String str = baos.toString(); |
| | | baos.close(); |
| | | |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * çæRSAçå
¬ç§é¥ |
| | | * |
| | | * @param keySize 1025 æ 2048 |
| | | * @return |
| | | */ |
| | | public static Map<String, String> generateRsaKey(int keySize) { |
| | | Map<String, String> result = new HashMap<>(2); |
| | | try { |
| | | KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM); |
| | | |
| | | // åå§åå¯é¥å¯¹çæå¨ï¼å¯é¥å¤§å°ä¸º1024 2048ä½ |
| | | keyPairGen.initialize(keySize, new SecureRandom()); |
| | | |
| | | // çæä¸ä¸ªå¯é¥å¯¹ï¼ä¿åå¨keyPairä¸ |
| | | KeyPair keyPair = keyPairGen.generateKeyPair(); |
| | | |
| | | // å¾å°å
¬é¥å符串 |
| | | String pub = new String(Base64.encodeBase64(keyPair.getPublic().getEncoded())); |
| | | result.put("publicKey", pub); |
| | | |
| | | // å¾å°ç§é¥å符串 |
| | | String pri = new String(Base64.encodeBase64(keyPair.getPrivate().getEncoded())); |
| | | result.put("privateKey", pri); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * RSAç§é¥è§£å¯ |
| | | * |
| | | * @param str å å¯çå符串 |
| | | * @return è§£å¯å符串 |
| | | * @throws Exception å å¯è¿ç¨ä¸çå¼å¸¸ä¿¡æ¯ |
| | | */ |
| | | public static String decrypt(String str) throws Exception { |
| | | // 64ä½è§£ç å å¯åçå符串 |
| | | byte[] inputByte = Base64.decodeBase64(str.getBytes(StandardCharsets.UTF_8)); |
| | | |
| | | // Base64ç¼ç çç§é¥ |
| | | byte[] decoded = Base64.decodeBase64(getPrivateKey()); |
| | | RSAPrivateKey priKey = (RSAPrivateKey) KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(decoded)); |
| | | |
| | | // RSAè§£å¯ï¼RSA/ECB/NoPadding |
| | | Cipher cipher = Cipher.getInstance("RSA"); |
| | | cipher.init(Cipher.DECRYPT_MODE, priKey); |
| | | |
| | | String outStr = new String(cipher.doFinal(inputByte)); |
| | | |
| | | return outStr; |
| | | } |
| | | |
| | | /** |
| | | * RSAå
¬é¥å å¯ |
| | | * |
| | | * @param str éè¦å å¯çå符串 |
| | | * @return 坿 |
| | | * @throws Exception å å¯è¿ç¨ä¸çå¼å¸¸ä¿¡æ¯ |
| | | */ |
| | | public static String encrypt(String str) throws Exception { |
| | | // Base64ç¼ç çå
¬é¥ |
| | | byte[] decoded = Base64.decodeBase64(getPublicKey()); |
| | | |
| | | RSAPublicKey pubKey = (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(decoded)); |
| | | |
| | | // RSAå å¯ï¼RSA/ECB/NoPadding |
| | | Cipher cipher = Cipher.getInstance("RSA"); |
| | | cipher.init(Cipher.ENCRYPT_MODE, pubKey); |
| | | |
| | | String outStr = Base64.encodeBase64String(cipher.doFinal(str.getBytes(StandardCharsets.UTF_8))); |
| | | |
| | | return outStr; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.se.common.core.text.StrFormatter; |
| | | import org.springframework.util.AntPathMatcher; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * å符串工å
·ç±» |
| | | * |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getValueFromCookie(HttpServletRequest request,String key) { |
| | | Cookie[] cookies = request.getCookies(); |
| | | if (cookies == null || cookies.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | for (Cookie cookie : cookies) { |
| | | if (cookie.getName().equals(key)){ |
| | | return cookie.getValue(); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * æ ¹æ®requestè·å请æ±token |
| | | */ |
| | | public static String getToken(HttpServletRequest request) |
| | | { |
| | | public static String getToken(HttpServletRequest request) { |
| | | // ä»headerè·åtokenæ è¯ |
| | | String token = request.getHeader(TokenConstants.AUTHENTICATION); |
| | | |
| | | // ä»urlè·åtokenæ è¯ |
| | | if (StringUtils.isEmpty(token)) { |
| | | token = request.getParameter(TokenConstants.ACCESS_TOKEN); |
| | | } |
| | | if (StringUtils.isEmpty(token)) { |
| | | token = request.getParameter(TokenConstants.TOKEN); |
| | | } |
| | | |
| | | // ä»cookieè·åtokenæ è¯ |
| | | if (StringUtils.isEmpty(token)) { |
| | | token = StringUtils.getValueFromCookie(request, TokenConstants.COOKIE_TOKEN); |
| | | } |
| | | |
| | | return replaceTokenPrefix(token); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.gateway.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.http.server.reactive.ServerHttpResponse; |
| | | import org.springframework.web.cors.reactive.CorsUtils; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import org.springframework.web.server.WebFilter; |
| | | import org.springframework.web.server.WebFilterChain; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | /** |
| | | * è·¨åé
ç½® |
| | | * |
| | | * @author se |
| | | * @date 2024-08-28 |
| | | */ |
| | | @Configuration |
| | | public class CorsConfig |
| | | { |
| | | /** |
| | | * è¿éä¸ºæ¯æç请æ±å¤´ï¼å¦ææèªå®ä¹çheaderåæ®µè¯·èªå·±æ·»å |
| | | */ |
| | | // private static final String ALLOWED_HEADERS = "X-Requested-With, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, Admin-Token, App-Token" |
| | | private static final String ALLOWED_HEADERS = "*"; |
| | | private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD"; |
| | | private static final String ALLOWED_ORIGIN = "*"; |
| | | private static final String ALLOWED_EXPOSE = "*"; |
| | | private static final String MAX_AGE = "18000L"; |
| | | |
| | | @Bean |
| | | public WebFilter corsFilter() |
| | | { |
| | | return (ServerWebExchange ctx, WebFilterChain chain) -> { |
| | | ServerHttpRequest request = ctx.getRequest(); |
| | | if (CorsUtils.isCorsRequest(request)) |
| | | { |
| | | ServerHttpResponse response = ctx.getResponse(); |
| | | HttpHeaders headers = response.getHeaders(); |
| | | headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS); |
| | | headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS); |
| | | headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN); |
| | | headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE); |
| | | headers.add("Access-Control-Max-Age", MAX_AGE); |
| | | headers.add("Access-Control-Allow-Credentials", "true"); |
| | | if (request.getMethod() == HttpMethod.OPTIONS) |
| | | { |
| | | response.setStatusCode(HttpStatus.OK); |
| | | return Mono.empty(); |
| | | } |
| | | } |
| | | return chain.filter(ctx); |
| | | }; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.gateway.handler; |
| | | |
| | | import com.se.common.core.web.controller.BaseController; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * å¥åº·æ§å¶å¨ |
| | | * |
| | | * @author WWW |
| | | * @date 2024-08-24 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/gateway") |
| | | public class HealthController extends BaseController { |
| | | @GetMapping("/health") |
| | | public long test() { |
| | | return System.currentTimeMillis(); |
| | | } |
| | | } |
| | |
| | | this.swaggerResources = swaggerResources; |
| | | } |
| | | |
| | | @GetMapping("/health") |
| | | public long health() { |
| | | return System.currentTimeMillis(); |
| | | } |
| | | |
| | | @GetMapping("/configuration/security") |
| | | public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() |
| | | { |
| | |
| | | nacos: |
| | | discovery: |
| | | # æå¡æ³¨åå°å |
| | | #server-addr: 192.168.11.203:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | config: |
| | | # é
ç½®ä¸å¿å°å |
| | | #server-addr: 192.168.11.203:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | # é
ç½®æä»¶æ ¼å¼ |
| | | file-extension: yml |
| | |
| | | datasource: |
| | | ds1: |
| | | nacos: |
| | | #server-addr: 192.168.11.203:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | dataId: sentinel-se-gateway |
| | | groupId: DEFAULT_GROUP |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.system.controller; |
| | | |
| | | import com.se.common.core.web.controller.BaseController; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * å¥åº·æ§å¶å¨ |
| | | * |
| | | * @author WWW |
| | | * @date 2024-08-24 |
| | | */ |
| | | @RestController |
| | | public class HealthController extends BaseController { |
| | | @GetMapping("/health") |
| | | public long test() { |
| | | return System.currentTimeMillis(); |
| | | } |
| | | } |
| | |
| | | * @return ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getInfo") |
| | | public AjaxResult getInfo() |
| | | { |
| | | public AjaxResult getInfo() { |
| | | SysUser user = userService.selectUserById(SecurityUtils.getUserId()); |
| | | // è§è²éå |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // æééå |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | // å²ä½éå |
| | | List<String> posts = permissionService.getPostPermission(user); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("posts", posts); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | |
| | | package com.se.system.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import com.se.system.api.domain.SysUser; |
| | |
| | | * |
| | | * @author admin |
| | | */ |
| | | public interface ISysPermissionService |
| | | { |
| | | public interface ISysPermissionService { |
| | | /** |
| | | * è·åè§è²æ°æ®æé |
| | | * |
| | | * |
| | | * @param userId ç¨æ·Id |
| | | * @return è§è²æéä¿¡æ¯ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åèåæ°æ®æé |
| | | * |
| | | * |
| | | * @param userId ç¨æ·Id |
| | | * @return èåæéä¿¡æ¯ |
| | | */ |
| | | public Set<String> getMenuPermission(SysUser user); |
| | | |
| | | /** |
| | | * è·åèåæ°æ®æé |
| | | * |
| | | * @param userId ç¨æ·Id |
| | | * @return èåæéä¿¡æ¯ |
| | | */ |
| | | public List<String> getPostPermission(SysUser user); |
| | | } |
| | |
| | | package com.se.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.se.common.core.utils.StringUtils; |
| | | import com.se.system.domain.SysPost; |
| | | import com.se.system.mapper.SysPostMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | import com.se.system.service.ISysPermissionService; |
| | | import com.se.system.service.ISysRoleService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * ç¨æ·æéå¤ç |
| | | * |
| | | * @author admin |
| | | */ |
| | | @Service |
| | | public class SysPermissionServiceImpl implements ISysPermissionService |
| | | { |
| | | public class SysPermissionServiceImpl implements ISysPermissionService { |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Resource |
| | | private SysPostMapper postMapper; |
| | | |
| | | /** |
| | | * è·åè§è²æ°æ®æé |
| | | * |
| | | * |
| | | * @param userId ç¨æ·Id |
| | | * @return è§è²æéä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public Set<String> getRolePermission(SysUser user) |
| | | { |
| | | public Set<String> getRolePermission(SysUser user) { |
| | | Set<String> roles = new HashSet<String>(); |
| | | // 管çåæ¥ææææé |
| | | if (user.isAdmin()) |
| | | { |
| | | if (user.isAdmin()) { |
| | | roles.add("admin"); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); |
| | | } |
| | | return roles; |
| | |
| | | |
| | | /** |
| | | * è·åèåæ°æ®æé |
| | | * |
| | | * |
| | | * @param userId ç¨æ·Id |
| | | * @return èåæéä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public Set<String> getMenuPermission(SysUser user) |
| | | { |
| | | public Set<String> getMenuPermission(SysUser user) { |
| | | Set<String> perms = new HashSet<String>(); |
| | | // 管çåæ¥ææææé |
| | | if (user.isAdmin()) |
| | | { |
| | | if (user.isAdmin()) { |
| | | perms.add("*:*:*"); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | List<SysRole> roles = user.getRoles(); |
| | | if (!CollectionUtils.isEmpty(roles)) |
| | | { |
| | | if (!CollectionUtils.isEmpty(roles)) { |
| | | // å¤è§è²è®¾ç½®permissions屿§ï¼ä»¥ä¾¿æ°æ®æéå¹é
æé |
| | | for (SysRole role : roles) |
| | | { |
| | | for (SysRole role : roles) { |
| | | Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId()); |
| | | role.setPermissions(rolePerms); |
| | | perms.addAll(rolePerms); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); |
| | | } |
| | | } |
| | | return perms; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getPostPermission(SysUser user) { |
| | | List<SysPost> list = postMapper.selectPostsByUserName(user.getUserName()); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return null; |
| | | } |
| | | |
| | | return list.stream().map(SysPost::getPostName).collect(Collectors.toList()); |
| | | } |
| | | } |
| | |
| | | nacos: |
| | | discovery: |
| | | # æå¡æ³¨åå°å |
| | | #server-addr: 192.168.11.203:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | config: |
| | | # é
ç½®ä¸å¿å°å |
| | | #server-addr: 192.168.11.203:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | # é
ç½®æä»¶æ ¼å¼ |
| | | file-extension: yml |
| | |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="userName" column="user_name" /> |
| | | <result property="nickName" column="nick_name" /> |
| | | <result property="secretLevel" column="secret_level" /> |
| | | <result property="email" column="email" /> |
| | | <result property="phonenumber" column="phonenumber" /> |
| | | <result property="sex" column="sex" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.secret_level, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.secret_level, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | | <if test="userId != null and userId != 0"> |
| | |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.secret_level, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | </select> |
| | | |
| | | <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.secret_level, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="userName != null and userName != ''">user_name,</if> |
| | | <if test="nickName != null and nickName != ''">nick_name,</if> |
| | | <if test="secretLevel != null and secretLevel != ''">secret_level,</if> |
| | | <if test="email != null and email != ''">email,</if> |
| | | <if test="avatar != null and avatar != ''">avatar,</if> |
| | | <if test="phonenumber != null and phonenumber != ''">phonenumber,</if> |
| | |
| | | <if test="deptId != null and deptId != ''">#{deptId},</if> |
| | | <if test="userName != null and userName != ''">#{userName},</if> |
| | | <if test="nickName != null and nickName != ''">#{nickName},</if> |
| | | <if test="secretLevel != null and secretLevel != ''">#{secretLevel},</if> |
| | | <if test="email != null and email != ''">#{email},</if> |
| | | <if test="avatar != null and avatar != ''">#{avatar},</if> |
| | | <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if> |
| | |
| | | <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> |
| | | <if test="userName != null and userName != ''">user_name = #{userName},</if> |
| | | <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> |
| | | <if test="secretLevel != null and secretLevel != ''">secret_level = #{secretLevel},</if> |
| | | <if test="email != null ">email = #{email},</if> |
| | | <if test="phonenumber != null ">phonenumber = #{phonenumber},</if> |
| | | <if test="sex != null and sex != ''">sex = #{sex},</if> |