From 15f7d4dc471a735ead8000fc0809cd46c390f055 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 22 十二月 2022 18:26:18 +0800
Subject: [PATCH] update 优化 springdoc 配置鉴权头写死问题 增加持久化鉴权头配置

---
 script/sql/postgres/postgres_ry_vue_4.X.sql |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/script/sql/postgres/postgres_ry_vue_4.X.sql b/script/sql/postgres/postgres_ry_vue_4.X.sql
index 75a38e1..1db2cf8 100644
--- a/script/sql/postgres/postgres_ry_vue_4.X.sql
+++ b/script/sql/postgres/postgres_ry_vue_4.X.sql
@@ -231,7 +231,7 @@
 comment on column sys_menu.is_frame is '鏄惁涓哄閾撅紙0鏄� 1鍚︼級';
 comment on column sys_menu.is_cache is '鏄惁缂撳瓨锛�0缂撳瓨 1涓嶇紦瀛橈級';
 comment on column sys_menu.menu_type is '鑿滃崟绫诲瀷锛圡鐩綍 C鑿滃崟 F鎸夐挳锛�';
-comment on column sys_menu.visible is '鑿滃崟鐘舵�侊紙0鏄剧ず 1闅愯棌锛�';
+comment on column sys_menu.visible is '鏄剧ず鐘舵�侊紙0鏄剧ず 1闅愯棌锛�';
 comment on column sys_menu.status is '鑿滃崟鐘舵�侊紙0姝e父 1鍋滅敤锛�';
 comment on column sys_menu.perms is '鏉冮檺鏍囪瘑';
 comment on column sys_menu.icon is '鑿滃崟鍥炬爣';
@@ -260,7 +260,6 @@
 insert into sys_menu values('107',  '閫氱煡鍏憡', '1',   '8', 'notice',     'system/notice/index',      '', '1', '0', 'C', '0', '0', 'system:notice:list',      'message',       'admin', now(), '', null, '閫氱煡鍏憡鑿滃崟');
 insert into sys_menu values('108',  '鏃ュ織绠$悊', '1',   '9', 'log',        '',                         '', '1', '0', 'M', '0', '0', '',                        'log',           'admin', now(), '', null, '鏃ュ織绠$悊鑿滃崟');
 insert into sys_menu values('109',  '鍦ㄧ嚎鐢ㄦ埛', '2',   '1', 'online',     'monitor/online/index',     '', '1', '0', 'C', '0', '0', 'monitor:online:list',     'online',        'admin', now(), '', null, '鍦ㄧ嚎鐢ㄦ埛鑿滃崟');
-insert into sys_menu values('111',  '鏁版嵁鐩戞帶', '2',   '3', 'druid',      'monitor/druid/index',      '', '1', '0', 'C', '0', '0', 'monitor:druid:list',      'druid',         'admin', now(), '', null, '鏁版嵁鐩戞帶鑿滃崟');
 insert into sys_menu values('112',  '缂撳瓨鍒楄〃', '2',   '6', 'cacheList',  'monitor/cache/list',       '', '1', '0', 'C', '0', '0', 'monitor:cache:list',      'redis-list',    'admin', now(), '', null, '缂撳瓨鍒楄〃鑿滃崟');
 insert into sys_menu values('113',  '缂撳瓨鐩戞帶', '2',   '5', 'cache',      'monitor/cache/index',      '', '1', '0', 'C', '0', '0', 'monitor:cache:list',      'redis',         'admin', now(), '', null, '缂撳瓨鐩戞帶鑿滃崟');
 insert into sys_menu values('114',  '琛ㄥ崟鏋勫缓', '3',   '1', 'build',      'tool/build/index',         '', '1', '0', 'C', '0', '0', 'tool:build:list',         'build',         'admin', now(), '', null, '琛ㄥ崟鏋勫缓鑿滃崟');
@@ -330,6 +329,7 @@
 insert into sys_menu values('1043', '鐧诲綍鏌ヨ', '501', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:query',   '#', 'admin', now(), '', null, '');
 insert into sys_menu values('1044', '鐧诲綍鍒犻櫎', '501', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:remove',  '#', 'admin', now(), '', null, '');
 insert into sys_menu values('1045', '鏃ュ織瀵煎嚭', '501', '3', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:export',  '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1050', '璐︽埛瑙i攣', '501', '4', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:unlock',  '#', 'admin', now(), '', null, '');
 -- 鍦ㄧ嚎鐢ㄦ埛鎸夐挳
 insert into sys_menu values('1046', '鍦ㄧ嚎鏌ヨ', '109', '1', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:query',       '#', 'admin', now(), '', null, '');
 insert into sys_menu values('1047', '鎵归噺寮洪��', '109', '2', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', now(), '', null, '');
@@ -459,6 +459,7 @@
 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', '1050');
 insert into sys_role_menu values ('2', '1046');
 insert into sys_role_menu values ('2', '1047');
 insert into sys_role_menu values ('2', '1048');
@@ -648,6 +649,7 @@
 insert into sys_dict_data values(15, 2,  '鍏憡',     '2',       'sys_notice_type',     '',   'success', 'N', '0', 'admin', now(), '', null, '鍏憡');
 insert into sys_dict_data values(16, 1,  '姝e父',     '0',       'sys_notice_status',   '',   'primary', 'Y', '0', 'admin', now(), '', null, '姝e父鐘舵��');
 insert into sys_dict_data values(17, 2,  '鍏抽棴',     '1',       'sys_notice_status',   '',   'danger',  'N', '0', 'admin', now(), '', null, '鍏抽棴鐘舵��');
+insert into sys_dict_data values(29, 99, '鍏朵粬',     '0',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', now(), '', null, '鍏朵粬鎿嶄綔');
 insert into sys_dict_data values(18, 1,  '鏂板',     '1',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', now(), '', null, '鏂板鎿嶄綔');
 insert into sys_dict_data values(19, 2,  '淇敼',     '2',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', now(), '', null, '淇敼鎿嶄綔');
 insert into sys_dict_data values(20, 3,  '鍒犻櫎',     '3',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', now(), '', null, '鍒犻櫎鎿嶄綔');
@@ -695,7 +697,7 @@
 insert into sys_config values(1, '涓绘鏋堕〉-榛樿鐨偆鏍峰紡鍚嶇О',     'sys.index.skinName',            'skin-blue',     'Y', 'admin', now(), '', null, '钃濊壊 skin-blue銆佺豢鑹� skin-green銆佺传鑹� skin-purple銆佺孩鑹� skin-red銆侀粍鑹� skin-yellow' );
 insert into sys_config values(2, '鐢ㄦ埛绠$悊-璐﹀彿鍒濆瀵嗙爜',         'sys.user.initPassword',         '123456',        'Y', 'admin', now(), '', null, '鍒濆鍖栧瘑鐮� 123456' );
 insert into sys_config values(3, '涓绘鏋堕〉-渚ц竟鏍忎富棰�',           'sys.index.sideTheme',           'theme-dark',    'Y', 'admin', now(), '', null, '娣辫壊涓婚theme-dark锛屾祬鑹蹭富棰榯heme-light' );
-insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�',           'sys.account.captchaOnOff',      'true',          'Y', 'admin', now(), '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�');
+insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�',           'sys.account.captchaEnabled',    'true',          'Y', 'admin', now(), '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�');
 insert into sys_config values(5, '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�',   'sys.account.registerUser',      'false',         'Y', 'admin', now(), '', null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�');
 insert into sys_config values(11, 'OSS棰勮鍒楄〃璧勬簮寮�鍏�',          'sys.oss.previewListResource',   'true',          'Y', 'admin', now(), '', null, 'true:寮�鍚�, false:鍏抽棴');
 
@@ -888,7 +890,7 @@
     create_time   timestamp,
     update_by     varchar(64)  default ''::varchar,
     update_time   timestamp,
-    service       varchar(10)  default 'minio'::varchar,
+    service       varchar(20)  default 'minio'::varchar,
     constraint sys_oss_pk primary key (oss_id)
 );
 
@@ -911,7 +913,7 @@
 create table if not exists sys_oss_config
 (
     oss_config_id int8,
-    config_key    varchar(255) default ''::varchar not null,
+    config_key    varchar(20)  default ''::varchar not null,
     access_key    varchar(255) default ''::varchar,
     secret_key    varchar(255) default ''::varchar,
     bucket_name   varchar(255) default ''::varchar,
@@ -920,6 +922,7 @@
     domain        varchar(255) default ''::varchar,
     is_https      char         default 'N'::bpchar,
     region        varchar(255) default ''::varchar,
+    access_policy char(1)      default '1'::bpchar not null,
     status        char         default '1'::bpchar,
     ext1          varchar(255) default ''::varchar,
     create_by     varchar(64)  default ''::varchar,
@@ -941,6 +944,7 @@
 comment on column sys_oss_config.domain is '鑷畾涔夊煙鍚�';
 comment on column sys_oss_config.is_https is '鏄惁https锛圷=鏄�,N=鍚︼級';
 comment on column sys_oss_config.region is '鍩�';
+comment on column sys_oss_config.access_policy is '妗舵潈闄愮被鍨�(0=private 1=public 2=custom)';
 comment on column sys_oss_config.status is '鐘舵�侊紙0=姝e父,1=鍋滅敤锛�';
 comment on column sys_oss_config.ext1 is '鎵╁睍瀛楁';
 comment on column sys_oss_config.create_by is '鍒涘缓鑰�';
@@ -949,9 +953,15 @@
 comment on column sys_oss_config.update_time is '鏇存柊鏃堕棿';
 comment on column sys_oss_config.remark is '澶囨敞';
 
-insert into sys_oss_config values (1, 'minio',  'ruoyi',            'ruoyi123',        'ruoyi',             '', '127.0.0.1:9000',                      '','N', '',            '0', '', 'admin', now(), 'admin', now(), null);
-insert into sys_oss_config values (2, 'qiniu',  'XXXXXXXXXXXXXXX',  'XXXXXXXXXXXXXXX', 'ruoyi',             '', 's3-cn-north-1.qiniucs.com',           '','N', '',            '1', '', 'admin', now(), 'admin', now(), null);
-insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX',  'XXXXXXXXXXXXXXX', 'ruoyi',             '', 'oss-cn-beijing.aliyuncs.com',         '','N', '',            '1', '', 'admin', now(), 'admin', now(), null);
-insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX',  'XXXXXXXXXXXXXXX', 'ruoyi-1250000000',  '', 'cos.ap-beijing.myqcloud.com',         '','N', 'ap-beijing',  '1', '', 'admin', now(), 'admin', now(), null);
-insert into sys_oss_config values (5, 'image',  'ruoyi',            'ruoyi123',        'ruoyi',             'image', '127.0.0.1:9000',                 '','N', '',            '1', '', 'admin', now(), 'admin', now(), NULL);
+insert into sys_oss_config values (1, 'minio',  'ruoyi',            'ruoyi123',        'ruoyi',             '', '127.0.0.1:9000',                      '','N', '',            '1', '0', '', 'admin', now(), 'admin', now(), null);
+insert into sys_oss_config values (2, 'qiniu',  'XXXXXXXXXXXXXXX',  'XXXXXXXXXXXXXXX', 'ruoyi',             '', 's3-cn-north-1.qiniucs.com',           '','N', '',            '1', '1', '', 'admin', now(), 'admin', now(), null);
+insert into sys_oss_config values (3, 'aliyun', 'XXXXXXXXXXXXXXX',  'XXXXXXXXXXXXXXX', 'ruoyi',             '', 'oss-cn-beijing.aliyuncs.com',         '','N', '',            '1', '1', '', 'admin', now(), 'admin', now(), null);
+insert into sys_oss_config values (4, 'qcloud', 'XXXXXXXXXXXXXXX',  'XXXXXXXXXXXXXXX', 'ruoyi-1250000000',  '', 'cos.ap-beijing.myqcloud.com',         '','N', 'ap-beijing',  '1', '1', '', 'admin', now(), 'admin', now(), null);
+insert into sys_oss_config values (5, 'image',  'ruoyi',            'ruoyi123',        'ruoyi',             'image', '127.0.0.1:9000',                 '','N', '',            '1', '1', '', 'admin', now(), 'admin', now(), NULL);
 
+-- 瀛楃涓茶嚜鍔ㄨ浆鏃堕棿 閬垮厤妗嗘灦鏃堕棿鏌ヨ鎶ラ敊闂
+create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$
+select to_timestamp($1, 'yyyy-mm-dd hh24:mi:ss');
+$$ language sql strict ;
+
+create cast (varchar as timestamptz) with function cast_varchar_to_timestamp as IMPLICIT;

--
Gitblit v1.9.3