From a9a0b25133482af95e5a5c71406eda26f5adcde8 Mon Sep 17 00:00:00 2001 From: Github_lizhw <171332584@qq.com> Date: Mon, 31 Mar 2025 23:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=88=90=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_project.md | 31 +++++ .../dromara/gateway/filter/AuthFilter.java | 7 +- ruoyi-site/ruoyi-h5/doc/h5-core.sql | 121 ++++++++++++++++++ 3 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 README_project.md create mode 100644 ruoyi-site/ruoyi-h5/doc/h5-core.sql diff --git a/README_project.md b/README_project.md new file mode 100644 index 000000000..3a210ce6b --- /dev/null +++ b/README_project.md @@ -0,0 +1,31 @@ +# 后端 + +| 模块 | 主要功能 | 详细描述 | git地址 | | | | +|------------------|------------|------|-------|---|---|---| +| gateway | 全局网关 | | | | | | +| ruoyi-sso-server | sso单点登录服务 | | | | | | +| ruoyi-h5 | 在线h5微服务 | | | | | | +| ruoyi-tams | 教培微服务 | | | | | | +| ruoyi-s3 | s3 对象存储微服务 | | | | | | +| ruoyi-h5 | 在线h5后台 | | | | | | + +# 前端 + +| 模块 | 主要功能 | 详细描述 | git地址 | | | | +|---------------|----------|------|-------|---|---|---| +| tmagic-editor | 在线h5编辑 | | | | | | +| ruoyi-h5-web | 在线h5管理界面 | | | | | | + +## tmagic-editor + +### 未来规划 +- 参考 https://www.gaoding.com/editor/odyssey?mode=user&template_id=31593731846159481 + +- 支持mock 接口 +- 模板模块:支持查询模板、滚动懒加载模板、分类查询模板、模板预览、模板替换当前页面 +- 支持文字、组件 +- 背景替换 +- 支持长页面和翻页页面 +- 全部支持分组和打标签() +- 方便后面界面优化,是埋点还是怎么弄? +- 支持全局搜索 \ No newline at end of file diff --git a/ruoyi-site/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/AuthFilter.java b/ruoyi-site/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/AuthFilter.java index 1c1e7aa2d..fc088ebb5 100644 --- a/ruoyi-site/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/AuthFilter.java +++ b/ruoyi-site/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/AuthFilter.java @@ -46,6 +46,9 @@ public class AuthFilter { ServerHttpRequest request = SaReactorSyncHolder.getContext().getRequest(); // 检查是否登录 是否有token try { +// if (!StpUtil.isLogin()) { +// StpUtil.login(1); +// } StpUtil.checkLogin(); } catch (NotLoginException e) { if (request.getURI().getPath().contains("sse")) { @@ -73,8 +76,8 @@ public class AuthFilter { // } }); }).setError(e -> { - log.error("认证错误", e); - if (e instanceof NotLoginException) { + log.error("认证错误", e); + if (e instanceof NotLoginException) { return SaResult.error(e.getMessage()).setCode(HttpStatus.UNAUTHORIZED); } return SaResult.error("认证失败,无法访问系统资源").setCode(HttpStatus.UNAUTHORIZED); diff --git a/ruoyi-site/ruoyi-h5/doc/h5-core.sql b/ruoyi-site/ruoyi-h5/doc/h5-core.sql new file mode 100644 index 000000000..538959105 --- /dev/null +++ b/ruoyi-site/ruoyi-h5/doc/h5-core.sql @@ -0,0 +1,121 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for work +-- ---------------------------- +DROP TABLE IF EXISTS `work`; +CREATE TABLE `work` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标题', + `description` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '描述', + `cover_image_url` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `pages` json NULL, + `publish` tinyint(1) NOT NULL DEFAULT 0, + `template` tinyint(1) NOT NULL DEFAULT 0, + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 14 + CHARACTER SET = utf8 + COLLATE = utf8_general_ci + ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for work_forms +-- ---------------------------- +DROP TABLE IF EXISTS `work_forms`; +CREATE TABLE `work_forms` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `form` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL, + `work_id` bigint(20) NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `work_id` (`work_id`) USING BTREE, + CONSTRAINT `work_forms_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB + AUTO_INCREMENT = 1 + CHARACTER SET = utf8 + COLLATE = utf8_general_ci + ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + +create table scripts +( + id int auto_increment + primary key, + title varchar(255) not null comment '标题', + content longtext not null comment '内容', + create_time datetime default CURRENT_TIMESTAMP not null, + update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP +) + comment '脚本' charset = utf8mb3; + +INSERT INTO scripts (id, title, content, create_time, update_time) VALUES (1, '测试脚本1', 'return { + methodsConfig: { // 此项配置自定义方法的在组件配置面板如何展示 + clickFn: { // 方法名,对应于 methods 内的某方法 + label: \'外部跳转1\', // 自定义方法显示名 + params: [ // 参数列表,对象数组 + { + label: \'类型\', + desc: \'query形式参数\', + type: \'object\', + default: \'http://\', + editor: { + type: \'a-select\', + label: \'类型\', + prop: { + options: [ + { + "label": "http://", + "value": "http://" + }, + { + "label": "https://", + "value": "https://" + }, + { + "label": "邮件", + "value": "mailto:" + }, + { + "label": "打电话", + "value": "tel:" + }, + { + "label": "页码跳转", + "value": "#page" + }, + { + "label": "表单提交", + "value": "@submit" + }, + { + "label": "分享", + "value": "@share" + } + ] + } + } + }, + { + label: \'跳转地址\', // 参数1的名称 + desc: \'项目相对地址\', // 参数1的描述 + type: \'string\', // 参数1的类型,支持string|number|boolean|array|object + default: \'www.baidu.com\', // 参数1默认值 + }, + ] + } + }, + methods:{ + clickFn:function(type, url){ + console.log(url) + let win = window.open(type+url, \'_blank\') + win.focus() + } + } + }', now(), now());