Commit bcdf5134 authored by 罗超's avatar 罗超

1

parent b539850b
......@@ -74,8 +74,7 @@ const service = Axios.create({
*/
service.interceptors.request.use(
async (config: AxiosRequestConfig) => {
console.log(config)
// 如果是获取token接口:
// 如果是获取token接口:
if (config.url === '/auth/oauth/token') {
//TODO:用户登录的特殊处理,
} else {
......@@ -110,7 +109,7 @@ service.interceptors.response.use(
/** 请求有响应 */
async (response: AxiosResponse) => {
if (response.status === 200) {
return Promise.resolve(response)
return Promise.resolve(response.data)
} else {
const __text = getErrorCode2text(response)
return Promise.reject(new Error(__text))
......
import { boot } from 'quasar/wrappers'
import axios, { AxiosInstance } from 'axios'
import 'element-plus/dist/index.css'
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$axios: AxiosInstance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment