import { defineStore } from 'pinia'; import http from '@/jtools/request/index'; import { queryQuestion } from '@/jtools/api/question'; import storage from '@/jtools/storage'; const question = defineStore({ id: 'question', state: () => ({ currentCartype: storage.get('carType') || '1001', orderQuestion: [], //顺序做题 }), actions: { // 获取顺序做题 getOrderQuestion(val) { queryQuestion({ carTypeId: this.currentCartype, subject: val }).then(res => { if (res.code == '0000') { this.orderQuestion = res.data } }) }, } }); export default question;