| | |
| | | |
| | | func loginSuccess(){ |
| | | NotificationCenter.default.post(name: LoginSuccess_Noti, object: nil) |
| | | |
| | | if let jsonString = UserDefaults.standard.value(forKey: "saveUserAnswers") as? String{ |
| | | if let model = ResponseUserAnswerModel.deserialize(from: jsonString){ |
| | | Services.saveUserAnswers(model, device: UserViewModel.DeviceUUID).subscribe(onNext: { data in |
| | | UserDefaults.standard.set(nil, forKey: "saveUserAnswers") |
| | | NotificationCenter.default.post(name: LoginSuccess_Noti, object: nil, userInfo: nil) |
| | | }).disposed(by: JQ_disposeBag) |
| | | } |
| | | } |
| | | } |
| | | |
| | | func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { |
| | |
| | | Services.getUserInfo().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | sceneDelegate?.loginSuccess() |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | }else{ |