Fix For iOS
This commit is contained in:
@@ -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' +
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user