parent
835d497be4
commit
724554637b
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* @Author: your name
|
||||||
|
* @Date: 2021-12-10 13:41:29
|
||||||
|
* @LastEditTime: 2021-12-10 14:24:33
|
||||||
|
* @LastEditors: Please set LastEditors
|
||||||
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
* @FilePath: /data-show/src/utils/auth/index.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Cookies from "js-cookie"
|
||||||
|
|
||||||
|
const strToken = "ac-token";
|
||||||
|
const menuStr = "menu";
|
||||||
|
export function saveToken(token) {
|
||||||
|
return Cookies.set(strToken, token)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function giveToken() {
|
||||||
|
return Cookies.get(strToken)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteToken() {
|
||||||
|
return Cookies.remove(strToken)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveMenu(menu) {
|
||||||
|
let str = JSON.stringify(menu)
|
||||||
|
return Cookies.set(menuStr, str)
|
||||||
|
}
|
||||||
|
export function giveMenu() {
|
||||||
|
let str = null
|
||||||
|
if(Cookies.get(menuStr)) {
|
||||||
|
str = JSON.parse(Cookies.get(menuStr))
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue