refactor: 重构优化

This commit is contained in:
xiaojunnuo
2021-02-05 14:30:31 +08:00
parent 305824ff1a
commit 5cde165f0b
9 changed files with 26 additions and 17 deletions

View File

@@ -1,7 +1,12 @@
import os from 'os'
export default {
join (...dirs) {
const url = new URL('../' + dirs.join('/'), import.meta.url)
console.log('url', url)
return url.pathname
let path = url.pathname
if (os.type() === 'Windows_NT') {
path = path.substring(1)
}
return path
}
}