From 57b6e10db36d7834fb0c61dc4ef2ad27e6b1297e Mon Sep 17 00:00:00 2001 From: yuanshun <1422672890@qq.com> Date: Wed, 27 Dec 2023 18:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.ts | 8 ++-- src/view/login/index.vue | 79 ++++++++++++++++++++++++++++++++++++---- vite.config.ts | 16 ++++---- 3 files changed, 85 insertions(+), 18 deletions(-) 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 @@