Skip to content

Commit

Permalink
📝 开发文档
Browse files Browse the repository at this point in the history
  • Loading branch information
fzf404 committed Apr 1, 2023
2 parents 3f355e5 + b556249 commit e8daa51
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 179 deletions.
13 changes: 2 additions & 11 deletions app/layouts/maco.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: fzf404
* @Date: 2022-05-23 17:03:20
* @LastEditors: fzf404 [email protected]
* @LastEditTime: 2023-03-23 20:41:25
* @LastEditTime: 2023-04-01 15:26:58
* @Description: maco 布局
-->

Expand All @@ -27,23 +27,14 @@
<!-- 状态控制器 -->
<ul class="absolute right-2 space-x-1">
<!-- 断网提示 -->
<!-- <WifiSVG v-show="pinia.hasNetwork" class="btn-svg w-4 text-red-400 hover:text-red-500" /> -->
<WifiSVG v-show="!pinia.hasNetwork" class="btn-svg w-4 text-red-400 hover:text-red-500" />
<!-- 布局 -->
<component
:is="layout.icon"
class="btn-svg w-4 text-green-400 hover:text-green-500"
@click="store.layout = layout.next" />
<!-- 主题 -->
<component
:is="theme.icon"
class="btn-svg w-4"
:class="{
'text-indigo-400 hover:text-indigo-500': theme.name == 'dark',
'text-orange-400 hover:text-orange-500': theme.name == 'light',
'text-yellow-400 hover:text-yellow-500': theme.name == 'punk'
}"
@click="store.theme = theme.next" />
<component :is="theme.icon" class="btn-svg icon-theme w-4" @click="store.theme = theme.next" />
<!-- 设置 -->
<SettingSVG
v-show="pinia.hasSetting"
Expand Down
12 changes: 2 additions & 10 deletions app/layouts/wine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: fzf404
* @Date: 2022-07-22 00:24:58
* @LastEditors: fzf404 [email protected]
* @LastEditTime: 2023-03-23 20:41:42
* @LastEditTime: 2023-04-01 15:27:15
* @Description: winer 布局
-->

Expand All @@ -16,15 +16,7 @@
class="hover-dynamic btn-svg w-5 text-blue-400"
@click="pinia.toggleSetting()" />
<!-- 主题 -->
<component
:is="theme.icon"
class="hover-dynamic btn-svg w-5"
:class="{
'text-indigo-400 ': theme.name == 'dark',
'text-orange-400': theme.name == 'light',
'text-yellow-400 ': theme.name == 'punk'
}"
@click="store.theme = theme.next" />
<component :is="theme.icon" class="hover-dynamic btn-svg icon-theme w-5" @click="store.theme = theme.next" />
<!-- 布局 -->
<component
:is="layout.icon"
Expand Down
28 changes: 14 additions & 14 deletions app/plugins/music.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* @Author: fzf404
* @Date: 2022-05-25 23:18:50
* @LastEditors: fzf404 [email protected]
* @LastEditTime: 2023-03-30 13:47:16
* @LastEditTime: 2023-04-01 14:52:32
* @Description: music 网易云音乐播放
-->

<template>
<!-- 设置 -->
<Setting :store="store" :setting="setting" @save="getPlayList" />
<!-- 图像展示 -->
<Image :show="state.login.show" remark="请使用网易云音乐扫码登陆" :image="state.login.qrcode" />
<Image :show="state.login.show" remark="请使用网易云音乐扫码登录" :image="state.login.qrcode" />
<!-- 加载中 -->
<Loading :show="state.loading" :remark="['音乐加载中...']" />
<!-- 页面内容 -->
Expand Down Expand Up @@ -126,7 +126,7 @@ const state = reactive({
play: false,
// 加载状态
loading: false,
// 登陆状态
// 登录状态
login: {
show: false,
qrcode: ''
Expand All @@ -152,7 +152,7 @@ const store = storage(
id: '7667645628', // 歌单 ID
url: 'https://api.fzf404.art/music/', // 接口地址
mode: 0, // 播放模式 0 循环播放 1 随机播放 2 单曲循环
cookie: '', // 登陆信息
cookie: '', // 登录信息
current: 0, // 音乐索引
music: [] // 音乐列表
},
Expand All @@ -176,26 +176,26 @@ const request = axios(store.url)
// 登录
const login = async () => {
// 获取登陆密钥
// 获取登录密钥
const { unikey } = (await request.get(`/login/qr/key?timerstamp=${Date.now()}`)).data
if (!unikey) {
return sendAlert('登录密钥获取失败!')
}
// 获取登陆二维码
// 获取登录二维码
const { qrimg } = (await request.get(`/login/qr/create?qrimg=true&timerstamp=${Date.now()}&key=${unikey}`)).data
// 设置登陆二维码
// 设置登录二维码
state.login.qrcode = qrimg
// 展示登录二维码
state.login.show = true
// 关闭设置
pinia.closeSetting()
// 轮询登陆状态
// 轮询登录状态
const callback = setInterval(async () => {
// 获取登陆状态
// 获取登录状态
const data = await request.get(`/login/qr/check?timerstamp=${Date.now()}&key=${unikey}`)
// 登陆成功
// 登录成功
if (data.code == 803) {
clearInterval(callback) // 撤销轮询
store.cookie = data.cookie // 设置 cookie
Expand All @@ -208,7 +208,7 @@ const login = async () => {
// 超时时间 60s
setTimeout(() => {
clearInterval(callback) // 撤销轮询
state.login.show = false // 隐藏登陆二维码
state.login.show = false // 隐藏登录二维码
pinia.openSetting() // 展示设置
}, 60000)
}
Expand All @@ -222,7 +222,7 @@ const setting = reactive([
help: 'https://monit.fzf404.art/#/zh/01-guide?id=🎵-music-音乐'
},
{
label: '登陆账号',
label: '登录账号',
type: 'button',
options: {
text: '登 陆',
Expand All @@ -231,7 +231,7 @@ const setting = reactive([
}
])
// 登陆状态验证
// 登录状态验证
const getUser = async () => {
// 加载中
state.loading = true
Expand All @@ -240,7 +240,7 @@ const getUser = async () => {
const { account } = await request.get(`/user/account?cookie=${store.cookie}`).catch((err) => {
return sendAlert('获取账号信息失败:' + err.message)
})
// 验证登陆
// 验证登录
if (!account) {
store.cookie = ''
return login()
Expand Down
6 changes: 5 additions & 1 deletion app/themes/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: fzf404
* @Date: 2022-07-20 11:34:27
* @LastEditors: fzf404 [email protected]
* @LastEditTime: 2023-03-30 14:40:21
* @LastEditTime: 2023-04-01 15:25:16
* @Description: dark 黑夜主题
*/

Expand Down Expand Up @@ -34,6 +34,10 @@
@apply text-pink-400;
}

.icon-theme {
@apply text-indigo-400 hover:text-indigo-500;
}

/*
* 背景
*/
Expand Down
6 changes: 5 additions & 1 deletion app/themes/light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: fzf404
* @Date: 2022-07-20 12:52:31
* @LastEditors: fzf404 [email protected]
* @LastEditTime: 2023-03-30 14:45:01
* @LastEditTime: 2023-04-01 15:25:53
* @Description: light 明亮主题
*/

Expand Down Expand Up @@ -34,6 +34,10 @@
@apply text-sky-400;
}

.icon-theme {
@apply text-orange-400 hover:text-orange-500;
}

/*
* 背景
*/
Expand Down
6 changes: 5 additions & 1 deletion app/themes/punk.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: fzf404
* @Date: 2022-07-20 12:52:31
* @LastEditors: fzf404 [email protected]
* @LastEditTime: 2023-03-30 14:09:21
* @LastEditTime: 2023-04-01 15:26:14
* @Description: punk 赛博主题
*/

Expand Down Expand Up @@ -34,6 +34,10 @@
@apply text-red-400;
}

.icon-theme {
@apply text-yellow-400 hover:text-yellow-500;
}

/*
* 主题
*/
Expand Down
14 changes: 7 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: fzf404
* @Date: 2022-06-18 17:15:15
* @LastEditors: fzf404 [email protected]
* @LastEditTime: 2023-03-30 21:54:55
* @LastEditTime: 2023-04-01 14:54:05
* @Description: 应用介绍
-->

Expand All @@ -27,11 +27,11 @@

## ✨ 功能

> VueC 指 Composition API,VueO 指 Options API
> 支持开机自启、更新检查、主题切换、通知发送、系统调用等功能。
>
> 更多请前往:[使用指南](https://monit.fzf404.art/#/zh/01-guide) & [开发指南](https://monit.fzf404.art/#/zh/03-develop)
| 插件名 | 功能 | 技术 | 贡献 | 状态 |
| 插件 | 功能 | 技术 | 贡献 | 状态 |
| -------- | ----------------- | ---------------------------- | ------------------------------------- | ---- |
| welcome | 使用指引 | Vue Composition API | [fzf404](https://github.com/fzf404) ||
| count | 计数器 | Vue Options API | [fzf404](https://github.com/fzf404) ||
Expand All @@ -50,18 +50,18 @@

## 🎁 安装

> 使用 Github Action 自动打包,无需担心安全问题
> 使用 Github Action 自动打包,无需担心安全问题
>
> 前往 [Release](https://github.com/fzf404/Monit/releases) / [Mirror](https://cloud.fzf404.art/release/monit) 寻找操作系统对应的安装包
> 前往 [Release](https://github.com/fzf404/Monit/releases) / [Mirror](https://cloud.fzf404.art/release/monit) 寻找操作系统对应的安装包
- MacOS

> 由于没有 Apple 开发者账号,打开时如出现 `Monit.app 已损坏`,请执行如下指令
> 由于没有 Apple 开发者账号,打开时如出现 `Monit.app 已损坏`,请执行如下指令
```bash
sudo xattr -rd com.apple.quarantine /Applications/Monit.app
```

## 🌟 标星
## 标星

![Star](https://api.star-history.com/svg?repos=fzf404/Monit&type=Date)
2 changes: 1 addition & 1 deletion docs/zh/01-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

首次开启插件,默认加载的歌单来自 [Monit](https://music.163.com/#/playlist?id=7667645628)

可以点击右上角的 `⚙️` 图标打开插件设置,点击 `登录` 按钮,扫码登陆,登陆完成后可以在设置窗口中选择个人歌单
可以点击右上角的 `⚙️` 图标打开插件设置,点击 `登录` 按钮,扫码登录,登录完成后可以在设置窗口中选择个人歌单

左侧依次展示音乐的封面、名称、歌手,下方进度条可调整播放进度,展示播放进度及总时长。

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/03-develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const store = storage(
// 设置保存
const onSave = () => {
// 发送提醒
sendAlert(`标题已改为:${store.title}`)
sendAlert(`设置已保存!`)
}
</script>
```
Expand Down

0 comments on commit e8daa51

Please sign in to comment.