Merge pull request #2 from zihluwang/develop

Release 0.2.1
This commit is contained in:
zihluwang authored and GitHub committed 2025-07-30 11:28:19 +08:00
commit 3bf1b56229
12 files changed
+99 -31

No files matched your search

+17 -1
View File
@@ -11,4 +11,20 @@
- React v18
- Tailwind CSS v4
欢迎您从**代码**或**内容**两方面参与贡献,共同完善本项目。
欢迎您从**代码**或**内容**两方面参与贡献,共同完善本项目。
## 贡献指引
### 代码贡献
1. 【可选】创建 Issue,讨论你的想法。
2. Fork 本仓库。
3. 基于 `develop` 分支创建新 `feature/<your_feature_name>` 分支。
4. 开始完善你的功能。
5. 测试功能。
6. 提交你的代码并通过创建 Pull Request 将代码合并到 `develop` 分支。
7. 等待上线。
### 内容贡献
**暂时还没想好怎么提交新内容,等待这里更新再说吧。**
+13 -10
View File
@@ -1,4 +1,4 @@
# 骂人宝典 / 祖安语录桌面版
# 祖安语录桌面版
![MIT Licence](https://img.shields.io/github/license/zihluwang/zuanbot)
@@ -9,7 +9,8 @@
可以随机输出一条骂人的句子,有**口吐芬芳**与**火力全开**两个模式。
## 词库下载
[阿里云盘](https://www.aliyundrive.com/s/StTs9ojDAEF)、[蓝揍云](https://shadiao.lanzouw.com/b0116bgub) `密码hck1` 、 [诚通网盘](https://url08.ctfile.com/d/14688008-46477369-3732e0) `密码9919`
[GitHub 下载](/src-tauri/resources/data.db)、[阿里云盘](https://www.aliyundrive.com/s/StTs9ojDAEF)、[蓝揍云](https://shadiao.lanzouw.com/b0116bgub) `密码hck1` 、 [诚通网盘](https://url08.ctfile.com/d/14688008-46477369-3732e0) `密码9919`
在线文档:[Notion文档](https://dians.notion.site/d865fac077f1430f9510d020f8713c8e)、[口吐芬芳(谷歌文档)](https://docs.google.com/document/d/1SskgYtDpYL6P_4qmX2A1ndBl8MY5NeDcBaYPxS-yxIo/edit?usp=sharing) 、[火力全开(谷歌文档)](https://docs.google.com/document/d/14YG9qaNDZk275av-Iss6B6YY-eDTdkS5w_my3f7349A/edit?usp=sharing)
@@ -17,23 +18,25 @@
下载对应操作系统的安装包,执行安装即可。
> 由于作者目前 Rust 水平有限,无法去除打包后的 `en_US` Locale 后缀,但实际语言仍然为中文。
包类型(文件后缀):
- Windows: `x64.msi`
- macOS
- Intel: `x64.dmg`
- Apple Silicon: `aarch64.dmg`
由于没有代码签名,在 Mac 上会因为没有开启允许所有开发者而提示软件损坏,此时可以打开**终端**,并输入 `xattr -d com.apple.quaratine /Applications/zuanbot.app` 再打开软件。
## 什么原理
收集整理了N条骂人的句子,然后随机读取一条输出即可。
核心代码就一行:
```sql
SELECT * FROM `main` ORDER BY RANDOM() limit 1
```
## 词库都是怎么来的
最初来源于网络收集了一些,后来基本就都是各位用户的投稿了,投稿渠道现已关闭。
## 写在最后
还有其他好玩的生成器,比如彩虹屁生成器、毒鸡汤、朋友圈文案等等,请访问 https://shadiao.app 体验。
同时也欢迎交流,可以扫码加微信,请备注 `github`,同时有**粉丝群**与**开发者群**,有兴趣可以私聊告知,会尽快拉你。
![](http://qiniu.xshwy.cn/ddd.jpg)
最初来源于网络收集了一些,后来基本就都是各位用户的投稿了,投稿渠道现已关闭。
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "zuanbot",
"private": true,
"version": "0.2.0",
"version": "0.2.1",
"type": "module",
"scripts": {
"dev": "vite",
+1 -1
View File
@@ -5233,7 +5233,7 @@ dependencies = [
[[package]]
name = "zuanbot"
version = "0.2.0"
version = "0.2.1"
dependencies = [
"anyhow",
"rusqlite",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "zuanbot"
version = "0.2.0"
version = "0.2.1"
description = "祖安助手"
authors = ["zihluwang"]
edition = "2021"
+7
View File
@@ -0,0 +1,7 @@
Copyright (c) 2025 Zihlu Wang
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.
File renamed without changes.
+1 -1
View File
@@ -30,7 +30,7 @@ impl Database {
fn get_bundled_database_path(app_handle: &tauri::AppHandle) -> Result<PathBuf> {
let resource_path = app_handle
.path()
.resolve("data.db", tauri::path::BaseDirectory::Resource)?;
.resolve("./resources/data.db", tauri::path::BaseDirectory::Resource)?;
println!("Database path: {:?}", resource_path);
Ok(resource_path)
+23 -6
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "zuanbot",
"version": "0.2.0",
"productName": "Zuanbot",
"version": "0.2.1",
"identifier": "io.github.zihluwang.zuanbot",
"build": {
"beforeDevCommand": "pnpm dev",
@@ -12,9 +12,13 @@
"app": {
"windows": [
{
"title": "骂人宝典",
"title": "祖安语录",
"width": 560,
"height": 400
"maxWidth": 560,
"minWidth": 560,
"height": 400,
"maxHeight": 400,
"minHeight": 400
}
],
"security": {
@@ -23,7 +27,20 @@
},
"bundle": {
"active": true,
"targets": "all",
"publisher": "Zihlu Wang",
"category": "Utility",
"targets": ["dmg", "msi"],
"windows": {
"wix": {
"language": "zh-CN"
},
"webviewInstallMode": {
"type": "embedBootstrapper"
}
},
"license": "MIT",
"licenseFile": "./resources/Licence.txt",
"copyright": "Data Collected by @cndiandian, Developed by @zihluwang.",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
@@ -32,7 +49,7 @@
"icons/icon.ico"
],
"resources": [
"./data.db"
"./resources/data.db"
]
}
}
+21 -10
View File
@@ -1,10 +1,6 @@
import React, { useEffect, useState } from "react"
import { invoke } from "@tauri-apps/api/core"
enum Level {
min = "min",
max = "max",
}
import { Level } from "@/types"
import * as service from "@/service"
export default function App() {
const [text, setText] = useState<string>("")
@@ -12,26 +8,41 @@ export default function App() {
const [last, setLast] = useState<string>("")
useEffect(() => {
// 加载一条祖安语录
;(async () => {
await getMessage()
})()
// 第一条消息,禁用上一条功能
setIsLast(true)
}, [])
/**
* 获取一条祖安语录
* @param level 语录等级
*/
const getMessage = async (level?: Level) => {
// 开放上一条功能
setIsLast(false)
// 保存上一条信息
setLast(text)
// 获取下一条信息
const nextMessage = await invoke<string>("get_message", { level })
setText(nextMessage)
const nextZuanMessage = await service.nextZuan(level)
setText(nextZuanMessage)
}
/**
* 展示上一条祖安语录
*/
const showLast = () => {
setIsLast(true)
setText(last)
}
// 复制文字到剪贴板
/**
* 复制文字到剪贴板
*/
const copyToClipboard = () => {
if (navigator.clipboard) {
navigator.clipboard.writeText(text).then(
@@ -43,7 +54,7 @@ export default function App() {
}
)
} else {
alert("当前浏览器不支持复制功能")
alert("暂时不支持复制功能")
}
}
+10
View File
@@ -0,0 +1,10 @@
import { invoke } from "@tauri-apps/api/core"
import { Level } from "@/types"
/**
* 从服务端获取下一条祖安语录
* @param level 祖安级别
*/
export async function nextZuan(level?: Level) {
return await invoke<string>("get_message", { level })
}
+4
View File
@@ -0,0 +1,4 @@
export enum Level {
min = "min",
max = "max"
}