Commit a641d996 authored by 刘俊宏's avatar 刘俊宏

完成修改密码接口对接并完善功能

parent bd5c0063
......@@ -242,6 +242,7 @@
F969BF08244EC38000C79953 /* GoodsCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */; };
F969BF1E244EE67900C79953 /* GoodsManageListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */; };
F969BF1F244EE67900C79953 /* GoodsManageListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */; };
F9DDBE922457BFEC00A32CB2 /* HUDEXT.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DDBE912457BFEC00A32CB2 /* HUDEXT.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -531,6 +532,7 @@
F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsCollectionViewCell.xib; sourceTree = "<group>"; };
F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoodsManageListVC.swift; sourceTree = "<group>"; };
F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsManageListVC.xib; sourceTree = "<group>"; };
F9DDBE912457BFEC00A32CB2 /* HUDEXT.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HUDEXT.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -1181,6 +1183,7 @@
F933F6AE2452C68B00189561 /* PKHUD */ = {
isa = PBXGroup;
children = (
F9DDBE912457BFEC00A32CB2 /* HUDEXT.swift */,
F933F6AF2452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift */,
F933F6B02452C68B00189561 /* PKHUDAnimation.swift */,
F933F6B12452C68B00189561 /* PKHUDAnimating.swift */,
......@@ -1768,6 +1771,7 @@
E042F734245274F200CDFA12 /* YunDanLieBiaoCell.swift in Sources */,
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */,
F933F6C32452C68B00189561 /* FrameView.swift in Sources */,
F9DDBE922457BFEC00A32CB2 /* HUDEXT.swift in Sources */,
E0A7548A244A8F0F00A84B67 /* CheckWareHourseViewController.swift in Sources */,
F9023F62244999F500DD5A63 /* WarehoseMangementCell.swift in Sources */,
E0516F772448003D00E373CE /* PayViewController.swift in Sources */,
......
//
// HUDEXT.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/4/28.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
func delay(_ delay: Double, closure:@escaping () -> Void) {
DispatchQueue.main.asyncAfter(
deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure)
}
......@@ -58,7 +58,20 @@ class ChangePassViewController: BaseViewController {
oldPassTF.isSecureTextEntry = !oldPBtn.isSelected
}
@IBAction func submitAction(_ sender: Any) {
changePwd(["user_token":UserToken as Any,"pwd":oldPassTF.text as Any,"new_pwd":newPassTF.text as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "修改成功"),delay: 1.5)
delay(1.5) {
HUD.flash(.label("请重新登录"), delay: 1.5)
delay(1.5){
UserDefaults.standard.removeObject(forKey: "user_token")
NotificationCenter.default.post(name: Notification.Name(rawValue: "logout"), object: nil)
}
}
}) { (error) in
}
}
......
......@@ -96,7 +96,7 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
login(["user_name":phoneTF.text as Any,"pwd":passTF.text as Any], success: { (data) in
let dataM = data as! LoginModel
UserDefaults.standard.set(dataM.data?.user_token, forKey: "user_token")
UserDefaults.standard.synchronize()
// UserDefaults.standard.synchronize()
self.loginBtn.isLoading = false
self.delegate?.successLogin()
}) { (error) in
......
......@@ -50,7 +50,7 @@ class AccountViewController: BaseViewController{
print("退出登录")
//模拟退出登录
UserDefaults.standard.removeObject(forKey: "user_token")
UserDefaults.standard.synchronize()
// UserDefaults.standard.synchronize()
NotificationCenter.default.post(name: Notification.Name(rawValue: "logout"), object: nil)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment