mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-02 01:50:46 +08:00
fix: 全局移除process.client、process.server #669
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { clearToken } from '~/utils/auth'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
if (process.client) {
|
||||
if (import.meta.client) {
|
||||
const originalFetch = window.fetch
|
||||
window.fetch = async (input, init) => {
|
||||
const response = await originalFetch(input, init)
|
||||
|
||||
@@ -4,7 +4,7 @@ import '~/assets/toast.css'
|
||||
|
||||
export default defineNuxtPlugin(async (nuxtApp) => {
|
||||
// 确保只在客户端环境中注册插件
|
||||
if (process.client) {
|
||||
if (import.meta.client) {
|
||||
try {
|
||||
// 使用动态导入来避免 CommonJS 模块问题
|
||||
const { default: Toast, POSITION } = await import('vue-toastification')
|
||||
|
||||
Reference in New Issue
Block a user