Fix For iOS

This commit is contained in:
2022-04-10 16:19:54 +08:00
parent a95036f8cf
commit bb932e34cb
10 changed files with 75 additions and 229 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ class UserInfo {
};
//若list[i]为'',解密时会报错:aes decode error:RangeError: Value not in range: -16
String thisAndroidId = ''; //每个手机唯一的设备号
String thisDeviceId = ''; //每个手机唯一的设备号
String username = '';
String password = '';
String userLoginInfo = '';
@@ -184,7 +184,7 @@ class UserInfo {
Map userRulesMap = {}; //用户所属组的权限列表
String getUserinfoEncrypted2() {
String userinfoEncrypted1 = EncryptUtil.aesEncode(thisAndroidId) +
String userinfoEncrypted1 = EncryptUtil.aesEncode(thisDeviceId) +
'\n' +
EncryptUtil.aesEncode(username) +
'\n' +
+9 -5
View File
@@ -273,12 +273,16 @@ Future<Map> getMapFromJson(var response) async {
// );
// }
Future<String> getAndroidId() async {
Future<String> getDeviceId() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
//print('每个手机唯一的设备号:${androidInfo.androidId}'); // e.g. "Moto G (4)"
g_userInfo.thisAndroidId = androidInfo.androidId;
return g_userInfo.thisAndroidId;
if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
return androidInfo.androidId;
} else if (Platform.isIOS) {
return (await deviceInfo.iosInfo).identifierForVendor;
}
assert(false, 'Unsupported Platform');
return '';
}
// void playOrPause() {