8 Star 28 Fork 10

沙漠尽头的狼(dotnet9.com) / Dotnet9

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

**Dotnet9即将发布,为了避免被说碰瓷,已将该网站仓库迁移到 https://github.com/dotnet9/CodeWF ,本库停止维护 **

Dotnet9

Dotnet9

一个使用Dotnet 8.0开发的博客系统

dotnet-version Visual Studio 2022 Dotnet9软件技术交流 码云 Github Github stars

我的Github

Stargazers over time

Stargazers over time

0. 最新开发情况

  • 前台前端
    1. 使用Vue3 + Typescript + Vuetify + Pinia搭建前台
    2. 已有功能:文章列表、分类文章列表、专辑文章列表、标签云、文章详情、文章评论、归档、留言、关于等
    3. 还有很多功能待开发,比如隐私、评论管理等
  • 后台前端
    1. 使用Vue3 + Typescript + Vuetify + Pinia搭建
    2. 基础表的CRUD
    3. 其他功能
  • 后端
    1. 使用.NET 8 + Furion + SqlSugar + PostgreSQL搭建
    2. 提供前后台前端接口-基础表的接口管理
    3. 根据前台和后台前端的功能迭代,进行维护中

✨ 1. 特性

  1. 后端使用使用.NET 8.0开发,前端使用Vue 3.2
  2. 带博客浏览功能
  3. 带工具使用

🌈 2. 在线示例

2.1. 前台前端

首页封面

首页文章列表

文章分类

分类文章列表

文章专辑

专辑文章列表.png

文章标签

文章详情

文章留言

2.2. 后台前端

后台登录

分类管理

专辑管理

文章管理

文章编辑

🖥 3. 支持环境

  • .NET 8.0
  • Vue 3.2
  • Visual Studio 2022
  • Visual Code
  • PostgreSQL

3.1 项目配置

正确运行前,请先对项目进行配置,请看下面说明。

  1. 克隆Dotnet9文章等资源

将仓库(https://github.com/dotnet9/Assets.Dotnet9)克隆到本地,比如:F:\github_gitee\Assets.Dotnet9

  1. 修改配置

打开Dotnet9.Application/applicationsettings.json,主要修改以下节点

  • Site:配置种子数据目录
  • DbConnection:配置数据库连接信息
  • OssConnection:对象存储,比如文章封面等存储
  • oauth:QQ等第三方登录

下面的配置有相关注释,其中重点配置需要修改

{
  "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
  "SpecificationDocumentSettings": {
    "DocumentTitle": "Dotnet9 | 规范化接口",
    "GroupOpenApiInfos": [
      {
        "Group": "Default",
        "Title": "博客后端接口",
        "Description": "Dotnet9后端",
        "Version": "0.0.1",
        "TermsOfService": "https://furion.baiqian.ltd",
        "Contact": {
          "Name": "沙漠尽头的狼",
          "Url": "https://github.com/dotnet9",
          "Email": "632871194@qq.com"
        },
        "License": {
          "Name": "MIT",
          "Url": ""
        }
      }
    ]
  },
  "Site": {
    "Domain": "https://dotnet9.com",
    "AssetsDir": "F:\\github_gitee\\Assets.Dotnet9",
    "AssetsUrl": "https://img1.dotnet9.com",
    "Owner": "沙漠尽头的狼",
    "Start": 2019
  },
  "DynamicApiControllerSettings": {
    "CamelCaseSeparator": ""
  },
  "CorsAccessorSettings": {
    "WithExposedHeaders": [
      "access-token",
      "x-access-token",
      "environment"
    ]
  },
  //ORM数据库连接配置 文档:https://www.donet5.com/Home/Doc?typeId=1181
  "DbConnection": {
    "Connections": [
      {
        "ConfigId": 1,
        "DbType": "PostgreSQL", // MySql、SqlServer、Sqlite、Oracle、PostgreSQL、Dm、Kdbndp、Oscar、MySqlConnector、Access、OpenGauss、QuestDB、HG、ClickHouse、GBase、Odbc、Custom
        "ConnectionString": "Host=localhost;Username=postgres;Database=Dotnet9;port=5432;password=f5cYsx566fZF6hEs;", // PostgreSQL
        "IsAutoCloseConnection": true,
        "EnableInitDb": true // 启用数据库以及数据表初始化(首次运行项目时开启可以自动创建数据库和初始化项目运行的基础数据)
      }
    ]
  },
  //缓存配置 文档:https://easycaching.readthedocs.io/en/latest/
  "easycaching": {
    "csredis": {
      "MaxRdSecond": 120,
      "EnableLogging": false,
      "LockMs": 5000,
      "SleepMs": 300,
      "dbconfig": {
        "ConnectionStrings": [
          "127.0.0.1:6379,password=123456,defaultDatabase=0,poolsize=7"
        ],
        //"Sentinels": [
        //  "192.169.1.10:26379",
        //  "192.169.1.11:26379",
        //  "192.169.1.12:26379"
        //],
        "ReadOnly": false
      }
    },
    "inmemory": {
      "MaxRdSecond": 120,
      "EnableLogging": false,
      "LockMs": 5000,
      "SleepMs": 300,
      "DBConfig": {
        "SizeLimit": 10000,
        "ExpirationScanFrequency": 60,
        "EnableReadDeepClone": true,
        "EnableWriteDeepClone": false
      }
    }
  },
  //对象存储配置 文档:https://github.com/oncemi/OnceMi.AspNetCore.OSS
  "OssConnection": {
    "Enable": false, //是否启用对象存储(不启用将存储至站点目录)
    "Provider": "QCloud", //OSS提供者;允许值:Minio/Aliyun/QCloud/Qiniu/HuaweiCloud/(Invalid:代表附件存储到当前站点下)
    "Endpoint": "1258414763", //节点
    "AccessKey": "AKIDPd8NL9UeW7TYL527qHTO3fkOxEExPaU7", //Key
    "SecretKey": "NTIp5j8GSN1OVKs94uy6Q54mDOJxKQGp", //秘钥
    "Region": "ap-beijing", //地域,如果是QCloud必须要加上,OSS包上传会使用
    "IsEnableHttps": true, //是否启用HTTPS
    "IsEnableCache": true, //是否启用缓存(启用后将缓存签名URL,以减少请求次数)
    "Bucket": "img2-dotnet9", //默认存储根目录,也就是桶名,如果是QCloud,去掉桶名后台的APP ID后缀(即Endpoint值)
    "Domain": "https://img1.dotnet9.com" //外网访问域名或IP
  },
  // 接入第三方授权登录 文档:https://github.com/mrhuo/MrHuo.OAuth
  "oauth": {
    "qq": {
      "app_id": "101434831288",
      "app_key": "4cc9398bc588b45345454145a63a49a3fc90cb4",
      "redirect_uri": "https://dotnet9.com/api/oauth/qq/callback",
      "scope": "get_user_info"
    },
    "gitee": {
      "app_id": "a4eff6b04a7f0965a0c171c5460fe9af3c1455645645651c9d44b3f6fe2960cda0e0d17b9ad",
      "app_key": "7c8afb39d3279c4d6f654684a15c384a901b29fe0bdf788dc785675671aa899ca1e32f8916a1d",
      "redirect_uri": "https://dotnet9.com/api/oauth/gitee/callback",
      "scope": "user_info"
    },
    "github": {
      "app_id": "2650d9528567860a42c047abf",
      "app_key": "045ef356767addf83ffa49b4a8567d7e428f7956d4cf560dc",
      "redirect_uri": "https://dotnet9.com/api/oauth/github/callback",
      "scope": "repo"
    },
    "redirect_uri": "https://dotnet9.com" //授权成功后跳转地址
  },
  // 雪花id 文档:https://github.com/yitter/IdGenerator
  "SnowId": {
    "Method": 1, //雪花计算方法(1-漂移算法|2-传统算法),默认1 
    "BaseTime": "2023-01-01 08:00:00", //不能超过当前系统时间  
    "WorkerId": 0, //机器码, 最大值 2^WorkerIdBitLength-1
    "WorkerIdBitLength": 6, // 机器码位长 , 默认值6,取值范围 [1, 15](要求:序列数位长+机器码位长不超过22
    "SeqBitLength": 6, //序列数位长,默认值6,取值范围 [3, 21](要求:序列数位长+机器码位长不超过22 
    "MaxSeqNumber": 0, //最大序列数(含),设置范围 [MinSeqNumber, 2^SeqBitLength-1],默认值0,表示最大序列数取最大值(2^SeqBitLength-1])
    "MinSeqNumber": 5, //最小序列数(含),默认值5,取值范围 [5, MaxSeqNumber],每毫秒的前5个序列数对应编号0-4是保留位,其中1-4是时间回拨相应预留位,0是手工新值预留位
    "TopOverCostCount": 2000, //最大漂移次数(含),默认2000,推荐范围500-10000(与计算能力有关)
    "DataCenterId": 0, //数据中心ID(默认0,每台服务器需要设置不同值
    "DataCenterIdBitLength": 0, //数据中心ID(默认0
    "TimestampType": 0 //时间戳类型(0-毫秒,1-秒),默认0
  },
  // 日志配置
  "Logging": {
    "Monitor": {
      "GlobalEnabled": true, // 是否启用全局拦截,默认 `false`
      "IncludeOfMethods": [], // 是否指定拦截特定方法,当 GlobalEnabled: false 有效
      "ExcludeOfMethods": [], // 是否指定排除特定方法,当 GlobalEnabled: true 有效
      "BahLogLevel": "Information", // 配置 Oops.Oh  Oops.Bah 业务日志输出级别,默认 Information
      "WithReturnValue": true, // 配置是否包含返回值,默认 `true`,Furion 4.3.9+ 有效
      "ReturnValueThreshold": 0, // 配置返回值字符串阈值,默认 0,全量输出,Furion 4.3.9+ 有效
      "JsonBehavior": "None", // 配置 LoggingMonitor Json 输出行为,默认 None,Furion 4.5.2+ 有效
      "JsonIndented": false, // 配置 LoggingMonitor Json 格式化行为,默认 false,Furion 4.8.2+ 有效
      "ContractResolver": "CamelCase" // 配置 LoggingMonitor 序列化属性命名规则,默认 CamelCase,Furion 4.8.6.12+ 有效
      //"MethodsSettings": [
      //  // 配置被监视方法更多信息,Furion 4.3.9+ 有效
      //  {
      //    "FullName": "Furion.Application.TestLoggerServices.MethodName", // 方法完全限定名
      //    "WithReturnValue": true, // 配置是否包含返回值,默认 `true`,Furion 4.3.9+ 有效
      //    "ReturnValueThreshold": 0, // 配置返回值字符串阈值,默认 0,全量输出,Furion 4.3.9+ 有效
      //    "JsonIndented": false, // 配置 LoggingMonitor Json 格式化行为,默认 false,Furion 4.8.2+ 有效
      //    "JsonBehavior": "None", // 配置 LoggingMonitor Json 输出行为,默认 None,Furion 4.5.2+ 有效
      //    "ContractResolver": "CamelCase" // 配置 LoggingMonitor 序列化属性命名规则,默认 CamelCase,Furion 4.8.6.12+ 有效
      //  }
      //]
    }
  }
}
  1. 生成种子数据

以上配置好后,直接运行Dotnet9.Web.Entry项目即可生成种子数据

  1. 博客前台前端

运行后台管理端或者博客前请先检查本地的node版本;node版本 >= 16

打开程序目录【Dotnet9.VueBlogSpa】,安装node.js等依赖

npm install
npm run dev
npm run build
  1. 博客后台前端

打开程序目录【Dotnet9.VueAdmin】,安装node.js等依赖

npm install
npm run dev
npm run build

☀️ License

MIT

建站文章分享

感谢

Dotnet9网站前后台基于该开源项目编写,在线网址:https://www.okay123.top/

百大师作品,网站后台使用Furion搭建

后端采用的数据库ORM框架,文档地址:https://www.donet5.com/Home/Doc

网站前后台前端使用Vue搭建

Vue组件库

后台前端框架

还有太多框架未一一列举,感谢开源给予的力量。

💕 支持本项目

MIT License Copyright (c) 2021 Dotnet9(dotnet9.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个使用ASP.NET Core 8.0开发的博客网站系统 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/dotnet9/Dotnet9.git
git@gitee.com:dotnet9/Dotnet9.git
dotnet9
Dotnet9
Dotnet9
develop

搜索帮助