From 5af6591b1588d095e0160248fa8862e42b5c1e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=A4=A9?= Date: Tue, 25 Jul 2023 18:19:49 +0800 Subject: [PATCH] =?UTF-8?q?api=E6=94=B9=E4=B8=BA=E4=BA=91=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/config/server.dart | 5 ++++- lib/utils/http.dart | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/config/server.dart b/lib/config/server.dart index 4ce406b..636adbb 100644 --- a/lib/config/server.dart +++ b/lib/config/server.dart @@ -1,5 +1,8 @@ /// Api地址 -const String ServerApiUrl = "http://172.31.163.87:4523/m1/2998542-0-default"; +const String ServerApiUrl = "https://mock.apifox.cn/m1/2998542-0-default"; + +const String ServerApiToken = "GWbEC4Bin3PcuHNC0Sq8T"; +// const String ServerApiUrl = "http://172.31.163.87:4523/m1/2998542-0-default"; // const String ServerApiUrl = "http://192.168.1.5:4523/m1/2998542-0-default"; const CryptoSalt = "E1pWsyfiy@R@X#qn17!StJNdZK1fFF8iV6ffN!goZkqt#JxO"; \ No newline at end of file diff --git a/lib/utils/http.dart b/lib/utils/http.dart index a630589..bdfdd4d 100644 --- a/lib/utils/http.dart +++ b/lib/utils/http.dart @@ -42,7 +42,10 @@ class HttpUtil { // 响应流上前后两次接受到数据的间隔,单位为毫秒。 receiveTimeout: Duration(seconds: 5), // Http请求头. - headers: {}, + headers: { + // 云端Mock鉴权使用 + "apifoxToken": ServerApiToken, + }, /// 请求的Content-Type,默认值是"application/json; charset=utf-8". /// 如果您想以"application/x-www-form-urlencoded"格式编码请求数据,