You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
9.0 KiB
Dart

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:hyzp_ybqx/components/commonFun.dart';
import 'package:hyzp_ybqx/pages/Works/DWDT/dwInfo_data.dart';
import 'EncryptUtil.dart';
import 'commonFun.dart';
class UserInfo {
UserInfo({this.mapUserInfoRet}) {
setUserInfo(theMapUserInfoRet: mapUserInfoRet);
}
Future setUserInfo({Map theMapUserInfoRet}) async {
if (200 == theMapUserInfoRet["ret"]) {
mapUserInfoRet = theMapUserInfoRet;
mapUserInfo = theMapUserInfoRet["data"];
print('mapUserInfo = ${mapUserInfo.toString()}');
setQxInfo(mapUserInfo["qx_code"], mapUserInfo["qx_name"]);
}
}
//_mapGetData = {is_login: true, user_id: 135, token: 4C5B3F93FEACAEF4B6CAA7296F22CC67825D7E48B867614383D19E3F23DFE510}
Future setUserInfoFaceLogin(Map _mapGetData) async {
mapUserInfo['user_id'] = _mapGetData['user_id'];
mapUserInfo['token'] = _mapGetData['token'];
setQxInfo(mapUserInfo["qx_code"], mapUserInfo["qx_name"]);
}
setQxInfo(String _qx_code, String _qx_name) {
qx_code = int.parse(_qx_code.trim());
qx_name = _qx_name;
//区县用户登录接口增加返回字段“sfsy”0表示正式账号1表示试用账号
qx_trial_tag = mapUserInfo['sfsy'];
// 511528、兴文县
// int qx_code = 511528;
// String qx_name = '宜宾市兴文';
// String service_tel = '\n服务热线187-8467-8300';
// String copyright_info = '© ' + qx_name + '生态环境局 四川省踏石科技 版权所有' + service_tel;
// String copyright_info_PinYin = 'YIBIN XINGWEN BLACK SMOKE CAR CAPTURE SYSTEM';
// // 兴文县中心地址:天泉商城
// double center_latitude = 28.29678023715008; // 区县中心纬度
// double center_longitude = 105.24189826141459; // 区县中心经度
// 511501 市辖区
// 511502 翠屏区
// 511503 南溪区
// 511504 叙州区
// 511523 江安县
// 511524 长宁县
// 511525 高县
// 511526 珙县
// 511527 筠连县
// 511528 兴文县
// 511529 屏山县
// 511501、宜宾市生态环境局、四川省踏石科技保留客服电话
// 511502、宜宾市翠屏生态环境局去掉客服电话
// 511524、宜宾市长宁生态环境局去掉客服电话
// 511528、宜宾市兴文生态环境局、四川省踏石科技保留客服电话
// 511527、宜宾市筠连生态环境局、四川省踏石科技保留客服电话
// 511530、宜宾三江新区城乡融合发展局、四川省踏石科技保留客服电话
qx_name_long = '宜宾市' + trim_county(qx_name);
service_tel = '\n服务热线187-8467-8300';
copyright_info = '© ' + qx_name_long + '生态环境局 四川省踏石科技 版权所有' + service_tel;
// 中心地址:宜宾市白塔山
center_latitude = 28.77914; // 区县中心纬度
center_longitude = 104.644079; // 区县中心经度
// App开发登录用户
// 翠屏区mancpq
// 三江新区mansjxq
// 长宁县mancnx
// 高县mangx
// 筠连县manjlx
// 兴文县manxwx
switch (qx_code) {
case 511502: // 翠屏区
service_tel = '';
copyright_info = '© ' + qx_name_long + '生态环境局 版权所有' + service_tel;
copyright_info_PinYin = 'YIBIN CUIPING BLACK SMOKE CAR CAPTURE SYSTEM';
// I/flutter ( 5196): mapPoi = {text: 半边山, pt: {latitude: 28.768529585269228, longitude: 104.54945742538702}, uid: 0373889107c0ee8d3fe23180}
// D/OverlayHandlerFactory( 5196): dispatchMethodHandler: flutter_bmfmap/map/getZoomLevel
// I/flutter ( 5653): 点击底图空白处响应coordinate = {latitude: 28.769550682223482, longitude: 104.5675762475173}
// D/OverlayHandlerFactory( 5653): dispatchMethodHandler: flutter_bmfmap/map/getZoomLevel
center_latitude = 28.768529585269228; // 区县中心纬度
center_longitude = 104.5675762475173; // 区县中心经度
break;
case 511503: // 南溪区
service_tel = '';
copyright_info = '© ' + qx_name_long + '生态环境局 版权所有' + service_tel;
copyright_info_PinYin = 'YIBIN NANXI BLACK SMOKE CAR CAPTURE SYSTEM';
// 中心位置:南溪豆腐干博览馆, pt: {latitude: 28.829484824941034, longitude: 104.9676905045844}
center_latitude = 28.829484824941034; // 区县中心纬度
center_longitude = 104.9676905045844; // 区县中心经度
break;
case 511530: // 三江新区
qx_name_long = '宜宾' + qx_name;
copyright_info = '© ' + qx_name_long + '城乡融合发展局 四川省踏石科技\n版权所有,' + service_tel.substring(1);
copyright_info_PinYin = 'YIBIN SANJIANG NEW AREA BLACK SMOKE CAR CAPTURE SYSTEM';
// 中心地址:
// 点击底图空白处响应coordinate = {latitude: 28.822633806922394, longitude: 104.75964294854222}
center_latitude = 28.822633806922394; // 区县中心纬度
center_longitude = 104.75964294854222; // 区县中心经度
g_zoomLevel = g_zoomLevel_default = 13; //地图默认缩放倍数
break;
case 511523: // 江安县
service_tel = '';
copyright_info = '© ' + qx_name_long + '生态环境局 版权所有' + service_tel;
copyright_info_PinYin = 'YIBIN JIANGAN BLACK SMOKE CAR CAPTURE SYSTEM';
// 中心地址:
center_latitude = 28.733302227916264; // 区县中心纬度
center_longitude = 105.08602682985662; // 区县中心经度
g_zoomLevel = g_zoomLevel_default = 13; //地图默认缩放倍数
break;
case 511524: // 长宁县
service_tel = '';
copyright_info = '© ' + qx_name_long + '生态环境局 版权所有' + service_tel;
copyright_info_PinYin = 'YIBIN CHANGNING BLACK SMOKE CAR CAPTURE SYSTEM';
// 长宁S308固废填埋场附近, dwzb: 104.941567|28.627746
// 长宁站, pt: {latitude: 28.601496170763852, longitude: 104.93546828595213
// 中心地址:天泉商城
center_latitude = 28.601496170763852; // 区县中心纬度
center_longitude = 104.93546828595213; // 区县中心经度
break;
case 511525: // 高县
copyright_info_PinYin = 'YIBIN GAOXIAN BLACK SMOKE CAR CAPTURE SYSTEM';
break;
case 511527: // 筠连县
copyright_info_PinYin = 'YIBIN JUNLIAN BLACK SMOKE CAR CAPTURE SYSTEM';
// "dwinfo":"腾达镇中和村吉安驾校附近","dwzb":"104.529183|28.150055"
// 中心地址:腾达镇中和村吉安驾校附近
center_latitude = 28.150055; // 区县中心纬度
center_longitude = 104.529183; // 区县中心经度
break;
case 511528: // 兴文县
copyright_info_PinYin = 'YIBIN XINGWEN BLACK SMOKE CAR CAPTURE SYSTEM';
// 中心地址:天泉商城
center_latitude = 28.29678023715008; // 区县中心纬度
center_longitude = 105.24189826141459; // 区县中心经度
break;
default:
break;
}
}
// 去除末尾的区县
String trim_county(String _name) {
// 对长度小于等于2的区县名称“高县”、“珙县”等不进行去尾操作
if (_name.length > 2) {
_name = _name.substring(0, _name.length - 1);
}
return _name;
}
Map mapUserInfoRet = {
"ret": 200,
"data": {
"is_login": true,
"user_id": 152,
"token": "959091E2A5E362E22F22F8DBE05737A95545A43AF28B19AB3DAD5F8557EE2E29",
"qx_code": "511528",
"qx_name": "兴文县",
"sfsy": 0, //区县用户登录接口增加返回字段“sfsy”0表示正式账号1表示试用账号
},
"msg": ""
};
Map mapUserInfo = {
"is_login": false,
"user_id": -1,
"token": "",
"qx_code": "",
"qx_name": "",
"sfsy": 0, //区县用户登录接口增加返回字段“sfsy”0表示正式账号1表示试用账号
};
//若list[i]为''解密时会报错aes decode error:RangeError: Value not in range: -16
String thisAndroidId = ''; //每个手机唯一的设备号
String username = '';
String password = '';
String userLoginInfo = '';
List<int> userGroupIDlist = []; //用户所属组列表
Map userRulesMap = {}; //用户所属组的权限列表
String getUserinfoEncrypted2() {
String userinfoEncrypted1 = EncryptUtil.aesEncode(thisAndroidId) +
'\n' +
EncryptUtil.aesEncode(username) +
'\n' +
EncryptUtil.aesEncode(password) +
'\n' +
EncryptUtil.aesEncode(userLoginInfo);
String userinfoEncrypted2 = EncryptUtil.aesEncode(userinfoEncrypted1);
return userinfoEncrypted2;
}
String getUserinfoDencrypted2(String userinfoEncrypted2) {
String userinfoDencrypted1 = EncryptUtil.aesDecode(userinfoEncrypted2);
List<String> list = userinfoDencrypted1.split('\n');
int len = list.length;
String userinfoDencrypted2 = '';
print('len = $len');
for (int i = 0; i < len; i++) {
list[i] = EncryptUtil.aesDecode(list[i]);
userinfoDencrypted2 += ('' == userinfoDencrypted2 ? '' : '\n') + list[i];
}
return userinfoDencrypted2;
}
}