修改了登录im的逻辑
This commit is contained in:
@@ -16,6 +16,7 @@ class AuthFillDataVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
}
|
||||
|
||||
private func loadSubViews() {
|
||||
randomNick()
|
||||
view.addSubview(backImgView)
|
||||
view.addSubview(backBtn)
|
||||
view.addSubview(titleLb)
|
||||
@@ -144,6 +145,16 @@ class AuthFillDataVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
return button
|
||||
}()
|
||||
|
||||
fileprivate func randomNick() {
|
||||
RequestGet(path: "random/nick/get", parma: [:]) { text in
|
||||
if let text = text as? String {
|
||||
self.nickTextFiled.text = text
|
||||
}
|
||||
} fail: { code, msg in
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@objc func femaleBtnAction() {
|
||||
self.femaleBtn.isSelected = true
|
||||
self.maleBtn.isSelected = false
|
||||
@@ -157,14 +168,36 @@ class AuthFillDataVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
|
||||
|
||||
@objc func backBtnAction() {
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
AuthViewModel.authVM.logout()
|
||||
}
|
||||
|
||||
@objc func nickTextFiledDidChange(_ textField: UITextField) {
|
||||
|
||||
if let text = textField.text {
|
||||
if text.count > 15 {
|
||||
textField.text = text.substring(start: 0, 15)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@objc func confirmBtnAction() {
|
||||
if maleBtn.isSelected == true || femaleBtn.isSelected == true {
|
||||
if let nick = nickTextFiled.text, nick.count > 0 {
|
||||
let gender = self.maleBtn.isSelected ? "1" : "2"
|
||||
let params:[String: Any] = ["avatar":"https://image.ymlive.fun/default_avatar.png", "nick": nick, "gender":gender, "uid": AuthManager.userUid, "ticket":AuthManager.ticket]
|
||||
RequestPost(path: "user/v2/update", parma: params) { data in
|
||||
HUDTool.show(with: "更新成功")
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
} fail: { code, message in
|
||||
HUDTool.show(with: message)
|
||||
}
|
||||
} else {
|
||||
HUDTool.show(with: "请输入昵称")
|
||||
}
|
||||
} else {
|
||||
HUDTool.show(with: "请选择性别")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user