feature: xterm依赖修复 token修复
This commit is contained in:
5
nezha-fronted/package-lock.json
generated
5
nezha-fronted/package-lock.json
generated
@@ -11664,6 +11664,11 @@
|
|||||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"xterm": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/xterm/download/xterm-3.1.0.tgz",
|
||||||
|
"integrity": "sha1-f34cjPS4C9iBpOiJEhO4UUI+kMk="
|
||||||
|
},
|
||||||
"xxhashjs": {
|
"xxhashjs": {
|
||||||
"version": "0.2.2",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
"vue": "^2.5.2",
|
"vue": "^2.5.2",
|
||||||
"vue-i18n": "^8.15.1",
|
"vue-i18n": "^8.15.1",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vuex": "^3.1.2"
|
"vuex": "^3.1.2",
|
||||||
|
"xterm": "^3.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^7.1.2",
|
"autoprefixer": "^7.1.2",
|
||||||
|
|||||||
7
nezha-fronted/src/components/common/js/Xterm.js
Normal file
7
nezha-fronted/src/components/common/js/Xterm.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { Terminal } from 'xterm'
|
||||||
|
import * as fit from 'xterm/lib/addons/fit/fit'
|
||||||
|
import * as attach from 'xterm/lib/addons/attach/attach'
|
||||||
|
Terminal.applyAddon(fit)
|
||||||
|
Terminal.applyAddon(attach)
|
||||||
|
|
||||||
|
export default Terminal
|
||||||
@@ -95,7 +95,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
let token = sessionStorage.getItem('token');
|
let token = sessionStorage.getItem('nz-token');
|
||||||
if (token) {
|
if (token) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user