36 Commits
7.6 ... 7.7

Author SHA1 Message Date
wintel
3747773685 docs: 完善自定义查询文档 2025-05-07 20:58:02 +08:00
wintel
7c0107f78e docs: 增加表格组件文档 2025-05-07 20:34:10 +08:00
wintel
ce01dca5c3 docs: 增加列设置文档 2025-05-07 20:30:31 +08:00
wintel
f7bd7e22b4 docs: 增加vue3自定义查询组件文档 2025-05-07 19:26:07 +08:00
yubaolee
985f898d88 fix: 入库单调整为sqlsugar后主从表关联处理 2025-05-07 17:35:27 +08:00
yubaolee
e8b85fc05a feat: 入库订单调整为sqlsugar,并支持自定义查询 2025-05-07 16:15:42 +08:00
wintel
a978fa7e22 Merge commit '576ff6e98a0d443519620c7b1d1ff9d01bfc86c6' into main 2025-05-06 22:27:43 +08:00
wintel
576ff6e98a feat: 增加高级查询 2025-05-06 21:15:47 +08:00
wintel
032f5551dc Merge branch 'main' of https://gitee.com/dotnetchina/OpenAuth.Net into main 2025-04-29 19:08:01 +08:00
yubaolee
a28458347a feat: 增加低代码平台脚本 2025-04-29 17:15:43 +08:00
yubaolee
3def1e6bfc chore: 增加cursor mcp Servers支持 2025-04-29 15:51:04 +08:00
wintel
a42b2dcb7c docs: update doc 2025-04-26 16:19:44 +08:00
wintel
89fe623a72 docs: 增加右下角导航;
调整identity显示级别
2025-04-26 15:04:49 +08:00
wintel
107e297e01 docs: update doc 2025-04-26 11:57:13 +08:00
wintel
8c129d6746 docs: 更新文档 2025-04-25 00:05:19 +08:00
wintel
688caa324b docs: update startflow.md 2025-04-24 23:40:36 +08:00
wintel
a6fdf4e6ce docs: 更新打印文档 2025-04-24 23:24:14 +08:00
wintel
b583b2adbf docs: 删除docs 2025-04-24 23:21:31 +08:00
wintel
17e426c785 docs: update doc 2025-04-24 23:16:06 +08:00
yubaolee
85497a544a docs: update router 2025-04-24 15:06:59 +08:00
yubaolee
aa7056bfb3 docs: update devnew 2025-04-24 15:02:55 +08:00
yubaolee
9653778c77 docs: update deploy 2025-04-24 14:29:56 +08:00
yubaolee
59a099b607 docs: add start 2025-04-24 10:40:15 +08:00
yubaolee
bf9be59a84 docs: 修复文档链接 2025-04-24 10:34:58 +08:00
wintel
c7ff40615b fix: svg 2025-04-24 02:01:33 +08:00
wintel
61240b6f16 docs: update home 2025-04-24 01:51:51 +08:00
wintel
1750ff4c9e docs: 优化首页 2025-04-24 01:30:19 +08:00
wintel
700bf8dea4 docs: add iconify icon 2025-04-24 01:15:54 +08:00
wintel
dd02328033 docs: 修复图片 2025-04-24 00:36:50 +08:00
wintel
8ae512022e docs: 修复图片 2025-04-24 00:30:36 +08:00
wintel
4a3d51b13d docs: fix image 2025-04-24 00:11:40 +08:00
wintel
1926a3a09b docs: add logo 2025-04-24 00:05:33 +08:00
wintel
ca8b2a82c4 docs: 更新文档标题 2025-04-24 00:03:31 +08:00
wintel
1525a25aba docs: 增加vue3、vue2文档 2025-04-23 23:58:54 +08:00
wintel
2b0979dc88 Merge branch 'main' of https://gitee.com/dotnetchina/OpenAuth.Net into main 2025-04-23 23:38:07 +08:00
wintel
918b6a53d4 docs: 全新文档 2025-04-23 23:37:58 +08:00
124 changed files with 2685 additions and 918 deletions

29
.cursor/mcp.json Normal file
View File

@@ -0,0 +1,29 @@
{
"mcpServers": {
"PostgreSQL": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://postgres:AwxBRx1_5kljfy@172.30.144.46/openauthpro"
],
"env": {}
},
"mysql": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"mysql-mcp-server",
"mysql_mcp_server"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "000000",
"MYSQL_DATABASE": "openauthpro"
}
}
}
}

View File

@@ -15,6 +15,11 @@
public string key { get; set; }
/// <summary>
/// 自定义sql条件
/// </summary>
public string sqlWhere { get; set; }
public PageReq()
{
page = 1;

View File

@@ -569,6 +569,9 @@ namespace OpenAuth.App
{
return "DateTime.Now";
}
else if (type == "bool"){
return "false";
}
return Activator.CreateInstance(t).ToString();
}

View File

@@ -32,6 +32,10 @@ namespace OpenAuth.App
{
objs = objs.Where(u => u.Name.Contains(request.key));
}
if (!string.IsNullOrEmpty(request.sqlWhere))
{
objs = objs.Where(request.sqlWhere);
}
result.data = objs.OrderBy(u => u.Name)
.Skip((request.page - 1) * request.limit)

View File

@@ -2,22 +2,17 @@
using System.Linq;
using System.Threading.Tasks;
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
using SqlSugar;
namespace OpenAuth.App
{
public class WmsInboundOrderDtblApp : BaseStringApp<WmsInboundOrderDtbl,OpenAuthDBContext>
public class WmsInboundOrderDtblApp : SqlSugarBaseApp<WmsInboundOrderDtbl>
{
private RevelanceManagerApp _revelanceApp;
private DbExtension _dbExtension;
/// <summary>
/// 加载列表
/// </summary>
@@ -29,19 +24,19 @@ namespace OpenAuth.App
{
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
}
var properties = loginContext.GetTableColumns("WmsInboundOrderDtbl");
if (properties == null || properties.Count == 0)
{
throw new Exception("请在代码生成界面配置WmsInboundOrderDtbl表的字段属性");
}
var result = new TableData();
var objs = UnitWork.Find<WmsInboundOrderDtbl>(null);
var objs = SugarClient.Queryable<WmsInboundOrderDtbl>();
if (!string.IsNullOrEmpty(request.InboundOrderId))
{
objs = objs.Where(u => u.OrderId == request.InboundOrderId);
}
if (!string.IsNullOrEmpty(request.key))
{
objs = objs.Where(u => u.GoodsId.Contains(request.key));
@@ -51,32 +46,34 @@ namespace OpenAuth.App
result.columnFields = properties;
result.data = objs.OrderBy(u => u.Id)
.Skip((request.page - 1) * request.limit)
.Take(request.limit).Select($"new ({propertyStr})");
.Take(request.limit).Select($"{propertyStr}").ToList();
result.count = await objs.CountAsync();
return result;
}
public void Add(AddOrUpdateWmsInboundOrderDtblReq req)
{
SugarClient.Ado.BeginTran();
AddNoSave(req);
UnitWork.Save();
SugarClient.Ado.CommitTran();
}
public void AddNoSave(AddOrUpdateWmsInboundOrderDtblReq req)
{
var obj = req.MapTo<WmsInboundOrderDtbl>();
//todo:补充或调整自己需要的字段
obj.CreateTime = DateTime.Now;
var user = _auth.GetCurrentUser().User;
obj.GenerateDefaultKeyVal();
obj.CreateUserId = user.Id;
obj.CreateUserName = user.Name;
UnitWork.Add(obj);
SugarClient.Insertable(obj).ExecuteCommand();
}
public void Update(AddOrUpdateWmsInboundOrderDtblReq obj)
public void Update(AddOrUpdateWmsInboundOrderDtblReq obj)
{
var user = _auth.GetCurrentUser().User;
UnitWork.Update<WmsInboundOrderDtbl>(u => u.Id == obj.Id, u => new WmsInboundOrderDtbl
Repository.Update(u => new WmsInboundOrderDtbl
{
Price = obj.Price,
PriceNoTax = obj.PriceNoTax,
@@ -98,15 +95,12 @@ namespace OpenAuth.App
UpdateUserId = user.Id,
UpdateUserName = user.Name
//todo:补充或调整自己需要的字段
});
}, u => u.Id == obj.Id);
}
public WmsInboundOrderDtblApp(IUnitWork<OpenAuthDBContext> unitWork, IRepository<WmsInboundOrderDtbl,OpenAuthDBContext> repository,
RevelanceManagerApp app, IAuth auth, DbExtension dbExtension) : base(unitWork, repository,auth)
public WmsInboundOrderDtblApp(ISqlSugarClient client, IAuth auth) : base(client, auth)
{
_dbExtension = dbExtension;
_revelanceApp = app;
}
}
}

View File

@@ -2,20 +2,17 @@
using System.Linq;
using System.Threading.Tasks;
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
using SqlSugar;
namespace OpenAuth.App
{
public class WmsInboundOrderTblApp : BaseStringApp<WmsInboundOrderTbl,OpenAuthDBContext>
public class WmsInboundOrderTblApp : SqlSugarBaseApp<WmsInboundOrderTbl>
{
private RevelanceManagerApp _revelanceApp;
private WmsInboundOrderDtblApp _wmsInboundOrderDtblApp;
/// <summary>
@@ -29,26 +26,32 @@ namespace OpenAuth.App
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
}
var columns = loginContext.GetTableColumns("WmsInboundOrderTbl");
if (columns == null || columns.Count == 0)
{
throw new Exception("请在代码生成界面配置WmsInboundOrderTbl表的字段属性");
}
var result = new TableData();
result.columnFields = columns;
var objs = GetDataPrivilege("u");
if (!string.IsNullOrEmpty(request.key))
{
objs = objs.Where(u => u.Id.Contains(request.key));
}
if (!string.IsNullOrEmpty(request.sqlWhere))
{
objs = objs.Where(request.sqlWhere);
}
var propertyStr = string.Join(',', columns.Select(u => u.ColumnName));
result.data = objs.OrderBy(u => u.Id)
.Skip((request.page - 1) * request.limit)
.Take(request.limit).Select($"new ({propertyStr})");
.Take(request.limit).Select($"{propertyStr}").ToList();
result.count = await objs.CountAsync();
return result;
}
@@ -61,7 +64,8 @@ namespace OpenAuth.App
var user = _auth.GetCurrentUser().User;
obj.CreateUserId = user.Id;
obj.CreateUserName = user.Name;
UnitWork.Add(obj);
SugarClient.Ado.BeginTran();
SugarClient.Insertable(obj).ExecuteCommand();
if (req.WmsInboundOrderDtblReqs != null && req.WmsInboundOrderDtblReqs.Any())
{
foreach (var detail in req.WmsInboundOrderDtblReqs)
@@ -71,72 +75,71 @@ namespace OpenAuth.App
}
}
UnitWork.Save();
SugarClient.Ado.CommitTran();
}
public void Update(AddOrUpdateWmsInboundOrderTblReq obj)
{
var user = _auth.GetCurrentUser().User;
UnitWork.ExecuteWithTransaction(() =>
SugarClient.Ado.BeginTran();
if (obj.WmsInboundOrderDtblReqs != null && obj.WmsInboundOrderDtblReqs.Any())
{
if (obj.WmsInboundOrderDtblReqs != null && obj.WmsInboundOrderDtblReqs.Any())
//id为空的添加
foreach (var detail in obj.WmsInboundOrderDtblReqs.Where(u => string.IsNullOrEmpty(u.Id)))
{
//id为空的添加
foreach (var detail in obj.WmsInboundOrderDtblReqs.Where(u => string.IsNullOrEmpty(u.Id)))
{
detail.OrderId = obj.Id;
_wmsInboundOrderDtblApp.AddNoSave(detail);
}
//id比数据库少的删除
var containids = obj.WmsInboundOrderDtblReqs.Select(u => u.Id)
.Where(u => !string.IsNullOrEmpty(u)).ToList();
if (containids.Any())
{
UnitWork.Delete<WmsInboundOrderDtbl>(u => (!containids.Contains(u.Id)) && u.OrderId == obj.Id);
}
//更新id相同的
foreach (var detail in obj.WmsInboundOrderDtblReqs.Where(u => !string.IsNullOrEmpty(u.Id)))
{
_wmsInboundOrderDtblApp.Update(detail);
}
detail.OrderId = obj.Id;
_wmsInboundOrderDtblApp.AddNoSave(detail);
}
UnitWork.Update<WmsInboundOrderTbl>(u => u.Id == obj.Id, u => new WmsInboundOrderTbl
//id比数据库少的删除
var containids = obj.WmsInboundOrderDtblReqs.Select(u => u.Id)
.Where(u => !string.IsNullOrEmpty(u)).ToList();
if (containids.Any())
{
ExternalNo = obj.ExternalNo,
ExternalType = obj.ExternalType,
Status = obj.Status,
OrderType = obj.OrderType,
GoodsType = obj.GoodsType,
PurchaseNo = obj.PurchaseNo,
StockId = obj.StockId,
OwnerId = obj.OwnerId,
ShipperId = obj.ShipperId,
SupplierId = obj.SupplierId,
ScheduledInboundTime = obj.ScheduledInboundTime,
Remark = obj.Remark,
Enable = obj.Enable,
TransferType = obj.TransferType,
InBondedArea = obj.InBondedArea,
ReturnBoxNum = obj.ReturnBoxNum,
UpdateTime = DateTime.Now,
UpdateUserId = user.Id,
UpdateUserName = user.Name
//todo:补充或调整自己需要的字段
});
SugarClient.Deleteable<WmsInboundOrderDtbl>(u => (!containids.Contains(u.Id)) && u.OrderId == obj.Id).ExecuteCommand();
}
//更新id相同的
foreach (var detail in obj.WmsInboundOrderDtblReqs.Where(u => !string.IsNullOrEmpty(u.Id)))
{
_wmsInboundOrderDtblApp.Update(detail);
}
}
Repository.Update(u => new WmsInboundOrderTbl
{
ExternalNo = obj.ExternalNo,
ExternalType = obj.ExternalType,
Status = obj.Status,
OrderType = obj.OrderType,
GoodsType = obj.GoodsType,
PurchaseNo = obj.PurchaseNo,
StockId = obj.StockId,
OwnerId = obj.OwnerId,
ShipperId = obj.ShipperId,
SupplierId = obj.SupplierId,
ScheduledInboundTime = obj.ScheduledInboundTime,
Remark = obj.Remark,
Enable = obj.Enable,
TransferType = obj.TransferType,
InBondedArea = obj.InBondedArea,
ReturnBoxNum = obj.ReturnBoxNum,
UpdateTime = DateTime.Now,
UpdateUserId = user.Id,
UpdateUserName = user.Name
//todo:补充或调整自己需要的字段
}, u => u.Id == obj.Id);
SugarClient.Ado.CommitTran();
UnitWork.Save();
});
}
public WmsInboundOrderTblApp(IUnitWork<OpenAuthDBContext> unitWork, IRepository<WmsInboundOrderTbl,OpenAuthDBContext> repository,
RevelanceManagerApp app, IAuth auth, WmsInboundOrderDtblApp wmsInboundOrderDtblApp) : base(unitWork,
repository, auth)
public WmsInboundOrderTblApp(ISqlSugarClient client, IAuth auth,
WmsInboundOrderDtblApp wmsInboundOrderDtblApp) : base(client, auth)
{
_revelanceApp = app;
_wmsInboundOrderDtblApp = wmsInboundOrderDtblApp;
}
}

View File

@@ -1,192 +0,0 @@
/*
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
* @Date: 2023-08-12 10:48:24
* @LastEditTime: 2025-04-19 10:14:48
* @Description:
* @
* @Copyright (c) 2023 by yubaolee | ahfu~ , All Rights Reserved.
*/
module.exports = {
title: 'OpenAuth.Net',
description: '最好用的.net权限工作流框架,最好用的.net vue前后分离框架',
head: [
['link', {
rel: 'icon',
href: '/logo.png'
}],['script',{},
`var _hmt = _hmt || [];
(function () {
var hm = document.createElement('script')
hm.src = 'https://hm.baidu.com/hm.js?93a7b9a145222f9b7109d643a0c58f8d'
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})();
`]
],
extendMarkdown: (md) => {
md.set({
breaks: true
})
md.use(require('markdown-it-plantuml'))
},
themeConfig: {
lastUpdated: '最后更新时间', // string | boolean
nav: [{
text: '首页',
link: 'http://openauth.net.cn/',
target: '_blank'
},
{
text: '在线文档',
ariaLabel: 'Proj Menu',
items: [{
text: 'OpenAuth.Net开源后端',
link: '/core/',
target: '_blank'
},
{
text: 'OpenAuth.Pro(vue3版本)',
link: '/pro/',
target: '_blank'
},
{
text: 'OpenAuth.Pro(vue2版本)',
link: '/vue2/',
target: '_blank'
}
],
},
{
text: '项目地址',
ariaLabel: 'Proj Menu',
items: [{
text: 'gitee',
link: 'https://gitee.com/dotnetchina/OpenAuth.Net',
target: '_blank'
},
{
text: 'github',
link: 'https://github.com/yubaolee/OpenAuth.Core',
target: '_blank'
},
],
},
{
text: '战略合作',
ariaLabel: 'Proj Menu',
items: [{
text: 'Variant Form - 可视化低代码表单',
link: 'https://www.vform666.com/',
target: '_blank'
},
{
text: 'SqlSugar',
link: 'https://www.donet5.com/',
target: '_blank'
}
],
},
],
sidebar: {
'/core/': [
['', '项目介绍'],
{
title: '后端开发', // 必要的
path: 'start', // 可选的, 标题的跳转链接,应为绝对路径且必须存在
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['start', 'specialist', 'deploy', 'deployapi', 'devnew', 'multidbs', 'multitenant', 'unitwork','sqlsugar', 'entity','dynamicapi', 'datavalidation', 'log', 'identity', 'job', 'cache', 'unittest','changesdk'],
},
{
title: '权限控制', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['moduleauth','apiauth', 'logininfo', 'dataprivilege', 'datapropertyrule'],
},
{
title: '表单设计', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['form'],
},
{
title: '工作流', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['flowinstance','flowinstanceconcept','flowinstancedev', 'thirdparty'],
},
{
title: '前端开发', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['wwwarchitect'],
},
{
title: '更新日志', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['changelog', 'routineupdate'],
},
'faq',
],
'/pro/': [
['', '项目介绍'],
'deploy',
'structure',
'devnew',
{
title: '基础开发', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['router','openurl','keepalive'],
},
'datapropertyrule',
'printerplan',
{
title: '表单设计', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['startform','urlform','dragform','dragformdetail'],
},
{
title: '工作流', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['startflow','form'],
},
'components',
'faq',
],
'/vue2/': [
['', '项目介绍'],
'deploy',
'structure',
'devnew',
{
title: '基础开发', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['router','openurl','keepalive'],
},
'datapropertyrule',
'printerplan',
{
title: '表单设计', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['startform','dragform','dragformdetail'],
},
{
title: '工作流', // 必要的
sidebarDepth: 1, // 可选的, 默认值是 1
collapsable: false,
children: ['startflow','form'],
},
'components',
'faq',
]
},
},
}

View File

@@ -1,28 +0,0 @@
/*
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
* @Date: 2024-06-19 20:41:42
* @LastEditTime: 2024-06-19 20:48:04
* @Description:
* @
* @Copyright (c) 2024 by yubaolee | ahfu~ , All Rights Reserved.
*/
// .vuepress/enhanceApp.js
export default ({ router }) => {
if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {
// 百度统计代码
var _hmt = _hmt || []
;(function () {
var hm = document.createElement('script')
hm.src = 'https://hm.baidu.com/hm.js?93a7b9a145222f9b7109d643a0c58f8d'
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})();
// 路由切换时触发百度统计
router.afterEach(function (to) {
if (window._hmt) {
window._hmt.push(['_trackPageview', to.fullPath])
}
})
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -1,25 +0,0 @@
---
home: true
heroImage: /logo.png
heroText: OpenAuth.Net
tagline: 最好用的.net权限工作流框架,最实用的.net/vue前后端分离方案
actionText: 快速上手 →
actionLink: /core/start
features:
- title: 简洁至上
details: 源于Martin Fowler企业级应用开发思想及最新技术组合。
- title: 灵活控制
details: 超强的自定义权限控制功能,可灵活配置用户、角色可访问的数据权限。
- title: 超酷体验
details: 可拖拽的表单设计,可视化流程设计。
- title: 紧随潮流
details: 最新的.net sdk配合最炫的vue框架。
- title: 功能强大
details: 角色授权、代码生成、API鉴权、智能打印、数据权限、拖拽表单、工作流引擎、定时任务。
- title: 主流技术
details: IdentityServer、EF、SqlSugar、Quartz、AutoFac、WebAPI、Swagger、Mock、NUnit、VUE2、VUE3、Element-ui、Element-plus。
footer: Copyright © 2025- yubaolee
---

View File

@@ -1,2 +0,0 @@
{
}

View File

@@ -1,79 +0,0 @@
# 部署MVC
::: tip 提示
因.net core内部有自托管的Web服务器推荐使用控制台方式部署。本内容基于控制台命令的方式。如果部署到IIS请自行百度:cold_sweat:
:::
## 生成发布文件
* 修改部署环境的连接字符串信息,特别注意是`appsettings.Production.json`文件:
![说明](/configmvc.png "说明")
::: warning 注意
决定系统部署后读取`appsettings.json`还是`appsettings.Production.json`是通过操作系统的环境变量`ASPNETCORE_ENVIRONMENT`来控制的。
在centos切换成正式可以用
```shell
export ASPNETCORE_ENVIRONMENT=Production
```
或者修改/etc/profile配置在结尾添加
```shell
ASPNETCORE_ENVIRONMENT=Production
export ASPNETCORE_ENVIRONMENT
```
然后刷新:
```shell
source /etc/profile
```
在Widows系统中增加对应环境变量即可
:::
* 直接在解决方案资源管理器中选中OpenAuth.Mvc右键【发布】出现下面的配置框使用文件系统即可
![说明](http://pj.openauth.net.cn/zentao/file-read-8.png "说明")
* 发布完成后可以在输出目录看到发布详情(红色框内即为发布的文件夹):
![说明](http://pj.openauth.net.cn/zentao/file-read-69.png "说明")
## 部署OpenAuth.Mvc
将发布后的文件拷贝到服务器文件夹。直接使用`dotnet openauth.mvc.dll` 命令启动。启动成功后使用浏览器打开http://localhost:1802 即可访问,如下图所示:
![说明](/mvcmain.png "说明")
## jenkins部署OpenAuth.Mvc
OpenAuth.Net采用的是gitee托管源码只需使用Gitee WebHook构建触发器。配置如下
![说明](/giteesource.png "说明")
做好上面的配置后代码提交时就会触发jenkins工作。剩下的就是编写自己的构建脚本。增加构建步骤选择执行Shell。并输入以下脚本
```shell
#!/bin/bash
kill -9 $(ps -ef|grep OpenAuth.Mvc.dll|grep -v grep|awk '{print $2}')
#项目启动之后才不会被Jenkins杀掉。
export BUILD_ID=dontKillMe
pwd
echo $PATH
dotnet restore # 还原nuget包
cd ./OpenAuth.Mvc
dotnet build # 编译
rm -rf /data/openauthmvc #最终站点路径
mkdir /data/openauthmvc
dotnet publish -c:Release -o /data/openauthmvc # 生成发布文件到/data/openauthmvc。如果服务器上有多个.NET版本加上目标版本号-f net6.0
nohup dotnet /data/openauthmvc/OpenAuth.Mvc.dll &
echo '============================end build======================================='
```

View File

@@ -1,26 +0,0 @@
# 后端开发规范
## 数据库表及字段命名
SqlServer采用PascalCase命名Oracle采用全大写命名其他数据库采用camelCase命名。
::: tip 提示
开源版代码生成时通过表结尾Dtbl来判断是否是生成明细表代码。因此建议数据库表命名时按子系统名称+业务名称+表尾,其中表尾名称规则:
- 基础主数据以Mst结尾
- 普通业务表以Tbl结尾
- 业务明细表以Dtbl结尾
WMS系统入库订单明细表WmsInboundOrderDtbl
:::
## 数据库字段类型
主键id统一使用Domain:PrimaryKey针对SqlServer数据库非Sql Server根据需要定义
状态类,标识类的字段统一使用bit not null
表示分类的字段统一使用PrimaryKey。数值从Category中获取。

View File

@@ -1,124 +0,0 @@
# 前端结构
OpenAuth.Mvc前端采用典型的mvc结构部署其中
* Views: 为静态资源页面最终会渲染成html实在不懂百度Asp.Net Mvc中的View
* wwwroot/js: 通用的js组件
* wwwroot/userJs: 业务相关的js代码。通常一个csthml页面对应一个userJs中的js文件。如`Categories\Index.cshtml`对应`userJs\categories.js`
```shell
|-- OpenAuth.Mvc
|-- Views
| |-- _ViewStart.cshtml
| |-- Categories
| | |-- Index.cshtml
| |-- DataPrivilegeRules
| | |-- index.cshtml
| |-- Error
| | |-- Auth.cshtml
| |-- FlowInstances
| | |-- Detail.cshtml
| | |-- Disposed.cshtml
| | |-- Edit.cshtml
| | |-- Index.cshtml
| | |-- Verification.cshtml
| | |-- Wait.cshtml
| |-- FlowSchemes
| | |-- Design.cshtml
| | |-- Index.cshtml
| | |-- NodeInfo.cshtml
| | |-- Preview.cshtml
| |-- Forms
| | |-- Edit.cshtml
| | |-- index.cshtml
| | |-- Preview.cshtml
| |-- Home
| | |-- git.cshtml
| | |-- Index.cshtml
| | |-- Main.cshtml
| |-- Login
| | |-- Index.cshtml
| |-- ModuleManager
| | |-- Assign.cshtml
| | |-- Index.cshtml
| |-- OpenJobs
| | |-- index.cshtml
| |-- OrgManager
| | |-- Index.cshtml
| |-- Redirects
| | |-- IdentityAuth.cshtml
| |-- Resources
| | |-- Assign.cshtml
| | |-- Index.cshtml
| |-- RoleManager
| | |-- Assign.cshtml
| | |-- Index.cshtml
| |-- Shared
| | |-- _Layout.cshtml
| |-- SysLogs
| | |-- index.cshtml
| |-- SysMessages
| | |-- index.cshtml
| |-- UserManager
| | |-- ChangePassword.cshtml
| | |-- Index.cshtml
| | |-- Profile.cshtml
| |-- WmsInboundOrderTbls
| |-- index.cshtml
|-- wwwroot
|-- css
| |-- formpreview.css
| |-- images.css
| |-- login.css
| |-- main.css
| |-- treetable.css
|-- js
|-- bodyTab.js
|-- bootstrap.js
|-- cookie.js
|-- droptree.js
|-- dtree.js
|-- flowlayout.js
|-- iconPicker.js
|-- index.js
|-- leftNav.js
|-- openauth.js
|-- slimscroll.js
|-- utils.js
|-- vue.js
|-- ztree.js
|-- userJs
|-- assignModule.js
|-- assignResource.js
|-- assignRole.js
|-- categories.js
|-- changePwd.js
|-- dataprivilegerules.js
|-- flowinstanceDetail.js
|-- flowInstanceDisposed.js
|-- flowInstanceEdit.js
|-- flowInstances.js
|-- flowInstanceWait.js
|-- flowSchemeDesign.js
|-- flowSchemePreview.js
|-- flowSchemes.js
|-- formEdit.js
|-- forms.js
|-- login.js
|-- main.js
|-- modules.js
|-- nodeInfo.js
|-- openjobs.js
|-- orgs.js
|-- preview.js
|-- profile.js
|-- resources.js
|-- roles.js
|-- syslogs.js
|-- sysmessages.js
|-- users.js
|-- verification.js
|-- wmsinboundordertbls.js
```

View File

@@ -1,9 +0,0 @@
{
"scripts": {
"dev": "vuepress dev .",
"build": "vuepress build ."
},
"devDependencies": {
"vuepress": "^1.4.1"
}
}

View File

@@ -1,9 +0,0 @@
# 常见问题处理
## vue运行的时候报错
在启动企业版的时候,如果提示下面错误:
![](/oidcerror.png)
请使用`npm run dev`命令来启动项目

27
newdocs/README.md Normal file
View File

@@ -0,0 +1,27 @@
# open-auth-net-官方文档
The Site is generated using [vuepress](https://vuepress.vuejs.org/) and [vuepress-theme-plume](https://github.com/pengzhanbo/vuepress-theme-plume)
## Install
```sh
npm i
```
## Usage
```sh
# start dev server
npm run docs:dev
# build for production
npm run docs:build
# preview production build in local
npm run docs:preview
# update vuepress and theme
npm run vp-update
```
## Documents
- [vuepress](https://vuepress.vuejs.org/)
- [vuepress-theme-plume](https://theme-plume.vuejs.press/)

27
newdocs/README.zh-CN.md Normal file
View File

@@ -0,0 +1,27 @@
# open-auth-net-官方文档
网站使用 [vuepress](https://vuepress.vuejs.org/) 和 [vuepress-theme-plume](https://github.com/pengzhanbo/vuepress-theme-plume) 构建生成。
## Install
```sh
npm i
```
## Usage
```sh
# 启动开发服务
npm run docs:dev
# 构建生产包
npm run docs:build
# 本地预览生产服务
npm run docs:preview
# 更新 vuepress 和主题
npm run vp-update
```
## 文档
- [vuepress](https://vuepress.vuejs.org/)
- [vuepress-theme-plume](https://theme-plume.vuejs.press/)

View File

@@ -0,0 +1,31 @@
/*
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
* @Date: 2025-04-23 23:37:29
* @LastEditTime: 2025-04-26 15:00:36
* @Description:
* Copyright (c) 2025 by yubaolee | ahfu~ , All Rights Reserved.
*/
import { defineClientConfig } from 'vuepress/client'
import { h } from 'vue'
import { Layout } from 'vuepress-theme-plume/client'
// import RepoCard from 'vuepress-theme-plume/features/RepoCard.vue'
// import NpmBadge from 'vuepress-theme-plume/features/NpmBadge.vue'
// import NpmBadgeGroup from 'vuepress-theme-plume/features/NpmBadgeGroup.vue'
// import Swiper from 'vuepress-theme-plume/features/Swiper.vue'
// import CustomComponent from './theme/components/Custom.vue'
// import './theme/styles/custom.css'
import AsideNav from './theme/components/AsideNav.vue'
export default defineClientConfig({
setup() {
// setupThemeColors()
},
layouts: {
Layout: h(Layout, null, {
'aside-outline-after': () => h(AsideNav),
}),
},
})

View File

@@ -0,0 +1,173 @@
import { viteBundler } from '@vuepress/bundler-vite'
import { defineUserConfig } from 'vuepress'
import { plumeTheme } from 'vuepress-theme-plume'
export default defineUserConfig({
base: '/',
lang: 'zh-CN',
title: 'OpenAuth.Net',
description: '最好用的.net权限工作流框架,最实用的.net/vue前后端分离方案',
head: [
// 配置站点图标
['link', { rel: 'icon', type: 'image/png', href: 'http://img.openauth.net.cn/2025-04-24-00-50-24.png' }],
],
bundler: viteBundler(),
shouldPrefetch: false, // 站点较大,页面数量较多时,不建议启用
theme: plumeTheme({
/* 添加您的部署域名, 有助于 SEO, 生成 sitemap */
hostname: 'http://doc.openauth.net.cn',
/* 文档仓库配置,用于 editLink */
// docsRepo: '',
// docsDir: 'docs',
// docsBranch: '',
/* 页内信息 */
// editLink: true,
// lastUpdated: true,
// contributors: true,
// changelog: false,
/**
* 博客
* @see https://theme-plume.vuejs.press/config/basic/#blog
*/
// blog: false, // 禁用博客
// blog: {
// postList: true, // 是否启用文章列表页
// tags: true, // 是否启用标签页
// archives: true, // 是否启用归档页
// categories: true, // 是否启用分类页
// postCover: 'right', // 文章封面位置
// pagination: 15, // 每页显示文章数量
// },
/* 博客文章页面链接前缀 */
article: '/article/',
/**
* 编译缓存,加快编译速度
* @see https://theme-plume.vuejs.press/config/basic/#cache
*/
cache: 'filesystem',
/**
* 为 markdown 文件自动添加 frontmatter 配置
* @see https://theme-plume.vuejs.press/config/basic/#autofrontmatter
*/
// autoFrontmatter: {
// permalink: true, // 是否生成永久链接
// createTime: true, // 是否生成创建时间
// title: true, // 是否生成标题
// },
/* 本地搜索, 默认启用 */
search: { provider: 'local' },
/**
* Algolia DocSearch
* 启用此搜索需要将 本地搜索 search 设置为 false
* @see https://theme-plume.vuejs.press/config/plugins/search/#algolia-docsearch
*/
// search: {
// provider: 'algolia',
// appId: '',
// apiKey: '',
// indexName: '',
// },
/**
* Shiki 代码高亮
* @see https://theme-plume.vuejs.press/config/plugins/code-highlight/
*/
// codeHighlighter: {
// twoslash: true, // 启用 twoslash
// whitespace: true, // 启用 空格/Tab 高亮
// lineNumbers: true, // 启用行号
// },
/* 文章字数统计、阅读时间,设置为 false 则禁用 */
// readingTime: true,
/**
* markdown
* @see https://theme-plume.vuejs.press/config/markdown/
*/
markdown: {
plantuml: true,
// abbr: true, // 启用 abbr 语法 *[label]: content
// annotation: true, // 启用 annotation 语法 [+label]: content
// pdf: true, // 启用 PDF 嵌入 @[pdf](/xxx.pdf)
// caniuse: true, // 启用 caniuse 语法 @[caniuse](feature_name)
// plot: true, // 启用隐秘文本语法 !!xxxx!!
bilibili: true, // 启用嵌入 bilibili视频 语法 @[bilibili](bid)
// youtube: true, // 启用嵌入 youtube视频 语法 @[youtube](video_id)
// artPlayer: true, // 启用嵌入 artPlayer 本地视频 语法 @[artPlayer](url)
// audioReader: true, // 启用嵌入音频朗读功能 语法 @[audioReader](url)
// icons: true, // 启用内置图标语法 :[icon-name]:
// codepen: true, // 启用嵌入 codepen 语法 @[codepen](user/slash)
// replit: true, // 启用嵌入 replit 语法 @[replit](user/repl-name)
// codeSandbox: true, // 启用嵌入 codeSandbox 语法 @[codeSandbox](id)
// jsfiddle: true, // 启用嵌入 jsfiddle 语法 @[jsfiddle](user/id)
// npmTo: true, // 启用 npm-to 容器 ::: npm-to
// demo: true, // 启用 demo 容器 ::: demo
// repl: { // 启用 代码演示容器
// go: true, // ::: go-repl
// rust: true, // ::: rust-repl
// kotlin: true, // ::: kotlin-repl
// },
// math: { // 启用数学公式
// type: 'katex',
// },
// chartjs: true, // 启用 chart.js
// echarts: true, // 启用 ECharts
// mermaid: true, // 启用 mermaid
// flowchart: true, // 启用 flowchart
// image: {
// figure: true, // 启用 figure
// lazyload: true, // 启用图片懒加载
// mark: true, // 启用图片标记
// size: true, // 启用图片大小
// },
// include: true, // 在 Markdown 文件中导入其他 markdown 文件内容
// imageSize: 'local', // 启用 自动填充 图片宽高属性,避免页面抖动
},
/**
* 水印
* @see https://theme-plume.vuejs.press/guide/features/watermark/
*/
// watermark: true,
/**
* 评论 comments
* @see https://theme-plume.vuejs.press/guide/features/comments/
*/
// comment: {
// provider: '', // "Artalk" | "Giscus" | "Twikoo" | "Waline"
// comment: true,
// repo: '',
// repoId: '',
// category: '',
// categoryId: '',
// mapping: 'pathname',
// reactionsEnabled: true,
// inputPosition: 'top',
// },
/**
* 资源链接替换
* @see https://theme-plume.vuejs.press/guide/features/replace-assets/
*/
// replaceAssets: 'https://cdn.example.com',
/**
* 加密功能
* @see https://theme-plume.vuejs.press/guide/features/encryption/
*/
// encrypt: {},
}),
})

View File

@@ -0,0 +1,16 @@
/*
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
* @Date: 2025-04-23 20:26:48
* @LastEditTime: 2025-04-26 10:31:59
* @Description: 顶部超链接
* Copyright (c) 2025 by yubaolee | ahfu~ , All Rights Reserved.
*/
import { defineNavbarConfig } from 'vuepress-theme-plume'
export const navbar = defineNavbarConfig([
{ text: '首页', link: 'http://www.openauth.net.cn', icon: 'mdi:home' },
{ text: '文档首页', link: '/', icon: 'mdi:book-open-page-variant' },
{ text: '开源版文档', link: '/notes/core/README.md', icon: 'logos:opensource' },
{ text: 'vue3版文档', link: '/notes/pro/README.md', icon: 'material-icon-theme:vue' },
{ text: 'vue2版文档', link: '/notes/vue2/README.md', icon: 'material-icon-theme:vue' }
])

View File

@@ -0,0 +1,120 @@
/*
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
* @Date: 2025-04-23 20:26:48
* @LastEditTime: 2025-05-07 20:49:08
* @Description: 笔记配置
* Copyright (c) 2025 by yubaolee | ahfu~ , All Rights Reserved.
*/
import { defineNoteConfig, defineNotesConfig } from 'vuepress-theme-plume'
//开源后端文档
const coreNote = defineNoteConfig({
dir: 'core',
link: '/core',
sidebar: [
'',
{
text: '基础开发',
collapsed: false,
items: [
'start', 'specialist', 'deploy', 'deployapi', 'devnew', 'multidbs', 'multitenant', 'unitwork','sqlsugar', 'entity','dynamicapi', 'datavalidation', 'log', 'identity', 'job', 'cache', 'unittest','changesdk'
]
},
{
text: '权限控制',
collapsed: true,
items: [
'moduleauth','apiauth', 'logininfo', 'dataprivilege', 'datapropertyrule'
]
},
{
text: '工作流',
collapsed: true,
items: ['form','flowinstance','flowinstanceconcept','flowinstancedev', 'thirdparty' ]
},
{
text: '前端开发',
collapsed: true,
items: ['wwwarchitect']
},
{
text: '其他',
collapsed: true,
items: ['changelog', 'routineupdate','faq']
}
],
})
// vue3版本
const proNote = defineNoteConfig({
dir: 'pro',
link: '/pro',
sidebar: [
'',
{
text: '基础开发',
collapsed: false,
items: ['start','deploy','structure','devnew', 'router','openurl','keepalive','datapropertyrule']
},
{
text: '内置组件',
collapsed: false,
items: ['table','querybuilder','columnsetting','components']
},
'printerplan',
{
text: '表单设计',
collapsed: true,
items: ['startform','urlform','dragform','dragformdetail']
},
{
text: '工作流',
collapsed: true,
items: ['startflow','form']
},
{
text: '其他',
collapsed: true,
items: ['faq']
}
]
})
// vue2版本
const vue2Note = defineNoteConfig({
dir: 'vue2',
link: '/vue2',
sidebar: [
'',
{
text: '基础开发',
collapsed: false,
items: [ 'deploy', 'structure', 'devnew','router','openurl','keepalive']
},
'datapropertyrule',
'printerplan',
{
text: '表单设计',
collapsed: true,
items: ['startform','dragform','dragformdetail']
},
{
text: '工作流',
collapsed: true,
items: ['startflow','form']
},
{
text: '其他',
collapsed: true,
items: ['components','faq']
}
]
})
export const notes = defineNotesConfig({
dir: 'notes',
link: '/',
notes: [coreNote, proNote, vue2Note],
})

View File

@@ -0,0 +1,76 @@
/*
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
* @Date: 2025-04-23 20:26:48
* @LastEditTime: 2025-04-24 01:27:38
* @Description: 配置
* Copyright (c) 2025 by yubaolee | ahfu~ , All Rights Reserved.
*/
import { defineThemeConfig } from 'vuepress-theme-plume'
import { navbar } from './navbar'
import { notes } from './notes'
/**
* @see https://theme-plume.vuejs.press/config/basic/
*/
export default defineThemeConfig({
logo: 'http://img.openauth.net.cn/2025-04-23-21-21-00.png',
appearance: true, // 配置 深色模式
social: [
{ icon: 'github', link: 'https://gitee.com/dotnetchina/OpenAuth.Net' },
],
// navbarSocialInclude: ['github'], // 允许显示在导航栏的 social 社交链接
// aside: true, // 页内侧边栏, 默认显示在右侧
// outline: [2, 3], // 页内大纲, 默认显示 h2, h3
/**
* 文章版权信息
* @see https://theme-plume.vuejs.press/guide/features/copyright/
*/
// copyright: true,
// prevPage: true, // 是否启用上一页链接
// nextPage: true, // 是否启用下一页链接
// createTime: true, // 是否显示文章创建时间
/* 站点页脚 */
footer: {
message: 'Copyright © 2025 <a target="_blank" href="http://www.openauth.net.cn">OpenAuth.Net</a>',
copyright: '',
},
/**
* @see https://theme-plume.vuejs.press/config/basic/#profile
*/
profile: {
avatar: 'http://img.openauth.net.cn/2025-04-23-21-21-00.png',
name: 'OpenAuth.Net官方文档',
description: '最好用的权限工作流框架',
// circle: true,
// location: '',
// organization: '',
},
navbar,
notes,
/**
* 公告板
* @see https://theme-plume.vuejs.press/guide/features/bulletin/
*/
// bulletin: {
// layout: 'top-right',
// contentType: 'markdown',
// title: '公告板标题',
// content: '公告板内容',
// },
/* 过渡动画 @see https://theme-plume.vuejs.press/config/basic/#transition */
// transition: {
// page: true, // 启用 页面间跳转过渡动画
// postList: true, // 启用 博客文章列表过渡动画
// appearance: 'fade', // 启用 深色模式切换过渡动画, 或配置过渡动画类型
// },
})

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -0,0 +1,86 @@
<!--
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
* @Date: 2025-04-26 14:59:00
* @LastEditTime: 2025-04-26 15:02:32
* @Description: 右下角导航
* Copyright (c) 2025 by yubaolee | ahfu~ , All Rights Reserved.
-->
<script setup lang="ts">
import { computed } from 'vue'
import { VPLink } from 'vuepress-theme-plume/client'
import { useRouteLocale } from 'vuepress/client'
interface Locale {
star: string
issue: string
sponsor: string
}
const locales: Record<string, Locale> = {
'/': { star: '在 gitee 上 Star', issue: '遇到问题?', sponsor: '喝杯奶茶' },
'/en/': { star: 'Star on GitHub', issue: 'Create Issues', sponsor: 'Buy me a Bubble Tea' },
}
const lang = useRouteLocale()
const locale = computed(() => locales[lang.value])
</script>
<template>
<div class="aside-nav-wrapper">
<VPLink class="link" no-icon href="https://gitee.com/dotnetchina/OpenAuth.Net">
<span class="vpi-github-star" />
<span class="link-text">{{ locale.star }}</span>
<span class="vpi-arrow-right" />
</VPLink>
<VPLink class="link" no-icon href="https://gitee.com/dotnetchina/OpenAuth.Net/issues/new">
<span class="vpi-github-issue" />
<span class="link-text">{{ locale.issue }}</span>
<span class="vpi-arrow-right" />
</VPLink>
<!-- <VPLink class="link" href="/sponsor/">
<span class="vpi-bubble-tea" />
<span class="link-text">{{ locale.sponsor }}</span>
<span class="vpi-arrow-right" />
</VPLink> -->
</div>
</template>
<style scoped>
.aside-nav-wrapper {
display: flex;
flex-direction: column;
padding: 8px 0;
margin: 16px 16px 0;
border-top: solid 1px var(--vp-c-divider);
}
.aside-nav-wrapper .link {
display: flex;
gap: 8px;
align-items: center;
font-size: 14px;
color: var(--vp-c-text-2);
transition: color var(--vp-t-color);
}
.aside-nav-wrapper .link:hover {
color: var(--vp-c-brand-1);
}
.aside-nav-wrapper .link .link-text {
flex: 1 2;
font-size: 12px;
}
.vpi-github-star {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m12 1.5l3.1 6.3l6.9 1l-5 4.8l1.2 6.9l-6.2-3.2l-6.2 3.2L7 13.6L2 8.8l6.9-1z'/%3E%3C/svg%3E");
}
.vpi-github-issue {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8 9.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3'/%3E%3Cpath fill='%23000' d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M1.5 8a6.5 6.5 0 1 0 13 0a6.5 6.5 0 0 0-13 0'/%3E%3C/svg%3E");
}
.vpi-bubble-tea {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m17.95 9l-1.478 8.69c-.25 1.463-.374 2.195-.936 2.631c-1.2.931-6.039.88-7.172 0c-.562-.436-.687-1.168-.936-2.632L5.95 9M6 9l.514-1.286a5.908 5.908 0 0 1 10.972 0L18 9M5 9h14m-7 0l4-7m-5.99 12h.01m1 4h.01m1.99-2h.01'/%3E%3C/svg%3E");
}
</style>

View File

@@ -0,0 +1,11 @@
<script setup lang="ts">
import { ref } from 'vue'
const message = ref('Hello World!')
</script>
<template>
<div class="my-custom-content">
{{ message }}
</div>
</template>

View File

@@ -0,0 +1,6 @@
declare module '*.vue' {
import type { ComponentOptions } from 'vue'
const comp: ComponentOptions
export default comp
}

View File

@@ -0,0 +1,50 @@
:root {
/** 主题颜色 */
/*
--vp-c-brand-1: #5086a1;
--vp-c-brand-2: #6aa1b7;
--vp-c-brand-3: #8cccd5;
--vp-c-brand-soft: rgba(131, 208, 218, 0.314);
*/
/** 背景颜色 */
/*
--vp-c-bg: #fff;
--vp-c-bg-alt: #f6f6f7;
--vp-c-bg-elv: #fff;
--vp-c-bg-soft: #f6f6f7;
*/
/** 文本颜色 */
/*
--vp-c-text-1: rgba(60, 60, 67);
--vp-c-text-2: rgba(60, 60, 67, 0.78);
--vp-c-text-3: rgba(60, 60, 67, 0.56);
*/
}
/** 深色模式 */
[data-theme="dark"] {
/*
--vp-c-brand-1: #8cccd5;
--vp-c-brand-2: #6aa1b7;
--vp-c-brand-3: #5086a1;
--vp-c-brand-soft: rgba(131, 208, 218, 0.314);
*/
/*
--vp-c-bg: #1b1b1f;
--vp-c-bg-alt: #161618;
--vp-c-bg-elv: #202127;
--vp-c-bg-soft: #202127;
*/
/*
--vp-c-text-1: rgba(255, 255, 245, 0.86);
--vp-c-text-2: rgba(235, 235, 245, 0.6);
--vp-c-text-3: rgba(235, 235, 245, 0.38);
*/
}

49
newdocs/docs/README.md Normal file
View File

@@ -0,0 +1,49 @@
---
pageLayout: home
externalLinkIcon: false
config:
-
type: hero
full: false
background: tint-plate
hero:
name: OpenAuth.Net
tagline:
text: 最好用的.net权限工作流框架,最实用的.net/vue前后端分离方案
actions:
-
theme: brand
text: 快速开始
link: /core/start/
-
theme: alt
text: Gitee →
link: https://gitee.com/dotnetchina/OpenAuth.Net
-
type: features
features:
-
icon: 💻
title: 主流技术
details: EF、SqlSugar、Quartz、AutoFac、WebAPI、Swagger、Mock、NUnit、IdentityServer4、VUE2、VUE3、Element-ui、Element-plus
-
icon: 🚀
title: 功能强大
details: 角色授权、代码生成、API鉴权、智能打印、数据权限、拖拽表单、工作流引擎、定时任务、多租户、动态API
-
icon: 💾
title: 多数据库支持
details: 支持sqlserver、mysql、Oracle、PostgreSql数据库理论上支持所有数据库
-
icon: 🎨
title: 超酷体验
details: 可拖拽的表单设计,可视化流程设计
-
icon: 🔌
title: 灵活控制
details: 超强的自定义权限控制功能,可灵活配置用户、角色可访问的数据权限。
-
icon: 📚
title: 有章可依
details: 深入参考《企业应用架构模式》《重构与模式》《领域驱动设计模式与实践》等巨著完成每一行代码编写
---

View File

@@ -1,4 +1,8 @@
---
title: 框架简介
createTime: 2025/04/20 21:49:49
permalink: /core/
---
![LOGO](/logocore.png "1.png")
OpenAuth.Net是基于最新版.Net的开源权限工作流快速开发框架。源于Martin Fowler企业级应用开发思想及最新技术组合SqlSugar、EF、Quartz、AutoFac、WebAPI、Swagger、Mock、NUnit、Vue2/3、Element-ui/plus、IdentityServer等。核心模块包括角色授权、代码生成、API鉴权、智能打印、表单设计、工作流、定时任务等。
@@ -11,20 +15,13 @@ OpenAuth.Net是基于最新版.Net的开源权限工作流快速开发框架。
gitee上面两个版本。其中
* [OpenAuth.Net](https://gitee.com/dotnetchina/OpenAuth.Net) 默认SDK版本为.Net 9.0.100,如果需要切换到.Net其他版本请参考[切换sdk版本](http://doc.openauth.net.cn/core/changesdk.html)
* [OpenAuth.Net](https://gitee.com/dotnetchina/OpenAuth.Net) 默认SDK版本为.Net 9.0.100,如果需要切换到.Net其他版本请参考[切换sdk版本](http://doc.openauth.net.cn/core/changesdk)
* [OpenAuth.Core](https://gitee.com/yubaolee/OpenAuth.Core) 的SDK版本为.Net Core 3.1.100,已停止维护,不推荐使用。
.Net目前SDK升级特别方便。请参考[3分钟的时间把.net core 3.1的升级到.NET 5](https://www.cnblogs.com/yubaolee/p/Net3ToNet5.html)所以不要纠结SDK版本问题。
:::
## 技术栈
![](https://img.shields.io/badge/release-6.0-blue) ![](https://img.shields.io/badge/SqlSugar-5.1.4-blue) ![](https://img.shields.io/badge/IdentityServer4-3.0.1-blue) ![](https://img.shields.io/badge/quartz-3.0.7-blue) ![](https://img.shields.io/badge/Autofac-5.2-blue) ![](https://img.shields.io/badge/NUnit-3.13.1-blue) ![](https://img.shields.io/badge/SwaggerUI-OAS%203.0-blue) ![](https://img.shields.io/badge/Moq-4.13-blue) ![](https://img.shields.io/badge/log4net-2.0.12-blue)
![](https://img.shields.io/badge/vue-2.6.10-brightgreen) ![](https://img.shields.io/badge/vue-3.3.4-brightgreen) ![](https://img.shields.io/badge/vite-4.4.9-brightgreen) ![](https://img.shields.io/badge/element--ui-2.10.1-brightgreen) ![](https://img.shields.io/badge/element--plus-2.3.9-brightgreen) ![](https://img.shields.io/badge/node-%3E%3D4.0-brightgreen) ![](https://img.shields.io/badge/npm-9.7.1-brightgreen) ![](https://img.shields.io/badge/layui-2.8.6-brightgreen)
## 核心看点
* 支持最新版.Net 9.0.100
@@ -33,15 +30,15 @@ gitee上面两个版本。其中
* 超强的自定义权限控制功能,请参考:[通用权限设计与实现](https://www.cnblogs.com/yubaolee/p/DataPrivilege.html)
* 完整API鉴权可以控制角色可访问的API资源及模块功能字段可见及是否返回请参考[按角色授权API资源](http://doc.openauth.net.cn/core/apiauth.html#%E6%8C%89%E8%A7%92%E8%89%B2%E6%8E%88%E6%9D%83api%E8%B5%84%E6%BA%90) 及 [字段权限](http://doc.openauth.net.cn/core/datapropertyrule.html)
* 完整API鉴权可以控制角色可访问的API资源及模块功能字段可见及是否返回请参考[按角色授权API资源](http://doc.openauth.net.cn/core/apiauth.html#%E6%8C%89%E8%A7%92%E8%89%B2%E6%8E%88%E6%9D%83api%E8%B5%84%E6%BA%90) 及 [字段权限](http://doc.openauth.net.cn/core/datapropertyrule)
* 可拖拽的表单设计。详情:[可拖拽表单](http://doc.openauth.net.cn/pro/dragform.html)
* 可拖拽的表单设计。详情:[可拖拽表单](http://doc.openauth.net.cn/pro/dragform)
* 可视化流程设计。[可视化流程设计](http://doc.openauth.net.cn/pro/startflow.html)
* 可视化流程设计。[可视化流程设计](http://doc.openauth.net.cn/pro/startflow)
* 全网最好用的打印解决方案。详情:[智能打印](http://doc.openauth.net.cn/pro/printerplan.html)
* 全网最好用的打印解决方案。详情:[智能打印](http://doc.openauth.net.cn/pro/printerplan)
* 基于Quartz.Net的定时任务控制,可随时启/停可视化配置Cron表达式功能请参考[定时任务](http://doc.openauth.net.cn/core/job.html)
* 基于Quartz.Net的定时任务控制,可随时启/停可视化配置Cron表达式功能请参考[定时任务](http://doc.openauth.net.cn/core/job)
* 基于CodeSmith的代码生成功能可快速生成带有头/明细结构的页面
@@ -51,7 +48,7 @@ gitee上面两个版本。其中
* 支持多租户
* 支持搭建自己的IdentityServer服务器实现基于OAuth2的登录体系请参考[登录认证及OAuth集成](http://doc.openauth.net.cn/core/identity.html)
* 支持搭建自己的IdentityServer服务器实现基于OAuth2的登录体系请参考[登录认证及OAuth集成](http://doc.openauth.net.cn/core/identity)
* 建立三方对接规范,已有系统可以无缝对接流程引擎
@@ -59,9 +56,4 @@ gitee上面两个版本。其中
* 后端采用 .net +EF + sqlsugar + autofac + quartz +IdentityServer4 + nunit + swagger
* 设计工具 PowerDesigner +PDManer + Enterprise Architect
* 设计工具 PowerDesigner +PDManer + Enterprise Architect

View File

@@ -1,4 +1,8 @@
# API权限控制
---
title: API权限控制
createTime: 2025/04/23 21:03:10
permalink: /core/apiauth/
---
在使用OpenAuth.WebApi过程中系统会对所有的Api进行权限控制。如果没有登录就访问Api接口会提示下面信息

View File

@@ -1,4 +1,8 @@
# 缓存机制
---
title: 缓存机制
createTime: 2025/04/23 21:03:10
permalink: /core/cache/
---
## 服务器缓存
@@ -30,12 +34,12 @@ public static void InitAutofac(ContainerBuilder builder)
_cacheContext.Set(currentSession.Token, currentSession, DateTime.Now.AddDays(10));
```
::: warning 注意事项1
::: warning 注意1
默认使用的是.net的内存Cache在用IIS发布后由于IIS本身存在自动回收的机制会导致系统缓存20分钟就会失效。
:::
::: warning 注意事项2
::: warning 注意2
如果使用Redis缓存注意调整配置文件中关于redis的配置
```csharp

View File

@@ -1,4 +1,8 @@
# 版本发布
---
title: 版本发布
createTime: 2025/04/23 21:03:10
permalink: /core/changelog/
---
### v7.0
@@ -46,13 +50,13 @@
### v6.1
* 全网最好用的打印解决方案。详情:[智能打印](http://doc.openauth.net.cn/pro/printerplan.html)
* 全网最好用的打印解决方案。详情:[智能打印](http://doc.openauth.net.cn/pro/printerplan)
* 增加PDManer数据结构说明;
### v6.0
* 全面支持SqlSugar Orm。详情[sqlsugar访问数据库](http://doc.openauth.net.cn/core/sqlsugar.html)
* 全面支持SqlSugar Orm。详情[sqlsugar访问数据库](http://doc.openauth.net.cn/core/sqlsugar)
* 全面更新mvc版本升级layui版本至最新v2.8.11
@@ -118,7 +122,7 @@
* 【新增】调整APP层文件结构按功能划分
* 【新增】支持同时配置多个类型数据库的连接字符串,详见:[这里](http://doc.openauth.net.cn/core/multidbs.html)
* 【新增】支持同时配置多个类型数据库的连接字符串,详见:[这里](http://doc.openauth.net.cn/core/multidbs)
### v3.0
@@ -166,7 +170,7 @@
* 【新增】企业版代码生成器,可以快速生成带有头/明细结构的页面;
* 【新增】数据权限控制,超强的自定义权限控制功能。详见:[这里](https://www.cnblogs.com/yubaolee/p/DataPrivilege.html)
* 【新增】数据权限控制,超强的自定义权限控制功能。详见:[这里](https://www.cnblogs.com/yubaolee/p/DataPrivilege)
* 【新增】完整的字段权限控制可以控制字段可见及API是否返回字段值

View File

@@ -1,4 +1,8 @@
# 切换sdk版本
---
title: 切换sdk版本
createTime: 2025/04/23 21:03:10
permalink: /core/changesdk/
---
OpenAuth.Net最新版默认使用.Net SDK 9.0.100。如果你使用的是其他版本的sdk如.net 6.0/7.0等打开项目需要调整csproj项目文件的TargetFramework。用记事本等工具打开 `Infrastructure.csproj` `OpenAuth.Repository.csproj` `OpenAuth.App.csproj` `OpenAuth.Mvc.csproj` `OpenAuth.WebApi.csproj` `OpenAuth.IdentityServer.csproj`,将
```csharp

View File

@@ -1,3 +1,7 @@
# 数据权限
---
title: 数据权限
createTime: 2025/04/23 21:03:10
permalink: /core/dataprivilege/
---
关于数据权限控制,可以详细查看博文:[通用权限设计与实现](https://www.cnblogs.com/yubaolee/p/DataPrivilege.html)

View File

@@ -1,5 +1,8 @@
# 字段权限
---
title: 字段权限
createTime: 2025/04/23 21:03:10
permalink: /core/datapropertyrule/
---
::: warning 注意
字段权限只针对【非系统模块】有效即在添加新模块的时候需要设置模块属性“是否系统”为false。
@@ -82,6 +85,6 @@ return result;
完成代码编写后,在【基础配置】--【角色管理】--【为角色分配模块】最后为角色分配【可见字段】中分配权限
![](/roleassignproperty.png)
![2025-04-24-00-27-37](http://img.openauth.net.cn/2025-04-24-00-27-37.png)

View File

@@ -1,8 +1,14 @@
# WebApi请求验证
---
title: 接口数据验证
createTime: 2025/04/23 21:03:10
permalink: /core/datavalidation/
---
框架提供灵活的实体模型验证功能。可以方便地对实体进行验证。只需两步即可:
数据验证是做接口开发时一个非常重要的功能它用来确保调用API时传入的数据完整和正确。框架提供灵活的实体模型验证功能。可以方便地对实体进行验证。只需两步即可:
1. 在实体类中使用特性Attributes来定义验证规则。
2. 业务代码中执行验证
## 增加注解
## 定义验证规则
在请求参数中添加验证注解
@@ -37,7 +43,7 @@ namespace OpenAuth.App.Request
}
```
## 业务代码中验证
## 执行验证
在OpenAuth.App中调用验证

View File

@@ -0,0 +1,117 @@
---
title: 部署MVC
createTime: 2025/04/23 21:03:10
permalink: /core/deploy/
---
::: tip 提示
因.net core内部有自托管的Web服务器推荐使用控制台方式部署。本内容基于控制台命令的方式。如果部署到IIS请自行百度:cold_sweat:
:::
## 生成发布文件
* 修改部署环境的连接字符串信息,特别注意是`appsettings.Production.json`文件:
![说明](http://img.openauth.net.cn/2025-04-24-00-20-11.png)
::: warning 注意
决定系统部署后读取`appsettings.json`还是`appsettings.Production.json`是通过操作系统的环境变量`ASPNETCORE_ENVIRONMENT`来控制的。
在centos切换成正式可以用
```shell
export ASPNETCORE_ENVIRONMENT=Production
```
或者修改/etc/profile配置在结尾添加
```shell
ASPNETCORE_ENVIRONMENT=Production
export ASPNETCORE_ENVIRONMENT
```
然后刷新:
```shell
source /etc/profile
```
在Widows系统中增加对应环境变量即可
:::
* 直接在解决方案资源管理器中选中OpenAuth.Mvc右键【发布】出现下面的配置框使用文件系统即可
![2025-04-24-00-21-09](http://img.openauth.net.cn/2025-04-24-00-21-09.png)
* 发布完成后可以在输出目录看到发布详情:
![2025-04-24-14-15-58](http://img.openauth.net.cn/2025-04-24-14-15-58.png)
## 部署&启动
如果是windows系统可以直接运行`OpenAuth.Mvc.exe`启动。
如果是linux系统将发布后的文件拷贝到服务器文件夹。直接使用`dotnet openauth.mvc.dll` 命令启动。
启动成功后使用浏览器打开[http://localhost:1802](http://localhost:1802) 即可访问,如下图所示:
![2025-04-24-00-32-42](http://img.openauth.net.cn/2025-04-24-00-32-42.png)
## docker部署
框架自带的dockerfile文件会同时生成webapi、mvc、identity三个项目可以根据需要调整后使用。使用方式如下
```shell
# 构建镜像
docker build -f Dockerfile -t openauthapi-img .
# 运行容器
docker run --network="host" -d -p 52789:52789 -p 1802:1802 -p 12796:12796 openauthapi-img
```
## jenkins无容器部署
OpenAuth.Net采用的是gitee托管源码只需使用Gitee WebHook构建触发器。配置如下
![2025-04-24-00-22-55](http://img.openauth.net.cn/2025-04-24-00-22-55.png)
做好上面的配置后代码提交时就会触发jenkins工作。剩下的就是编写自己的构建脚本。增加构建步骤选择执行Shell。并输入以下脚本
```shell
#!/bin/bash
kill -9 $(ps -ef|grep OpenAuth.Mvc.dll|grep -v grep|awk '{print $2}')
#项目启动之后才不会被Jenkins杀掉。
export BUILD_ID=dontKillMe
pwd
echo $PATH
dotnet restore # 还原nuget包
cd ./OpenAuth.Mvc
dotnet build # 编译
rm -rf /data/openauthmvc #最终站点路径
mkdir /data/openauthmvc
dotnet publish -c:Release -o /data/openauthmvc # 生成发布文件到/data/openauthmvc。如果服务器上有多个.NET版本加上目标版本号-f net6.0
nohup dotnet /data/openauthmvc/OpenAuth.Mvc.dll &
echo '============================end build======================================='
```
## jenkins容器部署
如果需要jenkins配合自动部署启动可以将上面的shell调整如下
```shell
# 停止并删除所有与 openauthapi-img 镜像相关的容器
docker ps -a --filter "ancestor=openauthapi-img" --format "{{.ID}}" | xargs -r docker stop
# 删除所有与 openauthapi-img 镜像相关的容器
docker ps -a --filter "ancestor=openauthapi-img" --format "{{.ID}}" | xargs -r docker rm
#docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
cd /var/lib/jenkins/workspace/openauth.webapi
# 构建镜像
docker build -f Dockerfile -t openauthapi-img .
# 运行容器
docker run --network="host" -d -p 52789:52789 -p 1802:1802 -p 12796:12796 openauthapi-img
```

View File

@@ -1,4 +1,8 @@
# 部署API
---
title: 部署API
createTime: 2025/04/23 21:03:10
permalink: /core/deployapi/
---
## 生成发布文件
@@ -37,18 +41,30 @@ source /etc/profile
![20220101235436](http://img.openauth.net.cn/20220101235436.png)
## 部署OpenAuth.WebApi
## 部署&启动
将发布后的文件拷贝到服务器文件夹。直接使用`dotnet OpenAuth.WebApi.dll` 命令启动。启动成功后使用浏览器打开[http://localhost:52789/swagger/index.html](http://localhost:52789/swagger/index.html) 即可访问,如下图所示:
如果是windows系统可以直接运行`OpenAuth.Mvc.exe`启动。
如果是linux系统将发布后的文件拷贝到服务器文件夹。直接使用`dotnet OpenAuth.WebApi.dll` 命令启动。
启动成功后使用浏览器打开[http://localhost:52789/swagger/index.html](http://localhost:52789/swagger/index.html) 即可访问,如下图所示:
![20220101233542](http://img.openauth.net.cn/20220101233542.png)
## docker部署
## jenkins部署OpenAuth.WebApi
框架自带的dockerfile文件会同时生成webapi、mvc、identity三个项目可以根据需要调整后使用。使用方式如下
```shell
# 构建镜像
docker build -f Dockerfile -t openauthapi-img .
# 运行容器
docker run --network="host" -d -p 52789:52789 -p 1802:1802 -p 12796:12796 openauthapi-img
```
## jenkins无容器部署
OpenAuth.Net采用的是gitee托管源码只需使用Gitee WebHook构建触发器。配置如下
![说明](/giteesource.png "说明")
![2025-04-24-00-33-15](http://img.openauth.net.cn/2025-04-24-00-33-15.png)
做好上面的配置后代码提交时就会触发jenkins工作。剩下的就是编写自己的构建脚本。增加构建步骤选择执行Shell。并输入以下脚本
@@ -84,4 +100,26 @@ nohup dotnet /data/openauthapi/OpenAuth.WebApi.dll &
echo '============================end build======================================='
```
## jenkins容器部署
如果需要jenkins配合自动部署启动可以将上面的shell调整如下
```shell
# 停止并删除所有与 openauthapi-img 镜像相关的容器
docker ps -a --filter "ancestor=openauthapi-img" --format "{{.ID}}" | xargs -r docker stop
# 删除所有与 openauthapi-img 镜像相关的容器
docker ps -a --filter "ancestor=openauthapi-img" --format "{{.ID}}" | xargs -r docker rm
#docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
cd /var/lib/jenkins/workspace/openauth.webapi
# 构建镜像
docker build -f Dockerfile -t openauthapi-img .
# 运行容器
docker run --network="host" -d -p 52789:52789 -p 1802:1802 -p 12796:12796 openauthapi-img
```

View File

@@ -1,94 +1,60 @@
# 添加新模块
---
title: 添加新模块
createTime: 2025/04/23 21:03:10
permalink: /core/devnew/
---
## 前言
OpenAuth.Mvc添加新模块的方式非常简单完全可以参考系统已有的`资源管理`模块编写相应的代码。参考的`资源管理`功能对应的代码如下:
![](http://pj.openauth.net.cn/zentao/file-read-55.png)
![](http://img.openauth.net.cn/20220407153729.png)
如果我们想新加一个仓储管理的模块,模块标识为`Stock`。那么需要添加的文件如下:
├─OpenAuth.Mvc
├─ Controllers
│ │ └─ StocksController.cs
├─ Views
└─ Stocks
│ │ └─ index.cshtml
├─ wwwroot
└─ userJs
│ │ └─ stock.js
├─OpenAuth.App
├─ StockApp.cs
├─ Request
│ │ └─ QueryStockReq.cs
├─ OpenAuth.Repository
│ ├─ OpenAuthDBContext.cs
├─ Domain
│ └─ Stock.cs
::: file-tree
- OpenAuth.Mvc
- Controllers
- StocksController.cs
- Views
- Stocks
- index.cshtml
- wwwroot
- userJs
- stock.js
- OpenAuth.App
- StockApp.cs
- Request
- QueryStockReq.cs
- OpenAuth.Repository
- OpenAuthDBContext.cs
- Domain
- Stock.cs
:::
当然全部手撸这些代码还是会疯的。用户可以直接使用项目`CodeSmith`文件夹里面的模板一键生成上述代码。而且CodeSmith模板本身也是全部源码可以根据自己需求调整生成的内容。
## 工具准备
CodeSmith Generator Studio 8.0或以上
数据库OpenAuthDB中添加仓储表【Stock】本文以该数据表为例
## 添加实体
如下图使用CodeSmith文件夹中的模板右击【ApiGenerate.cst】--【Execute】选择需要生成的表本文以Stock为例及相关的上下文命名空间点击【Generate】
![20240613220037](http://img.openauth.net.cn/20240613220037.png)
注意,有两个配置项:
* WholeDb: 如果选中,则按数据库中所有表生成实体及逻辑;否则,按选择的表生成
* HeaderModel会生成主、从表结构类似 WmsInboundOrderTbl / WmsInboundOrderDtbl
生成成功后在CodeSmith/Csharp文件夹下面会有Stock实体相关文档如下图
![20240613220224](http://img.openauth.net.cn/20240613220224.png)
把CSharp\OpenAuth.App覆盖到自己项目对应目录
把CSharp\OpenAuth.Repository\Domain覆盖到自己项目对应目录
**把CSharp\OpenAuth.Repository\OpenAuthDBContext.cs中的内容添加到自己项目的文件中千万不要直接覆盖文件**
## 添加界面
如下图使用CodeSmith文件夹中的模板右击【WebGenerate.cst】--【Execute】选择需要生成的表本文以Stock为例及相关的上下文命名空间点击【Generate】
![](http://img.openauth.net.cn/2025-02-25-10-56-08.png)
生成成功后在CodeSmith/Csharp文件夹下面会有相关的界面代码如下图
![](http://img.openauth.net.cn/2025-02-25-10-57-44.png)
Controllers、Views直接覆盖到OpenAuth.Mvc项目中对应的文件夹即可
userJs直接覆盖到OpenAuth.Mvc/wwwroot中
## 添加模块
编写完上面代码后运行系统使用System账号登录系统在【模块管理】中添加`仓储管理`模块,
![20240613220434](http://img.openauth.net.cn/20240613220434.png)
::: warning 注意
因为生成的Controller名称类似XXXsController所以模块的Url地址应该是XXXs/Index
:::
添加模块时系统会自动添加三个默认菜单【添加】【编辑】【删除】。可根据需要调整。这里我再添加一个菜单【btnCancel】如下图
![](http://img.openauth.net.cn/2025-02-25-11-05-08.png)
重新登录系统,即可看到新加的仓储管理模块。
![](http://img.openauth.net.cn/2025-02-25-11-08-26.png)

View File

@@ -1,4 +1,8 @@
# 动态API
---
title: 动态API
createTime: 2025/04/23 21:03:10
permalink: /core/dynamicapi/
---
加快系统开发速度框架提供动态API功能可以实现无代码调整操作数据库。

View File

@@ -1,4 +1,10 @@
# 数据库实体
---
title: 数据库主键
createTime: 2025/04/23 21:03:10
permalink: /core/entity/
---
目前框架主键默认为`Id`类型为String如果需要修改主键名称或类型可以参考本章节内容。
## 更换主键名称
@@ -15,9 +21,9 @@
- `StringEntity`针对数据库主键为varchar类型的数据表,主键按guid方式生成;
- `LongEntity`针对数据库主键为numberic(15)的数据表,主键按雪花算法生成;【新功能,官方推荐使用方式👍】
- `LongEntity`针对数据库主键为numberic(15)的数据表,主键按雪花算法生成;
- `IntAutoGenEntity`针对数据库主键为numberic且为数据库自动生成的类型表通常为SqlServer的自动增长类型和Oracle的Sequence生成【新功能】
- `IntAutoGenEntity`针对数据库主键为numberic且为数据库自动生成的类型表通常为SqlServer的自动增长类型和Oracle的Sequence生成
这三个基类可以覆盖90%以上的业务场景。如果这两个不能满足需求,可以自己按需求扩展。参考代码如下:
@@ -119,9 +125,3 @@ namespace OpenAuth.App
然后就可以像其他应用服务一样使用这个服务
::: warning 注意
最新版才支持以前的版本2.0或以前的版本可以参考BaseEntity进行改造
:::

View File

@@ -1,4 +1,8 @@
# 常见问题处理
---
title: 常见问题处理
createTime: 2025/04/23 21:03:10
permalink: /core/faq/
---
## 注释的使用
@@ -19,7 +23,7 @@ public string Account { get; set; }
## 项目显示不可用
![](/notavailable.png)
![2025-04-24-00-29-43](http://img.openauth.net.cn/2025-04-24-00-29-43.png)
这种情况一般是开发工具或SDK的版本号不对。严格按照下面的提示打开项目

View File

@@ -1,4 +1,9 @@
# 工作流介绍
---
title: 工作流实例
createTime: 2025/04/23 21:03:10
permalink: /core/flowinstance/
---
OpenAuth.Net工作流基于国际标准的BPMN2.0规范,并在此基础上做了一些扩展,以满足国内各种需求。系统工作流分为两个大类:
@@ -42,7 +47,7 @@ OpenAuth.Net工作流基于国际标准的BPMN2.0规范,并在此基础上做
![2025-04-19-10-16-58](http://img.openauth.net.cn/2025-04-19-10-16-58.png)
流程模版使用的表单,需要在【基础配置/表单设计】中添加,具体查看[表单设计-基本介绍](/core/form.html)
流程模版使用的表单,需要在【基础配置/表单设计】中添加,具体查看[表单设计-基本介绍](/core/form)
选择好表单后,点击“流程设计”进入流程设计。
@@ -58,13 +63,13 @@ OpenAuth.Net工作流基于国际标准的BPMN2.0规范,并在此基础上做
* 指定用户:指定用户审批,当选中这项时需要选择指定的用户
* 指定角色:指定角色审批,当选中这项时需要选择指定的角色
👉使用[vue版本](/pro/startflow.html)解锁更多类型指定SQL、上一节点执行人的直属上级、连续多级直属上级、部门负责人、运行时指定角色、运行时指定用户等等当然你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,添加更多类型。
👉使用[vue版本](/pro/startflow)解锁更多类型指定SQL、上一节点执行人的直属上级、连续多级直属上级、部门负责人、运行时指定角色、运行时指定用户等等当然你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,添加更多类型。
👉使用[vue版本](/pro/startflow.html),设置连线条件属性。你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,让它支持该属性。
👉使用[vue版本](/pro/startflow),设置连线条件属性。你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,让它支持该属性。
## 流程发起
开源版本只能发起无业务关联的流程,使用[vue版本](/pro/startflow.html),解锁有业务类型关联的流程。当然你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,支持更多类型。
开源版本只能发起无业务关联的流程,使用[vue版本](/pro/startflow),解锁有业务类型关联的流程。当然你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,支持更多类型。
### 无业务关联流程
@@ -92,7 +97,7 @@ OpenAuth.Net工作流基于国际标准的BPMN2.0规范,并在此基础上做
* 驳回:可以驳回到指定的步骤,该步骤的人可以重新审批提交;
👉使用[vue版本](/pro/startflow.html),解锁更多加签、撤销审批操作。你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,让它支持这些功能。
👉使用[vue版本](/pro/startflow),解锁更多加签、撤销审批操作。你也可以为[开源版本](https://gitee.com/dotnetchina/OpenAuth.Net)贡献代码,让它支持这些功能。

View File

@@ -1,4 +1,8 @@
# 工作流中的概念
---
title: 工作流中的概念
createTime: 2025/04/23 21:03:10
permalink: /core/flowinstanceconcept/
---
## 并行网关

View File

@@ -1,4 +1,8 @@
# 流程相关的代码
---
title: 流程相关的代码
createTime: 2025/04/23 21:03:10
permalink: /core/flowinstancedev/
---
## 流程审批逻辑
@@ -44,11 +48,11 @@ stop
流程模板指流程的定义。数据存放在FlowScheme表中该表核心字段如下
#### FrmId流程模版关联的表单id
### FrmId流程模版关联的表单id
#### FrmType表单类型
### FrmType表单类型
#### SchemeContent流程实例的具体内容
### SchemeContent流程实例的具体内容
该字段存储的是一个JSON对象具体内容如下所示
@@ -116,8 +120,9 @@ stop
```
其中nodes为流程实例的所有节点。lines为流程实例的所有连线。节点属性如下
### 节点属性
###### 基础属性
#### 基础属性
| 属性名 | 类型 | 说明 | 可选值 |
|--------|------|------|---------|
@@ -127,22 +132,22 @@ stop
| belongto | 字符串 | 节点样式类型 | - |
| id | 字符串 | 节点id | - |
###### 配置信息(setInfo)
#### 配置信息(setInfo)
####### 节点驳回配置
##### 节点驳回配置
| 属性名 | 类型 | 说明 | 可选值 |
|--------|------|------|---------|
| NodeRejectType | 数字 | 节点驳回类型 | 0前一步<br>1第一步<br>2指定节点 |
| NodeRejectStep | 字符串 | 驳回节点id | 当NodeRejectType=2时使用 |
###### 节点会签/网关配置
##### 节点会签/网关配置
| 属性名 | 类型 | 说明 | 可选值 |
|--------|------|------|---------|
| NodeConfluenceType | 字符串 | 节点会签/网关类型 | sequential顺序<br>all全部通过<br>one至少一个通过 |
###### 执行权限配置
##### 执行权限配置
| 属性名 | 类型 | 说明 | 可选值 |
|--------|------|------|---------|
@@ -151,7 +156,7 @@ stop
| NodeDesignateData.datas | 数组 | 执行权限数据 | - |
| NodeDesignateData.Texts | 字符串 | 执行权限数据 | - |
###### 其他配置
##### 其他配置
| 属性名 | 类型 | 说明 |
|--------|------|------|
@@ -163,7 +168,7 @@ stop
流程实例指正在运行的一个流程。数据存放在FlowInstance表中该表核心字段如下
#### IsFinish流程的当前状态
### IsFinish流程的当前状态
- -1 草稿/召回:流程发起人主动召回流程;
@@ -176,12 +181,12 @@ stop
- 4 驳回:流程结束,可能发起的流程内容有问题,要求被驳回重新提交;
#### ActivityId: 当前活动节点,即待审批的节点
### ActivityId: 当前活动节点,即待审批的节点
与流程实例密切相关的还有两个表流程实例的操作记录FlowInstanceOperationHistory及流转记录FlowInstanceTransitionHistory。它们有不同的作用
### 操作记录FlowInstanceOperationHistory
## 操作记录FlowInstanceOperationHistory
该表记录了流程实例的所有操作记录,包括流程的创建、撤回、驳回、同意、不同意等操作。
### 流转记录FlowInstanceTransitionHistory
## 流转记录FlowInstanceTransitionHistory
记录某个流程实例所有已审批的从一个活动节点到下一个活动节点的操作人、操作时间。

View File

@@ -1,4 +1,8 @@
# 表单设计
---
title: 表单设计
createTime: 2025/04/23 21:03:10
permalink: /core/form/
---
OpenAuth.Net集成了表单设计的功能目前表单仅用于流程审批。后期会集成到代码生成功能中。系统内置的表单类型有以下几种
@@ -6,26 +10,26 @@ OpenAuth.Net集成了表单设计的功能目前表单仅用于流程审批
动态表单基于Ueditor富文本编辑器适用于灵活设计界面逻辑简单的表单。这种表单无需编码即可直接集成到流程功能。
::: warning 注意事项
::: warning 注意
因Vform功能已经全面覆盖Ueditor且用户体验更好所以动态表单在vue3版本已废弃目前开源版、vue2版本历史原因还保留。
:::
## URL表单
URL表单本质上不是实际存在的表单指的是审批的过程中审批内容是发起流程时传入的一个URL网址审批人员根据这个URL展示的内容进行审批。详细操作请参考[URL表单](/pro/urlform.html)
URL表单本质上不是实际存在的表单指的是审批的过程中审批内容是发起流程时传入的一个URL网址审批人员根据这个URL展示的内容进行审批。详细操作请参考[URL表单](/pro/urlform)
![URL表单流程](http://img.openauth.net.cn/2025-04-06-22-46-13.png)
## 自定义开发表单【企业版】
该类型表单需要开发者在源码中先编写好表单界面基于vue component,再提供给用户选择使用。适用于交互复杂的界面。详细请参考:[企业版工作流添加自定义表单](/pro/form.html)
该类型表单需要开发者在源码中先编写好表单界面基于vue component,再提供给用户选择使用。适用于交互复杂的界面。详细请参考:[企业版工作流添加自定义表单](/pro/form)
![自定义开发表单](http://img.openauth.net.cn/2025-04-06-22-53-02.png)
## 可拖拽表单【企业版】
适用场景和普通的动态表单一样。但该表单操作方便,与系统界面风格匹配度高,缺点是排版没有普通的动态表单灵活,只能做简单的行排列。详细请参考:[可拖拽表单](/pro/dragform.html)
适用场景和普通的动态表单一样。但该表单操作方便,与系统界面风格匹配度高,缺点是排版没有普通的动态表单灵活,只能做简单的行排列。详细请参考:[可拖拽表单](/pro/dragform)

View File

@@ -1,14 +1,25 @@
# 登录认证
---
title: 登录认证
createTime: 2025/04/23 21:03:10
outline: [2,4]
permalink: /core/identity/
---
OpenAuth.Net支持两种登录认证方式token认证和自己搭建的OpenAuth.IdentityServer认证。
## 前言
OpenAuth.Net支持两种登录认证方式Token认证和==自己搭建=={.tip}的OpenAuth.IdentityServer认证。
这两种方式通过配置webapi或mvc的appsettings.json可以自由切换:
```json
"IdentityServerUrl": "http://localhost:12796", //IdentityServer服务器地址。如果为空则不启用OAuth认证
```
## Token认证
1. 当IdentityServerUrl为空采用普通的token认证这时不需要OpenAuth.Identity启动支持。无论是OpenAuth.Mvc还是OpenAuth.WebApi都会在请求头中添加X-Token字段携带token值。以OpenAuth.WebApi为例客户端在访问的接口时先调用登录接口,得到授权token
我们启动OpenAuth.WebApi/Mvc时如果IdentityServerUrl为空采用普通的token认证这时不需要启动OpenAuth.Identity项目
```json
"IdentityServerUrl": "", //如果为空则采用普通的token认证
```
这时前端发出请求时会在请求头中添加X-Token字段携带token值。以OpenAuth.WebApi为例客户端在访问的接口时先调用登录接口,得到授权token
![20220119182845](http://img.openauth.net.cn/20220119182845.png)
@@ -16,30 +27,32 @@ OpenAuth.Net支持两种登录认证方式token认证和自己搭建的OpenAu
![20220119182853](http://img.openauth.net.cn/20220119182853.png)
2. 当IdentityServerUrl配置了地址时则采用自己搭建的OpenAuth.IdentityServer认证方式。
不同于其他项目的统一登录(如微信登录、支付宝登录等),OpenAuth.Net的统一登录指的是自己搭建一套OAuth登录服务提供给其他项目使用。即OpenAuth.IdentityServer。这种模式下无论是OpenAuth.Mvc还是OpenAuth.WebApi都只是它的客户端。
## OpenAuth.IdentityServer认证
不同于其他项目的统一登录(如微信登录、支付宝登录等),OpenAuth.Net的统一登录指的是自己搭建一套OAuth登录服务提供给其他项目使用。即OpenAuth.IdentityServer。启动后直接访问[http://localhost:12796](http://localhost:12796),效果如下:
![2025-03-18-23-12-18](http://img.openauth.net.cn/2025-03-18-23-12-18.png)
## OpenAuth.Mvc OAuth认证
这时我们修改OpenAuth.WebApi/Mvc的IdentityServerUrl配置
```json
"IdentityServerUrl": "http://localhost:12796", //IdentityServer服务器地址。
```
当启用了Identity时系统启动后界面如下
### OpenAuth.Mvc效果
![MVC启用identity](/mvcidentity.png "mvcidentity")
当启用了Identity时mvc启动后界面如下
![2025-04-24-00-24-28](http://img.openauth.net.cn/2025-04-24-00-24-28.png)
这时点击登录超链接会跳转到OpenAuth.Identity登录界面。效果如下
![](/identity.png)
![2025-04-24-00-24-40](http://img.openauth.net.cn/2025-04-24-00-24-40.png)
## OpenAuth.WebApi OAuth
### OpenAuth.WebApi效果
当启用了Identity时客户端调用API需要先通过OpenAuth.IdentityServer服务器的OAuth验证才能调用接口。OpenAuth.Net调用API的客户端有两种:
当启用了Identity时客户端调用API需要先通过OpenAuth.IdentityServer服务器的OAuth验证才能调用接口。目前调用OpenAuth.WebApi的客户端有两种:
#### OpenAuth.Pro vue3
#### vue版本
在使用企业版vue界面访问OpenAuth.WebApi时已经在文件`.env.dev`中配置好相关选项,可以直接使用,无需其他处理。
在使用vue前端访问OpenAuth.WebApi时已经在文件`.env.dev`中配置好相关选项,可以直接使用,无需其他处理。
```python
VITE_OIDC_AUTHORITY = http://localhost:12796 #Identity服务器地址

View File

@@ -1,4 +1,8 @@
# 定时任务
---
title: 定时任务
createTime: 2025/04/23 21:03:10
permalink: /core/job/
---
::: tip 提示
定时任务基于Quartz.Net开发
@@ -35,7 +39,7 @@ namespace OpenAuth.App.Jobs
编写完任务的执行代码后即可运行系统,在界面【基础配置】-【定时任务】中添加任务的执行规则,如图:
![](/addjob.png)
![2025-04-24-00-26-19](http://img.openauth.net.cn/2025-04-24-00-26-19.png)
添加任务规则后,在界面直接点击`启用`即可
@@ -43,6 +47,6 @@ namespace OpenAuth.App.Jobs
::: tip 提示
企业版提供可视化的CRON编辑界面,如图:
![](/addjobpro.png)
![2025-04-24-00-26-34](http://img.openauth.net.cn/2025-04-24-00-26-34.png)
:::

View File

@@ -1,4 +1,8 @@
# 日志操作
---
title: 日志操作
createTime: 2025/04/23 21:03:10
permalink: /core/log/
---
## 普通日志
@@ -84,11 +88,11 @@
框架集成mini profiler工具在swagger中或其他客户端调用WebApi接口时可以直接在swagger中显示日志信息需要刷新。如下图
![](/miniprofiler1.png)
![2025-04-24-00-23-43](http://img.openauth.net.cn/2025-04-24-00-23-43.png)
点击`sql`列的时间查看详细的sql执行情况
![](/miniprofiler2.png)
![2025-04-24-00-23-53](http://img.openauth.net.cn/2025-04-24-00-23-53.png)
如果需要订制日志信息,查看更详细的日志情况,可以自己调整代码实现。以登录接口为例,添加以下代码:

View File

@@ -1,4 +1,8 @@
# 登录信息
---
title: 登录信息
createTime: 2025/04/23 21:03:10
permalink: /core/logininfo/
---
框架在应用层任意业务逻辑中,均可以通过`IAuth`接口判断是否登录和获取登录信息。所有继承BaseApp的业务逻辑可以直接使用`_auth`成员变量直接获取登录用户信息。

View File

@@ -1,4 +1,8 @@
# 模块/菜单权限
---
title: 模块/菜单权限
createTime: 2025/04/23 21:03:10
permalink: /core/moduleauth/
---
网络上流行的经典的权限设计是【主体】- 【领域】 - 【权限】( who、what、how问题原型 ) 的设计思想,其中:

View File

@@ -1,8 +1,12 @@
# 配置多数据库
---
title: 多数据库
createTime: 2025/04/23 21:03:10
permalink: /core/multidbs/
---
框架支持同时访问多个数据库。具体操作如下:
## 添加新数据库连接字符串
## 添加新连接字符串
在配置文件appsettings.json中添加新的连接字符串`OpenAuthDBContext2`
@@ -19,7 +23,7 @@
}
```
## 添加新的数据上下文
## 添加数据上下文
在OpenAuth.Repository中添加新的数据库上下文比如`OpenAuthDBContext2`

View File

@@ -1,4 +1,8 @@
# 多租户
---
title: 多租户
createTime: 2025/04/23 21:03:10
permalink: /core/multitenant/
---
目前市面上主流的多租户方案有三种:

View File

@@ -1,4 +1,8 @@
# 日常提交(针对dev分支)
---
title: 日常提交
createTime: 2025/04/23 21:03:10
permalink: /core/routineupdate/
---
* 2025.03.17 代码生成加上外部数据源支持
@@ -34,9 +38,9 @@
* 2024.11.16 添加dockerfile,为.net 9做准备
* 2024.10.10 增加知会功能。详情:[知会](http://doc.openauth.net.cn/core/flowinstance.html#%E7%9F%A5%E4%BC%9A)
* 2024.10.10 增加知会功能。详情:[知会](http://doc.openauth.net.cn/core/flowinstance/#%E7%9F%A5%E4%BC%9A)
* 2024.09.29 新增增加签逻辑。详情:[加签](http://doc.openauth.net.cn/core/flowinstance.html#%E5%8A%A0%E7%AD%BE)
* 2024.09.29 新增增加签逻辑。详情:[加签](http://doc.openauth.net.cn/core/flowinstance/#%E5%8A%A0%E7%AD%BE)
* 2024.07.20 mvc项目去掉vue采用原生layui
@@ -74,7 +78,7 @@
* 2024.01.06 update layui to 2.9.3
* 2023.12.30 模块增加配置是否缓存。请参考[界面缓存](http://doc.openauth.net.cn/pro/keepalive.html)
* 2023.12.30 模块增加配置是否缓存。请参考[界面缓存](http://doc.openauth.net.cn/pro/keepalive/)
* 2023.12.27 登录账号旁边实时显示未读消息条数
@@ -86,7 +90,7 @@
* 2023.11.20 打印导出PDF时数据为空
* 2023.10.04 全面完成智能打印板块功能开发。请参考[智能打印](http://doc.openauth.net.cn/pro/printerplan.html)
* 2023.10.04 全面完成智能打印板块功能开发。请参考[智能打印](http://doc.openauth.net.cn/pro/printerplan/)
* 2023.10.02 fix #I82FO6 完成业务功能配置打印方案
@@ -102,7 +106,7 @@
* 2023.09.01 fix #I7XLQK checkbox控件值表单条件判断
* 2023.08.27 fix issue #I7A7XF 全面支持SqlSugar Orm。详情[sqlsugar访问数据库](http://doc.openauth.net.cn/core/sqlsugar.html)
* 2023.08.27 fix issue #I7A7XF 全面支持SqlSugar Orm。详情[sqlsugar访问数据库](http://doc.openauth.net.cn/core/sqlsugar/)
* 2023.08.18 fix #I7U1BM 左侧展开图标丢失
@@ -212,7 +216,7 @@
* 2021.05.26 流程处理增加消息通知;
* 2021.05.24 集成miniprofiler可以监控API运行情况。[查看使用说明](http://doc.openauth.net.cn/core/log.html#%E5%9C%A8swagger%E4%B8%AD%E8%BE%93%E5%87%BA%E6%97%A5%E5%BF%97 )
* 2021.05.24 集成miniprofiler可以监控API运行情况。[查看使用说明](http://doc.openauth.net.cn/core/log/#%E5%9C%A8swagger%E4%B8%AD%E8%BE%93%E5%87%BA%E6%97%A5%E5%BF%97 )
* 2021.05.23 [模块管理页面加载时默认显示第一条](https://gitee.com/dotnetchina/OpenAuth.Net/issues/I3RUOR)

View File

@@ -0,0 +1,95 @@
---
title: 后端开发规范
createTime: 2025/04/23 21:03:10
permalink: /core/specialist/
---
## 新增功能文件结构
如果新增功能时尽量按框架原有文件结构。比如新增仓库功能实体名Stock
::: file-tree
- OpenAuth.WebApi
- Controllers
- StocksController.cs // WebApi控制器
- OpenAuth.Mvc
- Controllers
- StocksController.cs // MVC控制器
- Views
- Stocks
- index.cshtml // MVC视图
- wwwroot
- userJs
- stock.js // 业务脚本
- OpenAuth.App
- StockApp.cs // 应用层
- Request
- QueryStockReq.cs // 请求参数
- OpenAuth.Repository
- OpenAuthDBContext.cs // EF数据库上下文
- Domain
- Stock.cs // 实体
:::
## 数据库表及字段命名
SqlServer采用PascalCase命名Oracle采用全大写命名其他数据库采用camelCase命名。
::: tip 提示
开源版代码生成时通过表结尾Dtbl来判断是否是生成明细表代码。因此建议数据库表命名时按子系统名称+业务名称+表尾,其中表尾名称规则:
- 基础主数据以Mst结尾
- 普通业务表以Tbl结尾
- 业务明细表以Dtbl结尾
WMS系统入库订单明细表WmsInboundOrderDtbl
:::
## 数据库字段类型
### SqlServer
* 主键统一命名为Id,类型为Domain:PrimaryKey方便统一修改主键类型。
* 状态类,标识类的字段统一使用bit not null
* 表示分类的字段统一使用PrimaryKey数值从Category中获取
### Mysql
* 主键统一命名为id类型varchar(50)
* 状态类,标识类的字段统一使用tinyint(4) NOT NULL
### Oracle
* 主键统一命名为ID类型为varchar2(50)
* 状态类,标识类的字段统一使用NUMBER(4,0) NOT NULL
## 代码注释
所有的实体属性都会有2个注释:
* summary: 用于编写代码时IDE提示
* Description: 用于Swagger接口文档
```csharp
/// <summary>
/// 应用
/// </summary>
[Table("Application")]
public partial class Application : StringEntity
{
/// <summary>
/// 应用名称
/// </summary>
[Description("应用名称")]
public string Name { get; set; }
}
```

View File

@@ -1,7 +1,19 @@
# SqlSugar访问数据库
---
title: SqlSugar集成
createTime: 2025/04/23 21:03:10
permalink: /core/sqlsugar/
---
SqlSugar 是一款老牌.NET开源ORM框架相对于EntityFramework复杂的Linq表达式它拥有灵活的动态查询如果你喜欢直接码Sql那么它是你的不二之选。OpenAuth.Net 6.0及以后版本默认支持使用SqlSugar方式访问数据库。目前大多数模块都已使用SqlSugar的方式这里以资源管理为例
SqlSugar 是一款老牌.NET开源ORM框架相对于EntityFramework复杂的Linq表达式它拥有灵活的动态查询如果你喜欢直接码Sql那么它是你的不二之选。OpenAuth.Net 6.0及以后版本默认支持使用SqlSugar方式访问数据库。
框架提供`SqlSugarBaseApp`基类该基类定义了SqlSugar最常用的两个成员变量
```csharp
protected ISqlSugarClient SugarClient; //SqlSugar基础数据库读写
protected SqlSugarRepository<T> Repository; //SqlSugar的仓储模式
```
只需要继承该基类即可使用SqlSugar的强大功能。
目前框架大多数模块都已继承`SqlSugarBaseApp`基类,这里以资源管理为例:
```csharp
public class ResourceApp:SqlSugarBaseApp<Resource>
{
@@ -35,9 +47,10 @@ public class ResourceApp:SqlSugarBaseApp<Resource>
## 使用方法
如上所示代码,只需要继承`SqlSugarBaseApp`即可使用SqlSugar强大功能。其中
当编写业务代码需要使用SqlSugar的模块时,只需要继承`SqlSugarBaseApp`即可使用SqlSugar强大功能。其中
Repository实现的是SqlSugar的仓储模式详细Api请查看[SqlSugar使用仓储](https://www.donet5.com/Home/Doc?typeId=1228)。在OpenAuth.Net中
### Repository
实现的是SqlSugar的仓储模式详细Api请查看[SqlSugar使用仓储](https://www.donet5.com/Home/Doc?typeId=1228)。在OpenAuth.Net中
```csharp
public class ResourceApp:SqlSugarBaseApp<Resource>
{
@@ -48,8 +61,8 @@ public class ResourceApp:SqlSugarBaseApp<Resource>
}
}
```
SugarClientSqlSugar基础数据库读写用法。详细Api请查看[SqlSugar入门必看](https://www.donet5.com/Home/Doc?typeId=1181)。在OpenAuth.Net中
### SugarClient
SqlSugar基础数据库读写用法。详细Api请查看[SqlSugar入门必看](https://www.donet5.com/Home/Doc?typeId=1181)。在OpenAuth.Net中
```csharp
public class ResourceApp:SqlSugarBaseApp<Resource>
{

View File

@@ -1,10 +1,14 @@
# 快速开始
---
title: 快速开始
createTime: 2025/04/23 21:03:10
permalink: /core/start/
---
## 下载代码
gitee上面两个版本。其中
* [OpenAuth.Net](https://gitee.com/dotnetchina/OpenAuth.Net) 默认SDK版本为.Net 9.0.100,如果需要切换到.Net其他版本请参考[切换sdk版本](http://doc.openauth.net.cn/core/changesdk.html)
* [OpenAuth.Net](https://gitee.com/dotnetchina/OpenAuth.Net) 默认SDK版本为.Net 9.0.100,如果需要切换到.Net其他版本请参考[切换sdk版本](http://doc.openauth.net.cn/core/changesdk/)
* [OpenAuth.Core](https://gitee.com/yubaolee/OpenAuth.Core) 的SDK版本为.Net Core 3.1.100,已停止维护,不推荐使用。
@@ -149,11 +153,11 @@ OpenAuth.Repository -> OpenAuthDB : 仓储层进行数据库操作
启动openauth.mvc项目。
![启动](/startmvc.png "启动")
![启动](http://img.openauth.net.cn/2025-04-24-00-07-51.png)
启动成功后使用浏览器打开[http://localhost:1802](http://localhost:1802) 即可访问,如下图所示:
![说明](/mvcmain.png "说明")
![说明](http://img.openauth.net.cn/2025-04-24-00-08-18.png)
## 编译运行WebApi

View File

@@ -1,13 +1,15 @@
# 三方对接
---
title: 三方对接
createTime: 2025/04/23 21:03:10
permalink: /core/thirdparty/
---
* 在OpenAuth中设计表单注意表单中的控件名称在步骤3调用OpenAuth创建流程实例接口时frmData参数中的属性必须严格按该命名提交。
![](/formthirdparty.png "表单设计说明")
![2025-04-24-00-28-51](http://img.openauth.net.cn/2025-04-24-00-28-51.png)
* 在OpenAuth中设计流程制定相关的工作流程并在每个流程节点配置回调URL路径如下
![](/flowthirdparty.png "三方URL设置")
![2025-04-24-00-28-38](http://img.openauth.net.cn/2025-04-24-00-28-38.png)
* 三方已有系统界面提交表单时调用创建流程实例接口http://localhost:52789/api/FlowInstances/Add在OpenAuth中创建一条新的流程实例 接口参数如下:

View File

@@ -1,4 +1,8 @@
# 单元测试
---
title: 单元测试
createTime: 2025/04/23 21:03:10
permalink: /core/unittest/
---
为了方便项目调试框架的所有层均支持单元测试。代码基于NUnit框架编写。测试内如大概如下

View File

@@ -1,6 +1,23 @@
# 数据库读写及事务处理
---
title: EF操作数据库
createTime: 2025/04/23 21:03:10
permalink: /core/unitwork/
---
OpenAuth.Net使用Repository和Unitwork两种方式访问数据库。
OpenAuth.Net支持EF操作数据库提供了IRepository和IUnitWork两个接口,分别用于单表操作和事务操作。框架自带的`BaseApp``BaseStringApp``BaseLongApp`等基类,都包含有这两个接口的实例:
```csharp
/// <summary>
/// 用于普通的数据库操作
/// </summary>
protected IRepository<T, TDbContext> Repository;
/// <summary>
/// 用于事务操作
/// </summary>
protected IUnitWork<TDbContext> UnitWork;
```
因此,当我们编写应用层代码时,只要继承`BaseApp``BaseStringApp``BaseLongApp`等基类,就可以使用这两个接口。
## 使用场景
@@ -200,10 +217,6 @@ namespace OpenAuth.App
框架提供两个SQL语句查询的接口:
* FromSql: 返回数据库表对应的实体必需在在DbContext中增加对应的DbSset
::: tip 提示
EF Core 3.x版本或以前如果返回数据库中不存在的实体必需在在DbContext中增加DbQuery<实体>并且使用dbcontext.Query<XXX>("select * from xx")进行查询。EF Core 5.0以后已经全部统一为DbSet并使用FromSql进行查询
:::
### 返回数据库表

View File

@@ -0,0 +1,57 @@
---
title: MVC前端
createTime: 2025/04/23 21:03:10
permalink: /core/wwwarchitect/
---
OpenAuth.Mvc前端采用经典mvc结构如图
::: file-tree
- OpenAuth.Mvc
- Views // MVC的视图文件
- _ViewStart.cshtml
- Error
- Auth.cshtml
- FlowSchemes
- Design.cshtml
- Index.cshtml
- NodeInfo.cshtml
- Preview.cshtml
- Home
- git.cshtml
- Index.cshtml
- Main.cshtml
- Login
- Index.cshtml
- wwwroot
- css // 通用的css样式
- login.css
- main.css
- treetable.css
- js // 通用的js组件
- cookie.js
- droptree.js
- dtree.js
- index.js
- leftNav.js
- openauth.js
- utils.js
- vue.js
- ztree.js
- userJs // 业务相关的js代码
- assignModule.js
- assignResource.js
- assignRole.js
- changePwd.js
- flowinstanceDetail.js
- forms.js
- login.js
:::
* Views: 为静态资源页面最终会渲染成html实在不懂百度Asp.Net Mvc中的View
* wwwroot/js: 通用的js组件
* wwwroot/userJs: 业务相关的js代码。通常一个csthml页面对应一个userJs中的js文件。如`Categories\Index.cshtml`对应`userJs\categories.js`

View File

@@ -0,0 +1,35 @@
---
title: vue3版本介绍
createTime: 2025/04/23 23:43:26
permalink: /pro/
---
::: warning 注意
如果你使用的是vue2版本请参考[OpenAuth.Pro Vue2版本](/vue2/)
:::
OpenAuth.Pro Vue3版本基于vue3 + element-plus。它使用开源版OpenAuth.Net的API接口OpenAuth.WebApi提供数据服务。二者的关系如下
![系统架构](http://img.openauth.net.cn/系统架构.png)
vue3版源代码获取方式[http://old.openauth.net.cn/question/detail.html?id=a2be2d61-7fcb-4df8-8be2-9f296c22a89c](http://old.openauth.net.cn/question/detail.html?id=a2be2d61-7fcb-4df8-8be2-9f296c22a89c)
演示地址: [http://demo.openauth.net.cn:1805/](http://demo.openauth.net.cn:1805/)
## OpenAuth.Net系列教学视频
[OpenAuth.Net视频合集--系统结构及代码下载](https://www.bilibili.com/video/BV1Z1421q7xU/)
[OpenAuth.Net视频合集--企业版代码启动](https://www.bilibili.com/video/BV1KSuQebEek/)
[OpenAuth.Net视频合集--使用企业版代码生成器](https://www.bilibili.com/video/BV1JCuyeaEFp/)
[OpenAuth.Net视频合集--权限管理介绍](https://www.bilibili.com/video/BV1M9KeejENf/)
[OpenAuth.Net视频合集--表单设计](https://www.bilibili.com/video/BV1dagEeFEVA/)

View File

@@ -0,0 +1,76 @@
---
title: 列设置
createTime: 2025/05/07 20:24:28
permalink: /pro/columnsetting/
---
## 功能简介
`ColumnSetting` 是一个用于表格列显示与顺序自定义的弹窗组件,支持列的拖拽排序、显示/隐藏切换并将用户设置持久化到本地存储。用于配合框架el-table及[通用表格组件](./table.md)的列设置。
![2025-05-07-20-24-28](http://img.openauth.net.cn/2025-05-07-20-24-28.png)
## 主要功能
- 支持列的拖拽排序
- 支持列的显示/隐藏切换
- 支持本地持久化localStorage
- 支持重置为默认列设置
## 属性Props
| 属性名 | 类型 | 必填 | 说明 | 默认值 |
| -------------- | ------- | ---- | ---------------------------- | ----------------------- |
| storageName | String | 是 | 存储在localStorage的键名 | - |
| columns | Array | 是 | 列数据,需包含唯一标识等字段 | - |
| title | String | 否 | 对话框标题 | 设置列是否显示及显示顺序 |
| itemKey | String | 否 | 列的唯一标识字段 | columnName |
| labelKey | String | 否 | 列的显示名称字段 | remark |
| showKey | String | 否 | 控制列是否显示的字段 | isList |
## 事件Emits
| 事件名 | 说明 | 回调参数 |
| ---------------- | ---------------------------- | ------------------ |
| update:columns | 列设置变更时通知父组件 | 新的列数组/null |
## 使用示例
```vue
<template>
<el-table :columns="columns" />
<ColumnSetting
:storageName="'user-table-columns'"
:columns="columns"
@update:columns="onColumnsUpdate"
/>
</template>
<script setup>
import { ref } from 'vue'
import ColumnSetting from '@/components/ColumnSetting'
// 表格列定义,为一个`ColumnDefine`的数组。典型的值如下:
const columns = ref([
new ColumnDefine('id', 'id', false, false, 'text', '', 'string', 'varchar', ''),
new ColumnDefine('tableName', '表名', true, true, 'text', '', 'string', 'varchar', ''),
new ColumnDefine('parentTableId', '父表', true, true, 'selectDynamic', '/BuilderTables/AllMain', 'string', 'varchar', '')
])
function onColumnsUpdate(newColumns) {
if (newColumns) {
columns.value = newColumns
} else {
// 重新加载默认列
}
}
</script>
```
## 常见问题
### 1. 如何自定义列的唯一标识、显示名、显示控制字段?
通过 `itemKey``labelKey``showKey` 属性自定义。
### 2. 如何重置为默认列?
点击弹窗底部"重置"按钮即可。
### 4. 如何与表格联动?
监听 `update:columns` 事件,更新表格的列配置。

View File

@@ -1,4 +1,8 @@
# 内置组件
---
title: 其他组件
createTime: 2025/04/23 23:43:26
permalink: /pro/components/
---
OpenAuth.Pro封装了一些组件方便开发使用组件全部在`src\components`中定义。目前提供的三大核心组件关系如下:
@@ -36,17 +40,6 @@ default-props: 数据源提供的数据类型。默认情况下为id/name的数
]
```
## 表格组件 auth-table
用于渲染给定列定义,给定数据的表格,简单用法如下:
```html
<auth-table ref="tableName" :table-fields="tableFields" :data="dataList" ></auth-table>
```
支持的事件row-click selection-change
支持的方法exportExcel clearSelection
## 表单组件 auth-form
根据定义动态渲染表单项,减少表单的开发。用法如下:

View File

@@ -1,5 +1,8 @@
# 权限控制
---
title: 权限控制
createTime: 2025/04/23 23:43:26
permalink: /pro/datapropertyrule/
---
## 数据权限
关于数据权限控制,可以详细查看博文:[通用权限设计与实现](https://www.cnblogs.com/yubaolee/p/DataPrivilege.html)

View File

@@ -1,6 +1,10 @@
# 部署
---
title: 部署
createTime: 2025/04/23 23:43:26
permalink: /pro/deploy/
---
后端接口部署请参考:[部署API](/core/deployapi.html),前端打包流程如下:
后端接口部署请参考:[部署API](/core/deployapi/),前端打包流程如下:
首先修改配置文件`.env.production`,打包构建前请调整为自己的接口地址:

View File

@@ -1,4 +1,8 @@
# Vue3代码生成器
---
title: vue3代码生成器
createTime: 2025/04/23 23:43:26
permalink: /pro/devnew/
---
本章节视频讲解请参考:[OpenAuth.Net视频合集--使用企业版代码生成器](https://www.bilibili.com/video/BV1JCuyeaEFp/)
@@ -28,7 +32,7 @@
#### 动态头部
如果启用动态头部,表示前端渲染列表(或表单)时,列表的列定义是从后端返回。通常用于控制前端字段显示权限。配合后端:[权限控制/字段权限](http://doc.openauth.net.cn/pro/datapropertyrule.html#%E5%AD%97%E6%AE%B5%E6%9D%83%E9%99%90) 如:常见的前端代码如下:
如果启用动态头部,表示前端渲染列表(或表单)时,列表的列定义是从后端返回。通常用于控制前端字段显示权限。配合后端:[权限控制/字段权限](http://doc.openauth.net.cn/pro/datapropertyrule/#%E5%AD%97%E6%AE%B5%E6%9D%83%E9%99%90) 如:常见的前端代码如下:
```html
<auth-table ref="mainTable" :table-fields="headerList"></auth-table>
```
@@ -89,7 +93,7 @@ create table stock
```
* 使用Visual Studio 以开发模式启动后端。参考:[编译运行webapi](http://doc.openauth.net.cn/core/start.html#%E7%BC%96%E8%AF%91%E8%BF%90%E8%A1%8Cwebapi)
* 使用Visual Studio 以开发模式启动后端。参考:[编译运行webapi](http://doc.openauth.net.cn/core/start/#%E7%BC%96%E8%AF%91%E8%BF%90%E8%A1%8Cwebapi)
* 启动企业版前端。参考:[启动前端](http://doc.openauth.net.cn/pro/#%E5%90%AF%E5%8A%A8%E5%89%8D%E7%AB%AF)

View File

@@ -1,4 +1,8 @@
# 可拖拽表单
---
title: 可拖拽表单
createTime: 2025/04/23 23:43:26
permalink: /pro/dragform/
---
适用场景和普通的动态表单一样。但该表单操作方便,与系统界面风格匹配度高,缺点是排版没有普通的动态表单灵活,只能做简单的行排列。

View File

@@ -1,4 +1,8 @@
# 可拖拽表单常规设置
---
title: 可拖拽表单常规设置
createTime: 2025/04/23 23:43:26
permalink: /pro/dragformdetail/
---
企业版可拖拽表单使用的是VForm Pro版本详细的配置可参考:[https://www.vform666.com/](https://www.vform666.com/) 本节只做常用的配置说明。

View File

@@ -1,4 +1,8 @@
# 常见问题处理
---
title: 常见问题处理
createTime: 2025/04/23 23:43:26
permalink: /pro/faq/
---
## vue3 启动时白屏
@@ -28,7 +32,7 @@ node ./node_modules/esbuild/install.js
在启动企业版的时候,如果提示下面错误:
![](/oidcerror.png)
![2025-04-24-00-35-45](http://img.openauth.net.cn/2025-04-24-00-35-45.png)
请使用`npm run dev`命令来启动项目

View File

@@ -1,6 +1,12 @@
# 工作流添加自定义表单
---
title: 添加自定义表单
createTime: 2025/04/23 23:43:26
permalink: /pro/form/
---
OpenAuth.Pro使用的动态表单可以满足日常普通的审批功能但如果想`对用户提交的表单数据进行统计分析`、需要用户提交附件、需要`复杂的表单交互`,这时就需要开发者开发自己的表单页面。实现更加丰富的功能,效果如下:
## 前言
OpenAuth.Pro使用的拖动表单可以满足日常普通的审批功能但如果想`对用户提交的表单数据进行统计分析`、需要用户提交附件、需要`复杂的表单交互`,这时就需要开发者开发自己的表单页面。实现更加丰富的功能,效果如下:
![20211228212712](http://img.openauth.net.cn/20211228212712.png)
@@ -50,8 +56,6 @@ OpenAuth.Pro使用的动态表单可以满足日常普通的审批功能
}
}
```
## 编写请假条前端表单代码
系统约定所有开发人员自己开发的表单全部放在views/forms文件夹下。并且以下图的文件结构进行放置。

View File

@@ -1,4 +1,8 @@
# 界面缓存
---
title: 界面缓存
createTime: 2025/04/23 23:43:26
permalink: /pro/keepalive/
---
OpenAuth.Pro以前的版本采用vue [keepAlive](https://cn.vuejs.org/guide/built-ins/keep-alive.html)的方式缓存所有前端组件。从v5.2版本开始,可以在【模块管理】中配置前端是否缓存。如图:

View File

@@ -1,4 +1,8 @@
# 打开指定URL
---
title: 打开指定URL
createTime: 2025/04/23 23:43:26
permalink: /pro/openurl/
---
上一章节通过添加模块或直接在路由表中添加固定路由实现路由控制。在有些场景下需要代码中直接打开一个外部指定URL的地址不通过系统的【模块管理】功能添加到导航栏如下图

View File

@@ -1,4 +1,8 @@
# 智能打印
---
title: 智能打印
createTime: 2025/04/23 23:43:26
permalink: /pro/printerplan/
---
OpenAuth.Pro提供灵活无代码可能需要写SQL的打印解决方案无需开发人员参与即可配置自己需要的打印。
@@ -13,7 +17,7 @@ OpenAuth.Pro提供灵活无代码可能需要写SQL的打印解决方案
## 使用指南
#### 设计打印模版
### 设计打印模版
在打印中心-打印模版功能新增打印模版。设计界面说明如下:
@@ -21,7 +25,7 @@ OpenAuth.Pro提供灵活无代码可能需要写SQL的打印解决方案
左边为设计工具栏,中间为画布,右边为属性框。可以根据自己需要调整打印界面。
#### 设置数据源
### 设置数据源
打印模版的核心是设计数据源。用户通过设计数据源,实现无开发打印。如下:
@@ -44,14 +48,14 @@ OpenAuth.Pro提供灵活无代码可能需要写SQL的打印解决方案
:::
#### 功能模块挂载打印方案
### 功能模块挂载打印方案
制作完打印方案后,在【模块管理】功能里面,把刚刚打印方案与功能关联。
![20231004173811](http://img.openauth.net.cn/20231004173811.png)
#### 使用打印
### 使用打印
最后就可以在功能里面使用打印了。

View File

@@ -0,0 +1,145 @@
---
title: 自定义查询
createTime: 2025/05/07 19:10:57
permalink: /pro/querybuilder/
---
## 组件简介
自定义查询组件是一个可复用的高级查询条件构建器组件,支持通过配置 columns 自动生成 SQL 查询条件。用于配合框架el-table及[通用表格组件](./table.md)的复杂筛选的场景支持条件的增删、类型自动识别、SQL 片段生成与复制、条件本地缓存等功能。
![2025-05-07-19-20-48](http://img.openauth.net.cn/2025-05-07-19-20-48.png)
---
## 组件引入
```js
import QueryBuilder from '@/components/QueryBuilder'
```
---
## 基本用法
### 1. 在父组件 template 中引用
```vue
<template>
<QueryBuilder
:columns="headerList"
:queryOptions="listQuery"
storageName="model-user-query"
@search="handleSearch"
/>
</template>
```
### 2. 在父组件 script 中准备参数
```js
import { ref } from 'vue'
//符合ColumnDefine类型的数组这里一般是headerList
const headerList = ref([
{
columnName: 'userName',
remark: '用户名',
entityType: 'string',
isList: true
},
{
columnName: 'createdAt',
remark: '创建时间',
entityType: 'datetime',
isList: true
},
// ...更多字段
])
//高级查询条件
const listQuery = reactive({
page: 1,
limit: 20,
key: undefined,
sqlWhere: '' //高级查询条件
})
const handleSearch = () => {
// 这里可以用 queryOptions.value.sqlWhere 作为后端查询条件
listQuery.page = 1
getList()
}
```
---
## Props 参数说明
| 参数 | 类型 | 必填 | 说明 |
| ------------ | ------- | ---- | -------------------------------------- |
| columns | Array | 是 | 字段配置,决定可选字段及类型 |
| queryOptions | Object | 是 | 查询参数对象,需包含 key、sqlWhere 字段|
| storageName | String | 是 | 本地存储条件的唯一 key |
### columns 配置示例
每个字段对象支持如下属性:
- `columnName`:字段名(与数据库字段一致)
- `remark`:显示名称
- `entityType`:字段类型(如 string、int、datetime、date、float 等,自动识别输入控件)
- `isList`:是否在查询中显示(可选,默认 true
---
## 事件说明
| 事件名 | 说明 | 回调参数 |
| ------ | -------------------- | -------- |
| search | 查询按钮/应用查询时触发 | 无 |
---
## 交互说明
- 顶部输入框支持快速模糊查询key 字段)。
- 点击"高级查询"按钮弹出条件构建器,可添加/删除多组条件。
- 支持多种操作符(=、!=、LIKE、IN、BETWEEN、IS NULL 等)。
- 根据字段类型自动切换输入控件(文本、数字、日期、时间区间等)。
- 支持 SQL 条件一键复制。
- 查询条件自动本地缓存,关闭弹窗/刷新页面后可恢复。
---
## 后端接口
后端接口需要继承 `SqlSugarBaseApp` 类,并在 `Load` 方法中处理前端生成的sql查询条件。
```csharp
public class XXApp : SqlSugarBaseApp<XX>
{
public async Task<TableData> Load(QueryXXListReq request)
{
//...
if (!string.IsNullOrEmpty(request.sqlWhere))
{
objs = objs.Where(request.sqlWhere);
}
//...
}
}
```
## 常见问题
1. **为什么没有显示某些字段?**
- 请检查 columns 配置,字段需设置 `isList: true` 或不设置该属性。
2. **如何自定义操作符?**
- 可在组件内修改 `compareOperators``textOperators``rangeOperators``nullOperators` 数组。
3. **如何清空所有条件?**
- 点击弹窗底部"重置"按钮即可。
---

View File

@@ -1,4 +1,8 @@
# 路由操作
---
title: 路由
createTime: 2025/04/23 23:43:26
permalink: /pro/router/
---
OpenAuth.Pro采用的是标准vue router来管理页面跳转基础知识请参考[https://router.vuejs.org/zh/](https://router.vuejs.org/zh/)。如果需要添加页面,可以通过以下两种方式:

View File

@@ -1,75 +1,30 @@
::: warning 注意事项
如果你使用的是vue2版本请参考[OpenAuth.Pro Vue2版本](/vue2/)
:::
OpenAuth.Pro Vue3版本基于vue3 + element-plus。它使用开源版OpenAuth.Net的API接口OpenAuth.WebApi提供数据服务。二者的关系如下
![系统架构](http://img.openauth.net.cn/系统架构.png)
vue3版源代码获取方式[http://old.openauth.net.cn/question/detail.html?id=a2be2d61-7fcb-4df8-8be2-9f296c22a89c](http://old.openauth.net.cn/question/detail.html?id=a2be2d61-7fcb-4df8-8be2-9f296c22a89c)
演示地址: [http://demo.openauth.net.cn:1805/](http://demo.openauth.net.cn:1805/)
## OpenAuth.Net系列教学视频
[OpenAuth.Net视频合集--系统结构及代码下载](https://www.bilibili.com/video/BV1Z1421q7xU/)
[OpenAuth.Net视频合集--企业版代码启动](https://www.bilibili.com/video/BV1KSuQebEek/)
[OpenAuth.Net视频合集--使用企业版代码生成器](https://www.bilibili.com/video/BV1JCuyeaEFp/)
[OpenAuth.Net视频合集--权限管理介绍](https://www.bilibili.com/video/BV1M9KeejENf/)
[OpenAuth.Net视频合集--表单设计](https://www.bilibili.com/video/BV1dagEeFEVA/)
---
title: 快速开始
createTime: 2025/04/23 23:43:26
permalink: /pro/start/
---
## 工具准备
#### NodeJs
前端环境为NodeJs下载地址[http://nodejs.cn/download/current/](http://nodejs.cn/download/current/)
#### visual studio code
下载最新版的vs code或Cursor、Windsurf、Trae等工具用来作为OpenAuth.Pro Vue3版的开发工具。
## 源码下载
根据授权文件的下载指示下载Vue3源码。注意一定要使用下图中的数据库脚本
![2025-04-08-20-53-49](http://img.openauth.net.cn/2025-04-08-20-53-49.png)
## 创建数据库
* 新建一个空数据库OpenAuthPro。使用上一步下载的【sql脚本】文件夹根据你的数据库类型选择运行你需要的脚本`Sql Server脚本.sql``mysql脚本.sql`
## 启动后端
启动后端请参考:[快速开始](/core/start.html)
启动后端请参考:[快速开始](/core/start/)
## 启动前端
使用Vs Code或个人喜欢的工具打开openauthvue3文件夹修改配置文件`.env.dev`对应的后端接口地址,调整为自己的接口地址:
```javascript
VITE_BASE_API = http://localhost:52789/api
VITE_BASE_IMG_URL = http://localhost:52789
```
::: warning 注意事项
::: warning 注意
如果是发布打包,调整的文件为`.env.production`
:::
使用`npm install`命令安装程序运行所需的第三方包。再用`npm run dev`命令运行。如下图:
![2025-04-08-20-57-34](http://img.openauth.net.cn/2025-04-08-20-57-34.png)
启动成功后,使用浏览器访问[http://localhost:1803/](http://localhost:1803/) 即可打开vue3版界面
![2025-04-08-21-03-19](http://img.openauth.net.cn/2025-04-08-21-03-19.png)

View File

@@ -1,16 +1,34 @@
# 操作手册
---
title: 快速开始
createTime: 2025/04/23 23:43:26
permalink: /pro/startflow/
---
## 前言
一个完整的工作流从设计到发起,到审批,需要经过:
1. 表单设计:【基础配置/表单设计】中添加一个用于流程的表单;
:::: steps
1. 表单设计
2. 流程设计:【基础配置/流程设计】中添加一个流程模版,流程模版选择刚刚建的表单
【基础配置/表单设计】中添加一个用于流程的表单
::: tip
表单设计已经在前面章节[表单设计-基本介绍](/pro/startform)中介绍,本章节介绍的后面几个步骤。
:::
3. 流程发起:【流程中心/我的流程】中【新的申请】创建一个流程实例,或在业务系统中直接【送审】发起;
2. 流程设计
4. 流程审批:【流程中心/待处理流程】中进行审批;
【基础配置/流程设计】中添加一个流程模版,流程模版选择刚刚建的表单
表单设计已经在前面章节[表单设计-基本介绍](/pro/startform.html)中介绍,本章节介绍的后面几个步骤。
3. 流程发起
【流程中心/我的流程】中【新的申请】创建一个流程实例,或在业务系统中直接【送审】发起
4. 流程审批
【流程中心/待处理流程】中进行审批
::::
## 流程设计
@@ -18,16 +36,16 @@
![2025-04-09-21-00-56](http://img.openauth.net.cn/2025-04-09-21-00-56.png)
流程模版使用的表单,需要在【基础配置/表单设计】中添加,也可以直接选择"URL表单",具体查看[表单设计-基本介绍](/pro/startform.html)
流程模版使用的表单,需要在【基础配置/表单设计】中添加,也可以直接选择"URL表单",具体查看[表单设计-基本介绍](/pro/startform/)
选择好表单后,点击“下一步”进入流程设计。
![2025-04-19-12-28-51](http://img.openauth.net.cn/2025-04-19-12-28-51.png)
#### 节点类型
### 节点类型
关于节点的类型概念及区分可以参考[工作流中的概念](/core/flowinstanceconcept.html)
关于节点的类型概念及区分可以参考[工作流中的概念](/core/flowinstanceconcept/)
* 开始节点:流程的开始节点,一个流程只有一个开始
* 结束节点:流程的结束节点
* 网关开始对应BPMN的并行网关当需要多个分支同时审批时使用该节点作为并行分支的起点
@@ -35,7 +53,7 @@
* 会签节点:处理的是同一个任务需要多人审批的情况
* 任务节点:普通的审批节点
#### 节点属性
### 节点属性
* 名称:**必填** 节点名称
* 网关/会签类型:当节点类型为网关、会签节点时有效
@@ -55,7 +73,7 @@
* 可编辑字段:流程审批时,该节点可以编辑的表单字段
* 三方回调URL当节点审批完成时如果需要通知其他系统或模块,则填写对应系统的接口地址。
#### 连线属性
### 连线属性
* 文本:连线上的文字
* 表单字段条件:连线上的判断条件,只有当一个节点有多条发出的连线时,该设置生效。

Some files were not shown because too many files have changed in this diff Show More