完善游客模式登录 并且新增设备管理
This commit is contained in:
@@ -34,6 +34,10 @@ class BaseResponse<T> {
|
||||
final decrypted = KRAesUtil.decryptData(cipherText, nonce, AppConfig.kr_encryptionKey);
|
||||
body = jsonDecode(decrypted);
|
||||
KRLogUtil.kr_i('✅ 解密成功', tag: 'BaseResponse');
|
||||
|
||||
// 打印完整的解密后数据,方便调试
|
||||
final bodyStr = jsonEncode(body);
|
||||
KRLogUtil.kr_i('📦 解密后数据(完整): $bodyStr', tag: 'BaseResponse');
|
||||
} catch (e) {
|
||||
KRLogUtil.kr_e('❌ 解密失败: $e,使用原始数据', tag: 'BaseResponse');
|
||||
body = dataMap;
|
||||
|
||||
@@ -25,7 +25,7 @@ import '../utils/kr_log_util.dart';
|
||||
// import 'package:video/app/utils/log_util.dart';
|
||||
|
||||
/// 定义请求方法的枚举
|
||||
enum HttpMethod { GET, POST, DELETE }
|
||||
enum HttpMethod { GET, POST, DELETE, PUT }
|
||||
|
||||
/// 封装请求
|
||||
class HttpUtil {
|
||||
@@ -167,6 +167,15 @@ class HttpUtil {
|
||||
headers: headers, // 添加请求头
|
||||
),
|
||||
);
|
||||
} else if (method == HttpMethod.PUT) {
|
||||
responseTemp = await _dio.put<Map<String, dynamic>>(
|
||||
path,
|
||||
data: map,
|
||||
options: Options(
|
||||
contentType: "application/json",
|
||||
headers: headers, // 添加请求头
|
||||
),
|
||||
);
|
||||
} else {
|
||||
responseTemp = await _dio.post<Map<String, dynamic>>(
|
||||
path,
|
||||
|
||||
Reference in New Issue
Block a user