diff --git a/src/utils/request.ts b/src/utils/request.ts index af0caff..28ea68d 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,5 +1,5 @@ import axios from "axios"; -import { showToast } from 'vant'; +import { showToast } from 'vant' let baseURL = "/api" const service = axios.create({ baseURL, @@ -25,10 +25,10 @@ service.interceptors.response.use( return Promise.reject(new Error(res.message || 'Error')) } else { if (res.code == 200) { - return res.result + return res.result || res.data } else { - showToast(res.success) - return null + showToast(res.success) + return null } } }, diff --git a/src/view/login/index.vue b/src/view/login/index.vue index 4d383b6..c932492 100644 --- a/src/view/login/index.vue +++ b/src/view/login/index.vue @@ -1,6 +1,65 @@