地址切换
This commit is contained in:
@@ -7,9 +7,12 @@ class AppTheme {
|
||||
|
||||
static const Color themeColor = Color(0xFF0c83c3);
|
||||
|
||||
//是否开放域名切换
|
||||
static const bool is_show_host = true;
|
||||
|
||||
//http://192.168.110.222:8080/
|
||||
//http://192.168.110.44:8080/
|
||||
static const String test_service_url = "https://beta-esg.api.lnh2e.com/";
|
||||
static String test_service_url = "https://beta-esg.api.lnh2e.com/";
|
||||
static const String release_service_url = "";
|
||||
|
||||
//加氢站相关查询
|
||||
@@ -23,10 +26,10 @@ class AppTheme {
|
||||
|
||||
static const Color darkThemeColor = Color(0xFF032896);
|
||||
|
||||
static const String android_key ="335642645";
|
||||
static const String android_appsecret="39628204345a4240b5b645b68a5896c7";
|
||||
static const String ios_key="335642649";
|
||||
static const String ios_appsecret="173bc08bd5df422da20c8e3ffbf0521b";
|
||||
static const String android_key = "335642645";
|
||||
static const String android_appsecret = "39628204345a4240b5b645b68a5896c7";
|
||||
static const String ios_key = "335642649";
|
||||
static const String ios_appsecret = "173bc08bd5df422da20c8e3ffbf0521b";
|
||||
|
||||
/// 亮色主题样式
|
||||
static ThemeData light = ThemeData(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:getx_scaffold/getx_scaffold.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
|
||||
/// 专门用于处理和添加 Token 的拦截器
|
||||
@@ -13,7 +14,7 @@ class TokenInterceptor extends Interceptor {
|
||||
TokenInterceptor({this.tokenKey = 'Authorization', this.sourceKey = 'source'});
|
||||
|
||||
@override
|
||||
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
|
||||
void onRequest(RequestOptions options, RequestInterceptorHandler handler) async{
|
||||
// 从 StorageService 中获取已保存的 token
|
||||
final String? token = StorageService.to.token;
|
||||
|
||||
@@ -38,6 +39,9 @@ class TokenInterceptor extends Interceptor {
|
||||
options.headers[sourceKey] = platformSource;
|
||||
}
|
||||
|
||||
options.headers['appVersion'] = await getVersion();
|
||||
options.headers['brand'] = await getDeviceModel();
|
||||
|
||||
// 调用 handler.next(options) 以继续执行请求
|
||||
// 这一步至关重要,否则请求会被中断
|
||||
super.onRequest(options, handler);
|
||||
|
||||
Reference in New Issue
Block a user