'v2','1h')// 获取console.log(cookies.get('k2'))// v2// 删除指定keycookies.remove("k2")// 判断某个key是否存在,返回true或者falseconsole.log(cookies.isKey("k2"))// 获取所有的key的数组console.log(cookies.keys())// ['_ga', 'csrftoken',
vue脚手架指的是vue-cli,它是一个专门为单页面应用快速搭建繁杂的脚手架,它可以轻松的创建新的应用程序而且可用于自动生成vue和webpack的项目模板。 vue-cli是有Vue提供的一个官方cli,专门为单页面应用快速搭建繁杂的脚手架。它是用于自动生成vue.js+webpack的项目模板。 2.2 vue-cli的安装 1.傻瓜式安装node: ...
const token = Vue.ls.get(ACCESS_TOKEN) this.token = token this.headers = { 'X-Access-Token': token } this.initFile(this.value) }, methods: { initFile(val) { if (val instanceof Array) { this.initFileList(val.join(',')) } else { this.initFileList(val) } }, isWord(fileType)...
加了随机参数也没用function logout() { console.log('退出'); localStorage.removeItem('access_token'); localStorage.removeItem('refresh_token'); const hash = Math.random(); router.push({ path: '/home', query: { hash } }) .then(() => { console.log('退出成功'); }).catch(error...
//1.根据token获取账号 String username = (String) token.getPrincipal(); //2.根据账号查询用户信息 QueryWrapper<User> wrapper = new QueryWrapper<>(); wrapper.eq("username",username); wrapper.eq("is_deleted",0); User user = userServicet.getOne(wrapper); ...
const token = Vue.ls.get(ACCESS_TOKEN) if (token) { config.headers[ 'X-Access-Token' ] = token } return config },(error) => { return Promise.reject(error) }) get请求避免缓存 浏览器会对url链接相同的GET请求进行缓存,这会导致某些请求拿不到最新的数据。在GET请求里加上时间戳来解决这个问...
Vue.ls.remove(ACCESS_TOKEN) this.getRouterData() this.getEncrypte() // update-begin- --- author:scott --- date:20190225 --- for:暂时注释,未实现登录验证码功能 // this.$http.get('/auth/2step-code') // .then(res => { // this.requiredTwoStepCaptch...
{ ACCESS_TOKEN } from '@/store/mutation-types'import { postAction, getFileAccessHttpUrl, getAction } from '@/api/manage'const uidGenerator = () => {return '-' + parseInt(Math.random() * 10000 + 1, 10)}const getFileName = (path) => {if (path.lastIndexOf('\\') >= 0) {...
round"icon="file-pdf"@click="handlePrint(printData)"size="small">打印<pdfref="pdf"v-for="item in pageTotal":src="previewFileSrc":key="item":page="item"></pdf></template>importVuefrom'vue'import{ACCESS_TOKEN}fr
== 0) { noErrorMessage || _Message({ message: msg, type: 'error' }) // if (code === 10001) { // 退出登录 // utils.LS.remove("token"); // window.location = '/login' // } return Promise.reject(data) } return data } else { r...