Skip to content

Commit

Permalink
🐛 修复useRouter无效
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Aug 17, 2024
1 parent 6bfa1b3 commit 6aeecd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src-tauri/src/plugins.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! @file src/plugins.rs
//! @desc 插件模块,用于注册插件
//! @since Beta v0.5.2
//! @since Beta v0.5.3
use super::utils;
use log::LevelFilter;
Expand All @@ -17,12 +17,12 @@ pub fn build_log_plugin<R: Runtime>() -> TauriPlugin<R> {
.level(LevelFilter::Debug)
.build();
}
return tauri_plugin_log::Builder::default()
tauri_plugin_log::Builder::default()
.targets([
Target::new(TargetKind::Webview),
Target::new(TargetKind::LogDir { file_name: utils::get_current_date().into() }),
])
.timezone_strategy(TimezoneStrategy::UseLocal)
.level(LevelFilter::Info)
.build();
.build()
}
8 changes: 1 addition & 7 deletions src/components/post/tp-text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
</template>
<script lang="ts" setup>
import { onMounted, ref, StyleValue, toRaw } from "vue";
import { useRouter } from "vue-router";
import { getEmojis } from "../../plugins/Mys/request/getEmojis.js";
import { parseLink, parsePost } from "../../utils/linkParser.js";
Expand Down Expand Up @@ -99,12 +98,7 @@ async function toLink() {
const link = props.data.attributes.link;
const isPost = await parsePost(link);
if (isPost !== false) {
await useRouter().push({
name: "帖子详情",
params: {
post_id: isPost,
},
});
location.href = `/post_detail/${isPost}`;
return;
}
const res = await parseLink(link);
Expand Down

0 comments on commit 6aeecd2

Please sign in to comment.