更新model/index.js对path的处理

This commit is contained in:
Kokomi 2024-05-22 02:19:36 +08:00
parent 3557a0d689
commit f8a5f6c394

View File

@ -1,5 +1,4 @@
import fs from 'node:fs'
import Base from './Base.js'
import Character from './Character.js'
import Artifact from './Artifact.js'
@ -14,21 +13,20 @@ import Weapon from './Weapon.js'
import User from './User.js'
import MysApi from './MysApi.js'
import Button from './Button.js'
import { rootPath } from '#miao.path'
import { miaoPath } from '#miao.path'
for (let game of ['gs', 'sr']) {
for (let type of ['artifact', 'character', 'material', 'weapon']) {
let file = `./plugins/miao-plugin/resources/meta-${game}/${type}/index.js`
let file = `${miaoPath}/resources/meta-${game}/${type}/index.js`
if (fs.existsSync(file)) {
try {
await import(`file://${rootPath}/${file}`)
await import(`file://${file}`)
} catch (e) {
console.log(e)
}
}
}
}
export {
Base,
Abyss,