fix #269
This commit is contained in:
1 parent
9da06a7010
commit
02df167434
3 files changed
+3
-2337
No files matched your search
@@ -1,14 +1,14 @@
|
|||||||
import cookie from './cookie'
|
import cookie from './cookie'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
import { Base64 } from 'js-base64'
|
||||||
|
|
||||||
function parseToken (token) {
|
function parseToken (token) {
|
||||||
let path = store.state.baseURL
|
let path = store.state.baseURL
|
||||||
if (path === '') path = '/'
|
if (path === '') path = '/'
|
||||||
document.cookie = `auth=${token}; max-age=86400; path=${path}`
|
document.cookie = `auth=${token}; max-age=86400; path=${path}`
|
||||||
let res = token.split('.')
|
let res = token.split('.')
|
||||||
let user = JSON.parse(window.atob(res[1]))
|
let user = JSON.parse(Base64.decode(res[1]))
|
||||||
|
|
||||||
if (!user.commands) {
|
if (!user.commands) {
|
||||||
user.commands = []
|
user.commands = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"clipboard": "^1.7.1",
|
"clipboard": "^1.7.1",
|
||||||
"codemirror": "^5.31.0",
|
"codemirror": "^5.31.0",
|
||||||
"filesize": "^3.5.11",
|
"filesize": "^3.5.11",
|
||||||
|
"js-base64": "^2.4.0",
|
||||||
"moment": "^2.19.2",
|
"moment": "^2.19.2",
|
||||||
"normalize.css": "^7.0.0",
|
"normalize.css": "^7.0.0",
|
||||||
"noty": "^3.1.3",
|
"noty": "^3.1.3",
|
||||||
|
|||||||
-2335
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user