https://vueuse.org/integrations/useCookies/#usecookies
@vueuse/integrations | VueUse
npm i universal-cookie
npm i @vueuse/integrations
import { useCookies } from '@vueuse/integrations/useCookies'
const cookie = useCookies()
function set(){
cookie.set('token','0000')
}
function get(){
cookie.set('token')
}
function remove(){
cookie.remove('token')
}
import { useCookies } from '@vueuse/integrations/useCookies'
const cookie = useCookies()
...略
// 存储 token 和用户相关信息
cookie.set('admin-token', res.data.data.token)
// 跳转到后台
router.push('/')