|
@@ -29,7 +29,6 @@ class SwitchAccountViewModel: NSObject {
|
|
|
|
|
|
override init() {
|
|
|
super.init()
|
|
|
-// searchCoachInfoList()
|
|
|
}
|
|
|
|
|
|
//获取用户并刷新
|
|
@@ -81,6 +80,7 @@ class SwitchAccountViewModel: NSObject {
|
|
|
LocalManager.userInfo.isLogin = true //设置已经登录
|
|
|
print("登录成功:%@", userinfo)
|
|
|
NYTips.showMsg(txt: "切换成功")
|
|
|
+ //self.navigationController?.popViewController(animated: true)
|
|
|
}, onError: { error in
|
|
|
NYTips.hide()
|
|
|
NYTips.showErr(txt: (error as! RequestError).errorDescription)
|
|
@@ -95,6 +95,12 @@ class SwitchAccountViewModel: NSObject {
|
|
|
|
|
|
let alertController = QMUIAlertController(title: "提示", message: "确认删除这个用户信息?", preferredStyle: .alert)
|
|
|
let action2 = QMUIAlertAction(title: "删除", style: .default) { [unowned self] vc, action in
|
|
|
+ let account = self.rows[row]
|
|
|
+ if account.idcard == LocalManager.userInfo.idcard {
|
|
|
+ //清除登录信息
|
|
|
+ LocalManager.userInfo.userAccount = ""
|
|
|
+ LocalManager.userInfo.password = ""
|
|
|
+ }
|
|
|
NYAccountManager.shared.deleteAccount(at: row)
|
|
|
self.getAccountsRead()
|
|
|
}
|
|
@@ -111,3 +117,7 @@ class SwitchAccountViewModel: NSObject {
|
|
|
|
|
|
}
|
|
|
|
|
|
+//事件
|
|
|
+extension SwitchAccountViewModel:UITableViewDelegate {
|
|
|
+
|
|
|
+}
|