diff --git a/.github/desktop-tauri.jpeg b/.github/desktop-tauri.jpeg
new file mode 100644
index 00000000..cf4d691e
Binary files /dev/null and b/.github/desktop-tauri.jpeg differ
diff --git a/Makefile b/Makefile
index e41ed00b..4a23ba98 100644
--- a/Makefile
+++ b/Makefile
@@ -2,13 +2,14 @@
BUILD_VERSION := $(shell cat version)
BUILD_DATE := $(shell date +'%Y-%m-%d %H:%M:%S')
SHA_SHORT := $(shell git rev-parse --short HEAD)
+TAGS = ""
all: fmt build
build:
@go mod download
@echo Build paopao-ce
bash build.sh paopao-ce
run:
- @go run -ldflags "-X 'main.version=${BUILD_VERSION}' -X 'main.buildDate=${BUILD_DATE}' -X 'main.commitID=${SHA_SHORT}'" .
+ @go run -tags '$(TAGS)' -ldflags "-X 'main.version=${BUILD_VERSION}' -X 'main.buildDate=${BUILD_DATE}' -X 'main.commitID=${SHA_SHORT}'" .
clean:
@go clean
@find ./dist -type f -exec rm -r {} +
@@ -23,6 +24,10 @@ fmt:
@go vet -composites=false ./pkg/...
help:
@echo "make: make"
+ @echo "make run: start api server"
@echo "make build: build executables"
+ @echo "make build: build executables"
+ @echo "make run TAGS='embed': start api server and serve embed web frontend"
+ @echo "make build TAGS='embed': build executables with embed web frontend"
.EXPORT_ALL_VARIABLES:
GO111MODULE = on
diff --git a/README.md b/README.md
index 1b56f635..40ff3323 100644
--- a/README.md
+++ b/README.md
@@ -30,12 +30,15 @@
---
## 预览
-
+Web端:
[![明色主题][product-light-screenshot]](https://www.paopao.info)
[![暗色主题][product-dark-screenshot]](https://www.paopao.info)
-更多演示请前往[官网](https://www.paopao.info)体验(谢绝灌水)
+更多演示请前往[官网](https://www.paopao.info)体验(谢绝灌水)
+
+桌面端:
+![](.github/desktop-tauri.jpeg)
(back to top)
@@ -83,18 +86,25 @@ PaoPao主要由以下优秀的开源项目/工具构建
1. 导入项目根目录下的 `paopao.sql` 文件至MySQL数据库
2. 拷贝项目根目录下 `config.yaml.sample` 文件至 `config.yaml`,按照注释完成配置编辑
-3. 编译后端
-
+3. 编译后端
+ 编译api服务:
```sh
- go mod download
- go build -o paopao-api .
+ make build
```
+ 编译api服务、内嵌web前端ui; 注意此步骤需要先编译web前端。
+ ```sh
+ make build TAGS='embed'
+ ```
+ 编译后在`dist`目录可以找到对应可执行文件。
-4. 启动后端
-
+4. 启动后端
+ 运行api服务:
```sh
- chmod +x paopao-api
- ./paopao-api
+ make run
+ ```
+ 运行api服务、web前端ui服务:
+ ```sh
+ make run TAGS='embed'
```
#### 前端
@@ -115,6 +125,29 @@ PaoPao主要由以下优秀的开源项目/工具构建
build完成后,可以在dist目录获取编译产出,配置nginx指向至该目录即可
+#### 桌面端
+
+1. 进入前端目录 `web`,编辑 `.env` 文件中后端服务地址,下载依赖包
+
+ ```sh
+ cd ./web
+ vim .env
+ yarn
+ ```
+
+2. 编译前端
+
+ ```sh
+ yarn build
+ ```
+
+3. 构建桌面端
+ ```sh
+ yarn tauri build
+ ```
+ 桌面端是使用[Rust](https://www.rust-lang.org/) + [tauri](https://github.com/tauri-apps/tauri)编写
+ 的,需要Rust编译环境,具体安装指南请参考[https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install).
+
### 其他说明
建议后端服务使用 `supervisor` 守护进程,并通过 `nginx` 反向代理后,提供API给前端服务调用。
diff --git a/build.sh b/build.sh
index e6154804..f49c00c8 100644
--- a/build.sh
+++ b/build.sh
@@ -20,13 +20,13 @@ for pl in ${PLATFORMS}; do
echo "build => ${TARGET}"
if [ "${DEBUG_MODE}" == "debug" ]; then
- go build -trimpath -gcflags "all=-N -l" -o "${TARGET}" \
+ go build -trimpath -gcflags "all=-N -l" -o "${TARGET}" -tags "${TAGS}" \
-ldflags "-X 'main.version=${BUILD_VERSION}' \
-X 'main.buildDate=${BUILD_DATE}' \
-X 'main.commitID=${SHA_SHORT}'\
-w -s"
else
- go build -trimpath -o "${TARGET}" \
+ go build -trimpath -o "${TARGET}" -tags "${TAGS}" \
-ldflags "-X 'main.version=${BUILD_VERSION}' \
-X 'main.buildDate=${BUILD_DATE}' \
-X 'main.commitID=${SHA_SHORT}'\
diff --git a/internal/routers/router.go b/internal/routers/router.go
index 449f3e02..f735bc2a 100644
--- a/internal/routers/router.go
+++ b/internal/routers/router.go
@@ -10,16 +10,22 @@ import (
)
func NewRouter() *gin.Engine {
- r := gin.New()
- r.HandleMethodNotAllowed = true
- r.Use(gin.Logger())
- r.Use(gin.Recovery())
+ e := gin.New()
+ e.HandleMethodNotAllowed = true
+ e.Use(gin.Logger())
+ e.Use(gin.Recovery())
// 跨域配置
corsConfig := cors.DefaultConfig()
corsConfig.AllowAllOrigins = true
corsConfig.AddAllowHeaders("Authorization")
- r.Use(cors.New(corsConfig))
+ e.Use(cors.New(corsConfig))
+
+ // 按需注册静态资源路由
+ registerStatick(e)
+
+ // v1 group api
+ r := e.Group("/v1")
// 获取version
r.GET("/", api.Version)
@@ -163,18 +169,18 @@ func NewRouter() *gin.Engine {
}
// 默认404
- r.NoRoute(func(c *gin.Context) {
+ e.NoRoute(func(c *gin.Context) {
c.JSON(http.StatusNotFound, gin.H{
"code": 404,
"msg": "Not Found",
})
})
// 默认405
- r.NoMethod(func(c *gin.Context) {
+ e.NoMethod(func(c *gin.Context) {
c.JSON(http.StatusMethodNotAllowed, gin.H{
"code": 405,
"msg": "Method Not Allowed",
})
})
- return r
+ return e
}
diff --git a/internal/routers/statick.go b/internal/routers/statick.go
new file mode 100644
index 00000000..c20d5059
--- /dev/null
+++ b/internal/routers/statick.go
@@ -0,0 +1,13 @@
+//go:build !embed
+// +build !embed
+
+package routers
+
+import (
+ "github.com/gin-gonic/gin"
+)
+
+// registerStatick stub function for register static asset route
+func registerStatick(e *gin.Engine) {
+ // empty
+}
diff --git a/internal/routers/statick_embed.go b/internal/routers/statick_embed.go
new file mode 100644
index 00000000..2ea56171
--- /dev/null
+++ b/internal/routers/statick_embed.go
@@ -0,0 +1,27 @@
+//go:build embed
+// +build embed
+
+package routers
+
+import (
+ "net/http"
+
+ "github.com/gin-gonic/gin"
+ "github.com/rocboss/paopao-ce/web"
+)
+
+// registerStatick register static assets route
+func registerStatick(e *gin.Engine) {
+ routeStatic(e, "/", "/index.html", "/favicon.ico", "/assets/*filepath")
+}
+
+func routeStatic(e *gin.Engine, paths ...string) {
+ staticHandler := http.FileServer(web.NewFileSystem())
+ handler := func(c *gin.Context) {
+ staticHandler.ServeHTTP(c.Writer, c.Request)
+ }
+ for _, path := range paths {
+ e.GET(path, handler)
+ e.HEAD(path, handler)
+ }
+}
diff --git a/web/.gitignore b/web/.gitignore
index ba6b09ec..5e36b5b9 100644
--- a/web/.gitignore
+++ b/web/.gitignore
@@ -11,6 +11,7 @@ node_modules
dist
dist-ssr
*.local
+.env
# Editor directories and files
.vscode/*
diff --git a/web/embed.go b/web/embed.go
new file mode 100644
index 00000000..4866a53a
--- /dev/null
+++ b/web/embed.go
@@ -0,0 +1,19 @@
+//go:build embed
+// +build embed
+
+package web
+
+import (
+ "embed"
+ "io/fs"
+ "net/http"
+)
+
+//go:embed dist/*
+var files embed.FS
+
+// NewFileSystem get an embed static assets http.FileSystem instance.
+func NewFileSystem() http.FileSystem {
+ subfs, _ := fs.Sub(files, "dist")
+ return http.FS(subfs)
+}
diff --git a/web/package.json b/web/package.json
index 78bd809a..d93e4413 100644
--- a/web/package.json
+++ b/web/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "vite",
"build": "vite build",
- "preview": "vite preview"
+ "preview": "vite preview",
+ "tauri": "tauri"
},
"dependencies": {
"@vicons/carbon": "^0.12.0",
@@ -29,6 +30,7 @@
"vuex": "^4.0.2"
},
"devDependencies": {
+ "@tauri-apps/cli": "^1.0.0-rc.7",
"@types/node": "^17.0.35",
"@types/qrcode": "^1.4.2",
"@vitejs/plugin-vue": "^2.3.1",
diff --git a/web/src-tauri/.gitignore b/web/src-tauri/.gitignore
new file mode 100644
index 00000000..25279840
--- /dev/null
+++ b/web/src-tauri/.gitignore
@@ -0,0 +1,5 @@
+# Generated by Cargo
+# will have compiled files and executables
+/target/
+WixTools
+Cargo.lock
diff --git a/web/src-tauri/Cargo.toml b/web/src-tauri/Cargo.toml
new file mode 100644
index 00000000..f1f34a5d
--- /dev/null
+++ b/web/src-tauri/Cargo.toml
@@ -0,0 +1,23 @@
+[package]
+name = "paopao"
+version = "0.1.0"
+description = "Paopao App"
+authors = ["Rocboss"]
+license = "MIT License"
+repository = "https://github.com/rocboss/paopao-ce"
+edition = "2021"
+rust-version = "1.57"
+
+[build-dependencies]
+tauri-build = { version = "1.0.0-rc.4", features = [] }
+
+[dependencies]
+tauri = { version = "1.0.0-rc.4", features = ["api-all"] }
+
+[features]
+# by default Tauri runs in production mode
+# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
+default = [ "custom-protocol" ]
+# this feature is used used for production builds where `devPath` points to the filesystem
+# DO NOT remove this
+custom-protocol = [ "tauri/custom-protocol" ]
diff --git a/web/src-tauri/build.rs b/web/src-tauri/build.rs
new file mode 100644
index 00000000..d860e1e6
--- /dev/null
+++ b/web/src-tauri/build.rs
@@ -0,0 +1,3 @@
+fn main() {
+ tauri_build::build()
+}
diff --git a/web/src-tauri/icons/128x128.png b/web/src-tauri/icons/128x128.png
new file mode 100644
index 00000000..8976d45d
Binary files /dev/null and b/web/src-tauri/icons/128x128.png differ
diff --git a/web/src-tauri/icons/128x128@2x.png b/web/src-tauri/icons/128x128@2x.png
new file mode 100644
index 00000000..826a74fc
Binary files /dev/null and b/web/src-tauri/icons/128x128@2x.png differ
diff --git a/web/src-tauri/icons/32x32.png b/web/src-tauri/icons/32x32.png
new file mode 100644
index 00000000..96e054be
Binary files /dev/null and b/web/src-tauri/icons/32x32.png differ
diff --git a/web/src-tauri/icons/icon.icns b/web/src-tauri/icons/icon.icns
new file mode 100644
index 00000000..80eebbf3
Binary files /dev/null and b/web/src-tauri/icons/icon.icns differ
diff --git a/web/src-tauri/icons/icon.ico b/web/src-tauri/icons/icon.ico
new file mode 100644
index 00000000..92783607
Binary files /dev/null and b/web/src-tauri/icons/icon.ico differ
diff --git a/web/src-tauri/src/main.rs b/web/src-tauri/src/main.rs
new file mode 100644
index 00000000..6c858d61
--- /dev/null
+++ b/web/src-tauri/src/main.rs
@@ -0,0 +1,52 @@
+#![cfg_attr(
+ all(not(debug_assertions), target_os = "windows"),
+ windows_subsystem = "windows"
+)]
+
+use tauri::api::shell;
+use tauri::{CustomMenuItem, Manager, Menu, MenuEntry, MenuItem, Submenu};
+
+fn main() {
+ let _ctx = tauri::generate_context!();
+
+ tauri::Builder::default()
+ .menu(Menu::with_items([
+ #[cfg(target_os = "macos")]
+ MenuEntry::Submenu(Submenu::new(
+ &_ctx.package_info().name,
+ Menu::with_items([
+ MenuItem::Separator.into(),
+ MenuItem::Services.into(),
+ MenuItem::Separator.into(),
+ MenuItem::Hide.into(),
+ MenuItem::HideOthers.into(),
+ MenuItem::ShowAll.into(),
+ MenuItem::Separator.into(),
+ MenuItem::Quit.into(),
+ ]),
+ )),
+ MenuEntry::Submenu(Submenu::new(
+ "Window",
+ Menu::with_items([MenuItem::Minimize.into(), MenuItem::Zoom.into()]),
+ )),
+ // You should always have a Help menu on macOS because it will automatically
+ // show a menu search field
+ MenuEntry::Submenu(Submenu::new(
+ "Help",
+ Menu::with_items([CustomMenuItem::new("Learn More", "Learn More").into()]),
+ )),
+ ]))
+ .on_menu_event(|event| {
+ let event_name = event.menu_item_id();
+ event.window().emit("menu", event_name).unwrap();
+ match event_name {
+ "Learn More" => {
+ let link = "https://github.com/rocboss/paopao-ce".to_string();
+ shell::open(&event.window().shell_scope(), link, None).unwrap();
+ }
+ _ => {}
+ }
+ })
+ .run(tauri::generate_context!())
+ .expect("error while running tauri application");
+}
diff --git a/web/src-tauri/tauri.conf.json b/web/src-tauri/tauri.conf.json
new file mode 100644
index 00000000..e28b7816
--- /dev/null
+++ b/web/src-tauri/tauri.conf.json
@@ -0,0 +1,74 @@
+{
+ "package": {
+ "productName": "Paopao",
+ "version": "0.1.0"
+ },
+ "build": {
+ "distDir": "../dist",
+ "beforeDevCommand": "",
+ "beforeBuildCommand": "",
+ "withGlobalTauri": true
+ },
+ "tauri": {
+ "bundle": {
+ "active": true,
+ "targets": "all",
+ "identifier": "tauri.paopao.info",
+ "icon": [
+ "icons/32x32.png",
+ "icons/128x128.png",
+ "icons/128x128@2x.png",
+ "icons/icon.icns",
+ "icons/icon.ico"
+ ],
+ "resources": [],
+ "externalBin": [],
+ "copyright": "",
+ "category": "Social Networking",
+ "shortDescription": "",
+ "longDescription": "",
+ "deb": {
+ "depends": []
+ },
+ "macOS": {
+ "frameworks": [],
+ "minimumSystemVersion": "",
+ "exceptionDomain": "",
+ "signingIdentity": null,
+ "providerShortName": null,
+ "entitlements": null
+ },
+ "windows": {
+ "certificateThumbprint": null,
+ "digestAlgorithm": "sha256",
+ "timestampUrl": ""
+ }
+ },
+ "updater": {
+ "active": false
+ },
+ "allowlist": {
+ "all": true,
+ "http": {
+ "all": true,
+ "request": true,
+ "scope": ["https://**", "http://**"]
+ },
+ "notification": {
+ "all": true
+ }
+ },
+ "windows": [
+ {
+ "title": "泡泡 - 闲了,冒个泡",
+ "width": 1080,
+ "height": 800,
+ "resizable": true,
+ "fullscreen": false
+ }
+ ],
+ "security": {
+ "csp": null
+ }
+ }
+}
diff --git a/web/src/api/auth.ts b/web/src/api/auth.ts
index 904e9bba..4d5a066d 100644
--- a/web/src/api/auth.ts
+++ b/web/src/api/auth.ts
@@ -4,7 +4,7 @@ import { request } from '@/utils/request';
export const userLogin = (params: NetParams.AuthUserLogin): Promise => {
return request({
method: 'post',
- url: '/auth/login',
+ url: '/v1/auth/login',
data: params,
});
};
@@ -13,7 +13,7 @@ export const userLogin = (params: NetParams.AuthUserLogin): Promise => {
return request({
method: 'post',
- url: '/auth/register',
+ url: '/v1/auth/register',
data: params,
});
};
@@ -22,7 +22,7 @@ export const userRegister = (params: NetParams.AuthUserRegister): Promise => {
return request({
method: 'get',
- url: '/user/info',
+ url: '/v1/user/info',
headers: {
Authorization: `Bearer ${token}`,
},
@@ -33,7 +33,7 @@ export const userInfo = (token: NetParams.AuthUserInfo = ""): Promise => {
return request({
method: 'post',
- url: '/api/user/password',
+ url: '/v1/api/user/password',
data,
});
};
diff --git a/web/src/api/post.ts b/web/src/api/post.ts
index 49386cc6..7f2bc408 100644
--- a/web/src/api/post.ts
+++ b/web/src/api/post.ts
@@ -4,7 +4,7 @@ import { request } from '@/utils/request';
export const getPosts = (params: NetParams.PostGetPosts): Promise => {
return request({
method: 'get',
- url: '/posts',
+ url: '/v1/posts',
params
});
};
@@ -13,7 +13,7 @@ export const getPosts = (params: NetParams.PostGetPosts): Promise => {
return request({
method: 'get',
- url: '/tags',
+ url: '/v1/tags',
params
});
};
@@ -22,7 +22,7 @@ export const getTags = (params: NetParams.PostGetTags): Promise => {
return request({
method: 'get',
- url: '/post',
+ url: '/v1/post',
params
});
};
@@ -31,7 +31,7 @@ export const getPost = (params: NetParams.PostGetPost): Promise => {
return request({
method: 'get',
- url: '/post/star',
+ url: '/v1/post/star',
params
});
};
@@ -40,7 +40,7 @@ export const getPostStar = (params: NetParams.PostPostStar): Promise => {
return request({
method: 'post',
- url: '/post/star',
+ url: '/v1/post/star',
data
});
};
@@ -49,7 +49,7 @@ export const postStar = (data: NetParams.PostPostStar): Promise => {
return request({
method: 'get',
- url: '/post/collection',
+ url: '/v1/post/collection',
params
});
};
@@ -58,7 +58,7 @@ export const getPostCollection = (params: NetParams.PostGetPostCollection): Prom
export const postCollection = (data: NetParams.PostPostCollection): Promise => {
return request({
method: 'post',
- url: '/post/collection',
+ url: '/v1/post/collection',
data
});
};
@@ -67,7 +67,7 @@ export const postCollection = (data: NetParams.PostPostCollection): Promise => {
return request({
method: 'get',
- url: '/post/comments',
+ url: '/v1/post/comments',
params
});
};
@@ -76,7 +76,7 @@ export const getPostComments = (params: NetParams.PostGetPostComments): Promise<
export const createPost = (data: NetParams.PostCreatePost): Promise => {
return request({
method: 'post',
- url: '/post',
+ url: '/v1/post',
data
});
};
@@ -85,7 +85,7 @@ export const createPost = (data: NetParams.PostCreatePost): Promise => {
return request({
method: 'delete',
- url: '/post',
+ url: '/v1/post',
data
});
};
@@ -94,7 +94,7 @@ export const deletePost = (data: NetParams.PostDeletePost): Promise => {
return request({
method: 'post',
- url: '/post/lock',
+ url: '/v1/post/lock',
data
});
};
@@ -103,7 +103,7 @@ export const lockPost = (data: NetParams.PostLockPost): Promise => {
return request({
method: 'post',
- url: '/post/stick',
+ url: '/v1/post/stick',
data
});
};
@@ -112,7 +112,7 @@ export const stickPost = (data: NetParams.PostStickPost): Promise => {
return request({
method: 'post',
- url: '/post/comment',
+ url: '/v1/post/comment',
data
});
};
@@ -121,7 +121,7 @@ export const createComment = (data: NetParams.PostCreateComment): Promise => {
return request({
method: 'delete',
- url: '/post/comment',
+ url: '/v1/post/comment',
data
});
};
@@ -130,7 +130,7 @@ export const deleteComment = (data: NetParams.PostDeleteComment): Promise => {
return request({
method: 'post',
- url: '/post/comment/reply',
+ url: '/v1/post/comment/reply',
data
});
};
@@ -139,7 +139,7 @@ export const createCommentReply = (data: NetParams.PostCreateCommentReply): Prom
export const deleteCommentReply = (data: NetParams.PostDeleteCommentReply): Promise => {
return request({
method: 'delete',
- url: '/post/comment/reply',
+ url: '/v1/post/comment/reply',
data
});
};
diff --git a/web/src/api/user.ts b/web/src/api/user.ts
index 2828290c..ea6c1adf 100644
--- a/web/src/api/user.ts
+++ b/web/src/api/user.ts
@@ -4,7 +4,7 @@ import { request } from '@/utils/request';
export const getCaptcha = (params: NetParams.UserGetCaptcha = {}): Promise => {
return request({
method: 'get',
- url: '/captcha',
+ url: '/v1/captcha',
params
});
};
@@ -17,7 +17,7 @@ export const getCaptcha = (params: NetParams.UserGetCaptcha = {}): Promise {
return request({
method: 'post',
- url: '/captcha',
+ url: '/v1/captcha',
data
});
};
@@ -30,7 +30,7 @@ export const sendCaptcha = (data: any) => {
export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => {
return request({
method: 'post',
- url: '/user/whisper',
+ url: '/v1/user/whisper',
data
});
};
@@ -43,7 +43,7 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => {
return request({
method: 'post',
- url: '/user/phone',
+ url: '/v1/user/phone',
data
});
};
@@ -52,7 +52,7 @@ export const bindUserPhone = (data: NetParams.UserBindUserPhone): Promise => {
return request({
method: 'post',
- url: '/user/password',
+ url: '/v1/user/password',
data
});
};
@@ -61,7 +61,7 @@ export const changePassword = (data: NetParams.UserChangePassword): Promise => {
return request({
method: 'post',
- url: '/user/nickname',
+ url: '/v1/user/nickname',
data
});
};
@@ -74,7 +74,7 @@ export const changeNickname = (data: NetParams.UserChangeNickname): Promise {
return request({
method: 'post',
- url: '/user/avatar',
+ url: '/v1/user/avatar',
data
});
};
@@ -83,7 +83,7 @@ export const changeAvatar = (data: any) => {
export const getUnreadMsgCount = (params: NetParams.UserGetUnreadMsgCount = {}): Promise => {
return request({
method: 'get',
- url: '/user/msgcount/unread',
+ url: '/v1/user/msgcount/unread',
params
});
};
@@ -92,7 +92,7 @@ export const getUnreadMsgCount = (params: NetParams.UserGetUnreadMsgCount = {}):
export const getMessages = (params: NetParams.UserGetMessages): Promise => {
return request({
method: 'get',
- url: '/user/messages',
+ url: '/v1/user/messages',
params
});
};
@@ -105,7 +105,7 @@ export const getMessages = (params: NetParams.UserGetMessages): Promise {
return request({
method: 'post',
- url: '/user/message/read',
+ url: '/v1/user/message/read',
data
});
};
@@ -114,7 +114,7 @@ export const readMessage = (data: any) => {
export const getCollections = (params: NetParams.UserGetCollections): Promise => {
return request({
method: 'get',
- url: '/user/collections',
+ url: '/v1/user/collections',
params
});
};
@@ -123,7 +123,7 @@ export const getCollections = (params: NetParams.UserGetCollections): Promise => {
return request({
method: 'get',
- url: '/user/stars',
+ url: '/v1/user/stars',
params
});
};
@@ -132,7 +132,7 @@ export const getStars = (params: NetParams.UserGetStars): Promise => {
return request({
method: 'get',
- url: '/user/profile',
+ url: '/v1/user/profile',
params
});
};
@@ -141,7 +141,7 @@ export const getUserProfile = (params: NetParams.UserGetUserProfile): Promise => {
return request({
method: 'get',
- url: '/user/posts',
+ url: '/v1/user/posts',
params
});
};
@@ -150,7 +150,7 @@ export const getUserPosts = (params: NetParams.UserGetUserPosts): Promise => {
return request({
method: 'get',
- url: '/user/wallet/bills',
+ url: '/v1/user/wallet/bills',
params
});
};
@@ -163,7 +163,7 @@ export const getBills = (params: NetParams.UserGetBills): Promise => {
return request({
method: 'post',
- url: '/user/recharge',
+ url: '/v1/user/recharge',
data
});
};
@@ -176,7 +176,7 @@ export const reqRecharge = (data: NetParams.UserReqRecharge): Promise => {
return request({
method: 'get',
- url: '/user/recharge',
+ url: '/v1/user/recharge',
params
});
};
@@ -189,7 +189,7 @@ export const getRecharge = (params: NetParams.UserGetRecharge): Promise => {
return request({
method: 'get',
- url: '/suggest/users',
+ url: '/v1/suggest/users',
params
});
};
@@ -202,7 +202,7 @@ export const getSuggestUsers = (params: { k: string }): Promise => {
return request({
method: 'get',
- url: '/suggest/tags',
+ url: '/v1/suggest/tags',
params
});
};
@@ -215,7 +215,7 @@ export const getSuggestTags = (params: { k: string }): Promise => {
return request({
method: 'get',
- url: '/attachment/precheck',
+ url: '/v1/attachment/precheck',
params
});
};
@@ -228,7 +228,7 @@ export const precheckAttachment = (params: NetParams.UserPrecheckAttachment): Pr
export const getAttachment = (params: NetParams.UserGetAttachment): Promise => {
return request({
method: 'get',
- url: '/attachment',
+ url: '/v1/attachment',
params
});
};
diff --git a/web/yarn.lock b/web/yarn.lock
index cc2ab349..9a7dafa3 100644
--- a/web/yarn.lock
+++ b/web/yarn.lock
@@ -84,6 +84,66 @@
estree-walker "^2.0.1"
picomatch "^2.2.2"
+"@tauri-apps/cli-darwin-arm64@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.0.0-rc.13.tgz#da73a770835ffd63a149d8becf50d3781e1c97dd"
+ integrity sha512-/EqOz7ASHOU98H58Ibbkg12pLG/P5oyQz8OlueaMYryajkJdmi+bHTkJ05DfbS0owAaHkRJ6f+NmoW/AnyqUbg==
+
+"@tauri-apps/cli-darwin-x64@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.0.0-rc.13.tgz#e120cc623fddca3eb9d7fea0c2de057c7440a821"
+ integrity sha512-bvZ0MBKFD1kc4gdVPXgwUA6tHNKj0EmlQK0Xolk6PYP9vZZeNTP1vejevW0bh2IqxC8DuqUArbG9USXwu+LFbQ==
+
+"@tauri-apps/cli-linux-arm-gnueabihf@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.0.0-rc.13.tgz#3052a59788ae57ad690d4bc09bf0756bc8808116"
+ integrity sha512-yODvfUkNvtYYdDTOJSDXMx9fpoEB66I2PTrYx1UKonKTEaLrQDcpw2exD/S9LPQzCYgyTuJ/kHRhG1uLdO/UUQ==
+
+"@tauri-apps/cli-linux-arm64-gnu@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.0.0-rc.13.tgz#9c4094473890c165a4fb22132229ed8212559f79"
+ integrity sha512-kVDJHERD8CmTeMcd2VTnD/nVCHdnNAK8a6ur3l0KTR1iF8A1AtN/sPahMQjK4f7Ar00UDjIzTw74liqakOeiZg==
+
+"@tauri-apps/cli-linux-arm64-musl@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.0.0-rc.13.tgz#16270a6d3b9289993b9b4d837f63dba4991d9be5"
+ integrity sha512-PFHz+0xKCGMqqn2TmbOSPvTRS61xJQV7srwTZjs5sHBvK536mdBnF/6V6BPEvTn5LzfRnxMu2A5X5GFkYnrZ7w==
+
+"@tauri-apps/cli-linux-x64-gnu@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.0.0-rc.13.tgz#d2f5031f9597300a5814dc8b4d3c59e8dc25a871"
+ integrity sha512-EWhTOUNHaaMM7mxp/ue+Osnzn6/o9/7qVle3MSnNI9pGQzumc/dOtBs+sWS/NPXdVEiWKET2mFMK120KJlYcQQ==
+
+"@tauri-apps/cli-linux-x64-musl@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.0.0-rc.13.tgz#9d8b02de7bd5af71c5d3d5be96ec88f3f29c8fbd"
+ integrity sha512-i8lsKw5iAGTAhqSQHeUCISLjhRXNrloHPoFCaSZtU0/GAPGbW/qST7u593h7cKWxRooeMwzo74ij4GhgmddClQ==
+
+"@tauri-apps/cli-win32-ia32-msvc@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.0.0-rc.13.tgz#1fcf6bed5a89af2cb30a2fe2e823ca486ded61b7"
+ integrity sha512-rJxSqWIQXeeT2oLzSiQyqZPgDKSGH5sK7MUr8cOCBitqy3T0COlOMX4O7hhqF3cJ/5s0aX+MuNZBzF/D0QUcxA==
+
+"@tauri-apps/cli-win32-x64-msvc@1.0.0-rc.13":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.0.0-rc.13.tgz#ed2feaf3b3a120c1460cae8941443563d14840bb"
+ integrity sha512-ifOTrJVQoBAQUYX+EVnE4XJ/FCMHs4FQ8qxGNszqkSxrU24mmT7La6tzj77352q80KnxRa05xjjLL6GGhmzXRg==
+
+"@tauri-apps/cli@^1.0.0-rc.7":
+ version "1.0.0-rc.13"
+ resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-1.0.0-rc.13.tgz#e58127ebe24c6cc81c3258229219056199421500"
+ integrity sha512-q7i45Mi1SMv5XllNoX09QS4Q/fYVFwD6piVYmqMSrKY/T5RwedQhytiVH60TxC2xk6o0akVHa7BdYiyJvXNR8A==
+ optionalDependencies:
+ "@tauri-apps/cli-darwin-arm64" "1.0.0-rc.13"
+ "@tauri-apps/cli-darwin-x64" "1.0.0-rc.13"
+ "@tauri-apps/cli-linux-arm-gnueabihf" "1.0.0-rc.13"
+ "@tauri-apps/cli-linux-arm64-gnu" "1.0.0-rc.13"
+ "@tauri-apps/cli-linux-arm64-musl" "1.0.0-rc.13"
+ "@tauri-apps/cli-linux-x64-gnu" "1.0.0-rc.13"
+ "@tauri-apps/cli-linux-x64-musl" "1.0.0-rc.13"
+ "@tauri-apps/cli-win32-ia32-msvc" "1.0.0-rc.13"
+ "@tauri-apps/cli-win32-x64-msvc" "1.0.0-rc.13"
+
"@types/jest@^27.0.1":
version "27.4.1"
resolved "https://registry.npmmirror.com/@types/jest/-/jest-27.4.1.tgz"