cookieUtils.js
export default { data () { return { } }, created () { }, methods: { arrayContain (array, obj) { for (var i = 0; i < array.length; i++) { if (array[i] === obj) { return true } } return false }, getGradeName: function (gradeId) { let gradeName = '' if (gradeId === '7') { gradeName = '七年级' } else if (gradeId === '8') { gradeName = '八年级' } else if (gradeId === '9') { gradeName = '九年级' } else if (gradeId === '10') { gradeName = '高一' } else if (gradeId === '11') { gradeName = '高二' } else if (gradeId === '12') { gradeName = '高三' } else if (gradeId === '21') { gradeName = 'Grade 1' } else if (gradeId === '22') { gradeName = 'Grade 2' } else if (gradeId === '23') { gradeName = 'Grade 3' } return gradeName } } }
import utils from '@/config/cookieUtils' utils.set('url', from.fullPath)