//
//  AccountInfo.swift
//  SHYTB
//
//  Created by xiejiangbo on 2017/11/9.
//  Copyright © 2017年 yin chen. All rights reserved.
//

import UIKit
private let AccountInfo_qrCodeData:String="AccountInfo_qrCodeData"
private let AccountInfo_UserId:String="AccountInfo_UserId"
private let AccountInfo_ChangPassWordUserId:String="AccountInfo_ChangPassWordUserId"
private let AccountInfo_UaesName:String="AccountInfo_UaesName"
private let AccountInfo_PassWord:String="AccountInfo_PassWord"
private let AccountInfo_login_UaesName:String="AccountInfo_login_UaesName"
private let AccountInfo_SaveUaesNamePassWord:String="AccountInfo_SaveUaesNamePassWord"
private let AccountInfo_isAutoLogin:String="AccountInfo_isAutoLogin"
private let AccountInfo_isHuangshan:String="AccountInfo_isHuangshan"
private let AccountInfo_urlType:String="AccountInfo_urlType"
private let AccountInfo_isTest:String="AccountInfo_isTest"

private let AccountInfo_selecCompanyName:String="AccountInfo_selecCompanyName"
private let AccountInfo_selecCompanyId:String="AccountInfo_selecCompanyId"
private let AccountInfo_selecDepartmentName:String="AccountInfo_selecDepartmentName"
private let AccountInfo_selecDepartmentId:String="AccountInfo_selecDepartmentId"
private let AccountInfo_appUUID:String="AccountInfo_appUUID"

private let AccountInfo_selecCompanyNameDic:String="AccountInfo_selecCompanyNameDic"
private let AccountInfo_selecDepartmentNameDic:String="AccountInfo_selecDepartmentNameDic"

private let AccountInfo_docId:String="AccountInfo_docId"
private let AccountInfo_sysUserId:String="AccountInfo_sysUserId"
private let AccountInfo_sysOrg:String="AccountInfo_sysOrg"
private let AccountInfo_db_source:String="AccountInfo_db_source"
private let AccountInfo_tags:String="AccountInfo_tags"
private let AccountInfo_userName:String="AccountInfo_userName"
private let AccountInfo_sysCompanyName:String="AccountInfo_sysCompanyName"
private let AccountInfo_sysOrgService:String="AccountInfo_sysOrgService"
private let AccountInfo_sysType:String="AccountInfo_sysType"
private let AccountInfo_partyOpcode:String="AccountInfo_partyOpcode"
private let AccountInfo_myApplicationCellNum:String="AccountInfo_myApplicationCellNum"
private let AccountInfo_messageId:String="AccountInfo_messageId"

private let AccountInfo_cmsRealDb:String="AccountInfo_cmsRealDb"
private let AccountInfo_cmsTestDb:String="AccountInfo_cmsTestDb"
private let AccountInfo_omsTestDb:String="AccountInfo_omsTestDb"
private let AccountInfo_omsRealDb:String="AccountInfo_omsRealDb"
private let AccountInfo_tmsRealDb:String="AccountInfo_tmsRealDb"
private let AccountInfo_tmsTestDb:String="AccountInfo_tmsTestDb"
private let AccountInfo_appRealDb:String="AccountInfo_appRealDb"
private let AccountInfo_appTestDb:String="AccountInfo_appTestDb"
private let AccountInfo_selecCompanyUserName:String="AccountInfo_selecCompanyUserName"
private let AccountInfo_selecCompanyUserid:String="AccountInfo_selecCompanyUserid"
private let AccountInfo_address:String="AccountInfo_address"
private let AccountInfo_externalUser:String="AccountInfo_externalUser"
private let AccountInfo_infoCompanyName:String="AccountInfo_infoCompanyName"
private let AccountInfo_layout:String="AccountInfo_layout"
private let AccountInfo_exceptionInfo:String="AccountInfo_exceptionInfo"
private let AccountInfo_infoDeptName:String="AccountInfo_infoDeptName"
private let AccountInfo_latutide:String="AccountInfo_latutide"
private let AccountInfo_oldType:String="AccountInfo_oldType"
private let AccountInfo_upcomingCount:String="AccountInfo_upcomingCount"
private let AccountInfo_doneCount:String="AccountInfo_doneCount"

private let AccountInfo_weChat_code:String="AccountInfo_weChat_code"
private let AccountInfo_weChat_access_token:String="AccountInfo_weChat_access_token"
private let AccountInfo_weChat_refresh_token:String="AccountInfo_weChat_refresh_token"
private let AccountInfo_weChat_openid:String="AccountInfo_weChat_openid"
private let AccountInfo_weChat_appid:String="AccountInfo_weChat_appid"
private let AccountInfo_weChat_unionid:String="AccountInfo_weChat_unionid"
private let AccountInfo_weChat_expires_in:String="AccountInfo_weChat_expires_in"

private let AccountInfo_weChatInfo_nickname:String="AccountInfo_weChatInfo_nickname"
private let AccountInfo_weChatInfo_sex:String="AccountInfo_weChatInfo_sex"
private let AccountInfo_weChatInfo_province:String="AccountInfo_weChatInfo_province"
private let AccountInfo_weChatInfo_city:String="AccountInfo_weChatInfo_city"
private let AccountInfo_weChatInfo_country:String="AccountInfo_weChatInfo_country"
private let AccountInfo_weChatInfo_headimgurl:String="AccountInfo_weChatInfo_headimgurl"

private let AccountInfo_singlePoint_access_token:String="AccountInfo_singlePoint_access_token"
private let AccountInfo_singlePoint_startTime:String="AccountInfo_singlePoint_startTime"
private let AccountInfo_singlePoint_appId:String="AccountInfo_singlePoint_appId"
private let AccountInfo_singlePoint_remoteIp:String="AccountInfo_singlePoint_remoteIp"

private let AccountInfo_loginType:String="AccountInfo_loginType"


private let AccountInfo_messageNumber:String="AccountInfo_messageNumber"

private let AccountInfo_tms_version:String="AccountInfo_tms_version"
private let AccountInfo_juph_registrationID:String="AccountInfo_juph_registrationID"
private let AccountInfo_UMS_messageDetaUrl:String="AccountInfo_UMS_messageDetaUrl"
private let AccountInfo_UMS_messageType:String="AccountInfo_UMS_messageType"
private let AccountInfo_UMS_messageJSON:String="AccountInfo_UMS_messageJSON"

private let AccountInfo_UnReadNumber:String="AccountInfo_UnReadNumber"

private let AccountInfo_webViewUrl:String="AccountInfo_webViewUrl"

private let  AccountInfo_CustomerServicePower:String="AccountInfo_CustomerServicePower"

private let  Advisory_Url:String="AdvisoryUrl"


@objcMembers class AccountInfo: NSObject {
    
    var AdvisoryUrl:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: Advisory_Url)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: Advisory_Url) as? String
        }
    }
    var CustomerServicePower:String?{
            set{
                let userData:UserDefaults=UserDefaults.standard
                userData.set(newValue, forKey: AccountInfo_CustomerServicePower)
            }
            get{
                let userData:UserDefaults=UserDefaults.standard
                return userData.object(forKey: AccountInfo_CustomerServicePower) as? String
            }
        }
    var webViewUrl:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_webViewUrl)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_webViewUrl) as? String
        }
    }
    var UnReadNumber:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_UnReadNumber)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_UnReadNumber) as? String
        }
    }
    
    var UMS_messageJSON:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_UMS_messageJSON)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_UMS_messageJSON) as? String
        }
    }
    
    var UMS_messageType:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_UMS_messageType)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_UMS_messageType) as? String
        }
    }
    
    var UMS_messageDetaUrl:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_UMS_messageDetaUrl)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_UMS_messageDetaUrl) as? String
        }
    }
    
    var juph_registrationID:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_juph_registrationID)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_juph_registrationID) as? String
        }
    }
    
    var tms_version:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_tms_version)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_tms_version) as? String
        }
    }
    
    var singlePoint_remoteIp:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_singlePoint_remoteIp)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_singlePoint_remoteIp) as? String
        }
    }
    var singlePoint_appId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_singlePoint_appId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_singlePoint_appId) as? String
        }
    }
    
    var singlePoint_startTime:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_singlePoint_startTime)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_singlePoint_startTime) as? String
        }
    }
    var singlePoint_access_token:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_singlePoint_access_token)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_singlePoint_access_token) as? String
        }
    }
    
    var weChatInfo_headimgurl:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChatInfo_headimgurl)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChatInfo_headimgurl) as? String
        }
    }
    var weChatInfo_country:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChatInfo_country)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChatInfo_country) as? String
        }
    }
    var weChatInfo_city:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChatInfo_city)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChatInfo_city) as? String
        }
    }
    var weChatInfo_province:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChatInfo_province)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChatInfo_province) as? String
        }
    }
    /// 普通用户性别，1 为男性，2 为女性
    var weChatInfo_sex:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChatInfo_sex)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChatInfo_sex) as? String
        }
    }
    var weChatInfo_nickname:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChatInfo_nickname)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChatInfo_nickname) as? String
        }
    }
    /// 1集团单点 2原有登录
    var loginType:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_loginType)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_loginType) as? String
        }
    }
    var messageNumber:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_messageNumber)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_messageNumber) as? String
        }
    }
    var login_UaesName:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_login_UaesName)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_login_UaesName) as? String
        }
    }
    var weChat_expires_in:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChat_expires_in)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChat_expires_in) as? String
        }
    }
    var weChat_unionid:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChat_unionid)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChat_unionid) as? String
        }
    }
    var weChat_appid:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChat_appid)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChat_appid) as? String
        }
    }
    var weChat_openid:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChat_openid)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChat_openid) as? String
        }
    }
    var weChat_refresh_token:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChat_refresh_token)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChat_refresh_token) as? String
        }
    }
    var weChat_access_token:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChat_access_token)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChat_access_token) as? String
        }
    }
    var weChat_code:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_weChat_code)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_weChat_code) as? String
        }
    }
    var doneCount:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_doneCount)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_doneCount) as? String
        }
    }
    var upcomingCount:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_upcomingCount)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_upcomingCount) as? String
        }
    }
    var oldType:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_oldType)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_oldType) as? String
        }
    }
    var latutide:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_latutide)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_latutide) as? String
        }
    }
    var infoDeptName:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_infoDeptName)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_infoDeptName) as? String
        }
    }
    
    var exceptionInfoo:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_exceptionInfo)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_exceptionInfo) as? String
        }
    }
    var isTest:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_isTest)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_isTest) as? String
        }
    }
   var layout:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_layout)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_layout) as? String
        }
    }
   var infoCompanyName:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_infoCompanyName)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_infoCompanyName) as? String
        }
    }
   var externalUser:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_externalUser)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_externalUser) as? String
        }
    }
   var address:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_address)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_address) as? String
        }
    }
    
//    var selecCompanyUserid:String?{
//        set{
//            let userData:UserDefaults=UserDefaults.standard
//            userData.set(newValue, forKey: AccountInfo_selecCompanyUserid)
//        }
//        get{
//            let userData:UserDefaults=UserDefaults.standard
//            return userData.object(forKey: AccountInfo_selecCompanyUserid) as? String
//        }
//    }
    
    
   var selecCompanyUserName:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_selecCompanyUserName)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_selecCompanyUserName) as? String
        }
    }
    
   var appTestDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_appTestDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_appTestDb) as? String
        }
    }
    
   var appRealDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_appRealDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_appRealDb) as? String
        }
    }
    
   var tmsTestDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_tmsTestDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_tmsTestDb) as? String
        }
    }
    
   var tmsRealDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_tmsRealDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_tmsRealDb) as? String
        }
    }
    
   var omsRealDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_omsRealDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_omsRealDb) as? String
        }
    }
    
   var omsTestDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_omsTestDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_omsTestDb) as? String
        }
    }
    
   var cmsTestDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_cmsTestDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_cmsTestDb) as? String
        }
    }
    
   var cmsRealDb:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_cmsRealDb)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_cmsRealDb) as? String
        }
    }
    
   var messageId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_messageId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_messageId) as? String
        }
    }
    
   var myApplicationCellNum:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_myApplicationCellNum)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_myApplicationCellNum) as? String
        }
    }
    
   var partyOpcode:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_partyOpcode)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_partyOpcode) as? String
        }
    }
    
   var sysType:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_sysType)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_sysType) as? String
        }
    }
    
    
   var sysOrgService:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_sysOrgService)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_sysOrgService) as? String
        }
    }
   
   var userName:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_userName)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_userName) as? String
        }
    }
    
    
   var tags:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_tags)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_tags) as? String
        }
    }
    
   var sysOrg:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_sysOrg)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_sysOrg) as? String
        }
    }
    
   var sysUserId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_sysUserId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_sysUserId) as? String
        }
    }
    
   var db_source:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_db_source)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_db_source) as? String
        }
    }
   var docId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_docId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_docId) as? String
        }
    }
   var selecCompanyNameDic:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_selecCompanyNameDic)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_selecCompanyNameDic) as? String
        }
    }
   var selecDepartmentNameDic:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_selecDepartmentNameDic)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_selecDepartmentNameDic) as? String
        }
    }
   var selecDepartmentId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_selecDepartmentId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_selecDepartmentId) as? String
        }
    }
    
   var selecDepartmentName:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_selecDepartmentName)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_selecDepartmentName) as? String
        }
    }
    
   var appUUID:String?{
        set{
            //let userData:UserDefaults=UserDefaults.standard
            UserDefaults.standard.set(newValue, forKey: AccountInfo_appUUID)
        }
        get{
            //let userData:UserDefaults=UserDefaults.standard
            return UserDefaults.standard.object(forKey: AccountInfo_appUUID) as? String
        }
    }
   
   var urlType:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_urlType)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_urlType) as? String
        }
    }
    
   var isHuangshan:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_isHuangshan)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_isHuangshan) as? String
        }
    }
    
   var isAutoLogin:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_isAutoLogin)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_isAutoLogin) as? String
        }
    }
    
   var saveUaesNamePassWord:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_SaveUaesNamePassWord)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_SaveUaesNamePassWord) as? String
        }
    }
    
   var passWord:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_PassWord)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_PassWord) as? String
        }
    }
    
//   var userName:String?{
//        set{
//            let userData:UserDefaults=UserDefaults.standard
//            userData.set(newValue, forKey: AccountInfo_userName)
//        }
//        get{
//            let userData:UserDefaults=UserDefaults.standard
//            return userData.object(forKey: AccountInfo_userName) as? String
//        }
//    }
    
   var UserId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_UserId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_UserId) as? String
        }
    }
    var ChangPassWordUserId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_ChangPassWordUserId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_ChangPassWordUserId) as? String
        }
    }
   var qrCodeData:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_qrCodeData)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_qrCodeData) as? String
        }
    }
    
   var selecCompanyName:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_selecCompanyName)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_selecCompanyName) as? String
        }
    }
   var selecCompanyId:String?{
        set{
            let userData:UserDefaults=UserDefaults.standard
            userData.set(newValue, forKey: AccountInfo_selecCompanyId)
        }
        get{
            let userData:UserDefaults=UserDefaults.standard
            return userData.object(forKey: AccountInfo_selecCompanyId) as? String
        }
    }
    
    
    class func sharedInstance()->AccountInfo {
        struct SharedStatic {
            static var instance: AccountInfo = AccountInfo()
        }
        return SharedStatic.instance
    }
    ///获取消息列表URL
    func getMessageListUrl()->String{
        if isTest == "1" {
            return "http://222.66.127.246:8021/SYERP/newerp/#/messageList?userId="+judgmentStrNil(str: AccountInfo.sharedInstance().UserId)+"&sysType=门户&docId=6D7F1A2D20C90E64E055000000000001"
        }
        return "http://mobileportal.shaphar.com:8020/SYERP/newerp/#/messageList?userId="+judgmentStrNil(str: AccountInfo.sharedInstance().UserId)+"&sysType=门户&docId=6D7F1A2D20C90E64E055000000000001"
    }
    ///获取通讯录URL
    func getAddressBookUrl()->String{
        if isTest == "1"  {
            return "http://222.66.127.246:8021/SYERP/newerp/#/mailList?userId="+judgmentStrNil(str: AccountInfo.sharedInstance().UserId)
        }
        return "http://mobileportal.shaphar.com:8020/SYERP/newerp/#/mailList?userId="+judgmentStrNil(str: AccountInfo.sharedInstance().UserId)
    }
    ///获取客服地址URL
    func getCustomerServiceUrl()->String{
        if isTest == "1"  {
            return "http://222.66.127.246:8021/SYERP/todolist/itellegeRobot/view/common.html?userId="
//            return "http://192.168.1.128:8080/itellegeRobot/view/common.html?userId="
        }
        return "http://mobileportal.shaphar.com:8020/SYERP/todolist/itellegeRobot/view/common.html?userId="
    }
    ///获取消息页面URL
//    func getMessageVCUrl()->String{
//        if isTest == "1"  {
////            return "http://222.66.127.246:8021/SYERP/todolist/messageDetails/view/common.html?messageId="
////            return "http://222.66.127.246:8021/SYERP/newerp/#/notificationsPush?messageId="+judgmentStrNil(str: AccountInfo.sharedInstance().messageId) + "&isOutUser="+judgmentStrNil(str: AccountInfo.sharedInstance().externalUser)
//            return "http://192.168.1.150:8080/#/notificationsPush?messageId="+judgmentStrNil(str: AccountInfo.sharedInstance().messageId)
//        } else if isTest == "2" {
//            return "http://mobileportal.shaphar.com:8020/SYERP/newerp/#/notificationsPush?messageId="+judgmentStrNil(str: AccountInfo.sharedInstance().messageId) + "&isOutUser="+judgmentStrNil(str: AccountInfo.sharedInstance().externalUser)
//        }
//        return "http://mobileportal.shaphar.com:8020/SYERP/todolist/messageDetails/view/common.html?messageId="+judgmentStrNil(str: AccountInfo.sharedInstance().messageId) + "&isOutUser="+judgmentStrNil(str: AccountInfo.sharedInstance().externalUser)
//    }
    func getMessageVCUrl()->String{
        if isTest == "1"  {
            return "http://222.66.127.246:8021/SYERP/newerp/#/notificationsPush?messageId="+judgmentStrNil(str: AccountInfo.sharedInstance().messageId)
        } else if isTest == "2" {
            return "http://mobileportal.shaphar.com:8020/SYERP/newerp/#/notificationsPush?messageId="+judgmentStrNil(str: AccountInfo.sharedInstance().messageId)
        }
        return "http://mobileportal.shaphar.com:8020/SYERP/todolist/messageDetails/view/common.html?messageId="+judgmentStrNil(str: AccountInfo.sharedInstance().messageId)
    }
    ///获取资讯页面详情URL
    func getAdvisoryVCUrl()->String{
        if isTest == "1"  {
            return "http://222.66.127.246:8021/SYERP/todolist/comNews/view/common.html?docId="
        }
        return "http://mobileportal.shaphar.com:8020/SYERP/todolist/comNews/view/common.html?docId="
    }
    ///获取服务页面详情URL
    func getServiceVCUrl()->String{
        if isTest == "1"  {
            return "http://222.66.127.246:8021/SYERP/todolist/comNews/view/common.html?docId="
        }
        return "http://mobileportal.shaphar.com:8020/SYERP/todolist/comNews/view/common.html?docId="
    }
    ///获取二维码扫描结果页面URL
    func getQRCodeVCUrl(traceBackCode:String?)->String{
        if isTest == "1"  {
            return "http://222.66.127.246:8021/SYERP/todolist/list/view/common.html?,0traceBackCode="+traceBackCode!
        }
        return "http://mobileportal.shaphar.com:8020/SYERP/todolist/list/view/common.html?,0traceBackCode="+traceBackCode!
    }
    func clearAccount(){
        //删除用户的别名
        JPUSHService.deleteAlias({ (iResCode, iAlias, seq) in
            print("退出注销极光别名儿 \(iResCode),\(String(describing: iAlias)),\(seq)")
        }, seq: 1)
        JPUSHService.cleanTags({ (iResCode, iTags, seq) in
            print("退出注销极光Tags \(iResCode),\(String(describing: iTags)),\(seq)")
        }, seq: 2)
        BDVoiceWakeUp.share().stopWakeup()
        AccountInfo.sharedInstance().UserId = nil
        AccountInfo.sharedInstance().docId = nil
        AccountInfo.sharedInstance().db_source = nil
        AccountInfo.sharedInstance().sysOrg = nil
        AccountInfo.sharedInstance().sysUserId = nil
        AccountInfo.sharedInstance().selecCompanyName = nil
        AccountInfo.sharedInstance().selecDepartmentName = nil
        AccountInfo.sharedInstance().userName = nil
        AccountInfo.sharedInstance().sysOrgService = nil
        AccountInfo.sharedInstance().sysType = nil
        AccountInfo.sharedInstance().selecCompanyName = nil
        AccountInfo.sharedInstance().selecCompanyId = nil
        AccountInfo.sharedInstance().sysOrgService = nil
        AccountInfo.sharedInstance().sysType = nil
        AccountInfo.sharedInstance().selecDepartmentName = nil
        AccountInfo.sharedInstance().docId = nil
        AccountInfo.sharedInstance().db_source = nil
        AccountInfo.sharedInstance().sysOrg = nil
        AccountInfo.sharedInstance().sysUserId = nil
        AccountInfo.sharedInstance().partyOpcode = nil
        AccountInfo.sharedInstance().cmsRealDb = nil
        AccountInfo.sharedInstance().cmsTestDb = nil
        AccountInfo.sharedInstance().omsRealDb = nil
        AccountInfo.sharedInstance().omsTestDb = nil
        AccountInfo.sharedInstance().tmsRealDb = nil
        AccountInfo.sharedInstance().tmsTestDb = nil
        AccountInfo.sharedInstance().appRealDb = nil
        AccountInfo.sharedInstance().appTestDb = nil
        AccountInfo.sharedInstance().infoCompanyName = nil
        AccountInfo.sharedInstance().singlePoint_access_token = nil
        AccountInfo.sharedInstance().singlePoint_startTime = nil
        AccountInfo.sharedInstance().doneCount = nil
        AccountInfo.sharedInstance().upcomingCount = nil
        clearWeChatInfoAccount()
        
//        NotificationCenter.default.post(name: Notification.Name(rawValue: "irregularViewOutLogin"), object: "0")
//        NotificationCenter.default.post(name: Notification.Name(rawValue: "chongxindenglu"), object: "0")
     }
    func clearWeChatInfoAccount(){
        
        AccountInfo.sharedInstance().weChatInfo_headimgurl = nil
        AccountInfo.sharedInstance().weChatInfo_sex = nil
        AccountInfo.sharedInstance().weChatInfo_city = nil
        AccountInfo.sharedInstance().weChatInfo_country = nil
        AccountInfo.sharedInstance().weChatInfo_nickname = nil
        AccountInfo.sharedInstance().weChatInfo_province = nil
        AccountInfo.sharedInstance().weChat_unionid = nil
        AccountInfo.sharedInstance().weChat_code = nil
        AccountInfo.sharedInstance().weChat_openid = nil
//        AccountInfo.sharedInstance().weChat_code = nil
//        AccountInfo.sharedInstance().weChat_appid = nil
//        AccountInfo.sharedInstance().weChat_openid = nil
//        AccountInfo.sharedInstance().weChat_unionid = nil
//        AccountInfo.sharedInstance().weChat_refresh_token = nil
//        AccountInfo.sharedInstance().weChat_access_token = nil
    }
}
