auth.js 457 B

12345678910111213141516171819202122
  1. /*
  2. * @Date: 2023-06-18 16:51:52
  3. * @LastEditors: zhubj
  4. * @LastEditTime: 2023-06-18 16:53:05
  5. * @Description: 头部注释
  6. * @FilePath: \own-vue3-vuecli-template\src\utils\auth.js
  7. */
  8. import Cookies from 'js-cookie'
  9. const TokenKey = 'Admin-Token'
  10. export function getToken() {
  11. return Cookies.get(TokenKey)
  12. }
  13. export function setToken(token) {
  14. return Cookies.set(TokenKey, token)
  15. }
  16. export function removeToken() {
  17. return Cookies.remove(TokenKey)
  18. }