mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
fix(config): 还是加回来了, devMode 还是有必要的
This commit is contained in:
BIN
public/tauri.png
Normal file
BIN
public/tauri.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -15,11 +15,7 @@
|
|||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-list-item title="Tauri 版本" @click="toOuter('https://next--tauri.netlify.app/')">
|
<v-list-item title="Tauri 版本" @click="toOuter('https://next--tauri.netlify.app/')">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<img
|
<img class="config-icon" src="/tauri.png" alt="Tauri" />
|
||||||
class="config-icon"
|
|
||||||
src="https://next--tauri.netlify.app/meta/favicon-32x32.png"
|
|
||||||
alt="Tauri"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<v-list-item-subtitle>{{ versionTauri }}</v-list-item-subtitle>
|
<v-list-item-subtitle>{{ versionTauri }}</v-list-item-subtitle>
|
||||||
@@ -68,6 +64,18 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
<v-list-item>
|
||||||
|
<v-list-item-title>开发者模式</v-list-item-title>
|
||||||
|
<v-list-item-subtitle>开启后将显示调试信息</v-list-item-subtitle>
|
||||||
|
<template v-slot:append>
|
||||||
|
<v-switch
|
||||||
|
:label="appStore.devMode ? '开启' : '关闭'"
|
||||||
|
inset
|
||||||
|
v-model="appStore.devMode"
|
||||||
|
color="#0781D8"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-card>
|
</v-card>
|
||||||
<v-card class="common-card">
|
<v-card class="common-card">
|
||||||
|
|||||||
@@ -31,6 +31,12 @@
|
|||||||
查看
|
查看
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
|
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
|
||||||
|
<v-btn @click="toJson(item.post_id)" class="ms-2 card-btn" v-show="appStore.devMode">
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<img src="../assets/icons/arrow-right.svg" alt="right" onload="SVGInject(this)" />
|
||||||
|
</template>
|
||||||
|
JSON
|
||||||
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
</div>
|
||||||
@@ -58,9 +64,17 @@
|
|||||||
查看
|
查看
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
|
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
|
||||||
<v-btn v-if="item.status === 1" color="ms-2 card-btn-0">进行中</v-btn>
|
<div v-show="!appStore.devMode">
|
||||||
<v-btn v-else-if="item.status === 2" color="ms-2 card-btn-2">已结束</v-btn>
|
<v-btn v-if="item.status === 1" color="ms-2 card-btn-0">进行中</v-btn>
|
||||||
<v-btn v-else color="ms-2 card-btn-1">评选中</v-btn>
|
<v-btn v-else-if="item.status === 2" color="ms-2 card-btn-2">已结束</v-btn>
|
||||||
|
<v-btn v-else color="ms-2 card-btn-1">评选中</v-btn>
|
||||||
|
</div>
|
||||||
|
<v-btn @click="toJson(item.post_id)" class="ms-2 card-btn" v-show="appStore.devMode">
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<img src="../assets/icons/arrow-right.svg" alt="right" onload="SVGInject(this)" />
|
||||||
|
</template>
|
||||||
|
JSON
|
||||||
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,6 +101,12 @@
|
|||||||
查看
|
查看
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
|
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
|
||||||
|
<v-btn @click="toJson(item.post_id)" class="ms-2 card-btn" v-show="appStore.devMode">
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<img src="../assets/icons/arrow-right.svg" alt="right" onload="SVGInject(this)" />
|
||||||
|
</template>
|
||||||
|
JSON
|
||||||
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
</div>
|
||||||
@@ -200,18 +220,18 @@ async function toPost(post_id: string) {
|
|||||||
const postUrl = `file:\\\\\\${appStore.dataPath.temp}\\${post.post_id}.html`;
|
const postUrl = `file:\\\\\\${appStore.dataPath.temp}\\${post.post_id}.html`;
|
||||||
createTGWindow(postUrl, "MysPost", post.subject, 960, 720, false);
|
createTGWindow(postUrl, "MysPost", post.subject, 960, 720, false);
|
||||||
}
|
}
|
||||||
async function logPost(post_id: string) {
|
async function toJson(post_id: string) {
|
||||||
const post = await getPost(post_id).then(res => {
|
const post = await getPost(post_id).then(res => {
|
||||||
return res.data;
|
return res.data;
|
||||||
});
|
});
|
||||||
// 将 json 保存到 文件
|
// 将 json 保存到 文件
|
||||||
await fs.writeTextFile(
|
await fs.writeTextFile(
|
||||||
`${appStore.dataPath.temp}\\${post_id}_log.json`,
|
`${appStore.dataPath.temp}\\${post_id}.json`,
|
||||||
JSON.stringify(post, null, 4)
|
JSON.stringify(post, null, 4)
|
||||||
);
|
);
|
||||||
const logUrl = `file:\\\\\\${appStore.dataPath.temp}\\${post_id}_log.json`;
|
const logUrl = `file:\\\\\\${appStore.dataPath.temp}\\${post_id}.json`;
|
||||||
// 打开窗口
|
// 打开窗口
|
||||||
createTGWindow(logUrl, "MysPostLog", post_id, 960, 720, false);
|
createTGWindow(logUrl, "MysPostJson", post_id, 960, 720, false);
|
||||||
}
|
}
|
||||||
async function getPost(post_id: string): Promise<ResponsePost> {
|
async function getPost(post_id: string): Promise<ResponsePost> {
|
||||||
return http
|
return http
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ const useAppStore = defineStore({
|
|||||||
},
|
},
|
||||||
// 咨讯页渲染模式
|
// 咨讯页渲染模式
|
||||||
structureRender: true, // 是否采用结构化渲染,否则采用 raw 渲染
|
structureRender: true, // 是否采用结构化渲染,否则采用 raw 渲染
|
||||||
|
// 开发者模式
|
||||||
|
devMode: false,
|
||||||
// 数据路径
|
// 数据路径
|
||||||
dataPath: {
|
dataPath: {
|
||||||
app: appDataDir,
|
app: appDataDir,
|
||||||
@@ -81,6 +83,8 @@ const useAppStore = defineStore({
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
// 初始化咨讯页渲染模式
|
// 初始化咨讯页渲染模式
|
||||||
this.structureRender = true;
|
this.structureRender = true;
|
||||||
|
// 初始化开发者模式
|
||||||
|
this.devMode = false;
|
||||||
// 初始化用户数据路径
|
// 初始化用户数据路径
|
||||||
this.userPath = {
|
this.userPath = {
|
||||||
achievements: `${userDataDir}\\achievements.json`,
|
achievements: `${userDataDir}\\achievements.json`,
|
||||||
|
|||||||
Reference in New Issue
Block a user