jeecg-boot在前端使用GET請(qǐng)求說明:
1.在頁面中導(dǎo)入相關(guān)依賴:
import { deleteAction, getAction,downFile } from '@/api/manage'
導(dǎo)入發(fā)送get請(qǐng)求的依賴
2.請(qǐng)求方法:
getAction(this.url.list).then((res) => {console.log(res)})
請(qǐng)求方法
jeecg-boot在前端使用POST請(qǐng)求說明:
1.導(dǎo)入相關(guān)依賴:
導(dǎo)入發(fā)送post請(qǐng)求的依賴
2.請(qǐng)求方法:
httpAction(httpurl,formData,method).then((res)=>{console.log(res)})
請(qǐng)求方法
若請(qǐng)求時(shí)使用token,需要以下操作:
1.導(dǎo)入獲取token的依賴:
獲取token的依賴
2.頁面屬性中聲明header字段:
頁面中聲明header字段
3. created ()方法中給this.header賦值: