Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
95525c33
Commit
95525c33
authored
Apr 18, 2024
by
Steven杜宇
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 登出
parent
3353c53f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
4 deletions
+46
-4
YHLoginViewModel.swift
...alaxy/Classes/Modules/Login(登录)/VM/YHLoginViewModel.swift
+23
-0
YHMySettingViewController.swift
...lasses/Modules/Mine(我的)/C/YHMySettingViewController.swift
+22
-4
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+1
-0
No files found.
galaxy/galaxy/Classes/Modules/Login(登录)/VM/YHLoginViewModel.swift
View file @
95525c33
...
@@ -81,4 +81,27 @@ extension YHLoginViewModel {
...
@@ -81,4 +81,27 @@ extension YHLoginViewModel {
callBackBlock
(
false
,
err
)
callBackBlock
(
false
,
err
)
}
}
}
}
func
logout
(
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Auth
.
logout
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
printLog
(
json
)
let
dic
=
json
.
data
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
error
in
callBackBlock
(
false
,
error
)
}
}
}
}
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMySettingViewController.swift
View file @
95525c33
...
@@ -11,6 +11,7 @@ import SnapKit
...
@@ -11,6 +11,7 @@ import SnapKit
class
YHMySettingViewController
:
YHBaseViewController
,
ConstraintRelatableTarget
{
class
YHMySettingViewController
:
YHBaseViewController
,
ConstraintRelatableTarget
{
let
viewModel
:
YHLoginViewModel
=
YHLoginViewModel
()
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
plain
)
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
plain
)
tableView
.
contentInsetAdjustmentBehavior
=
.
never
tableView
.
contentInsetAdjustmentBehavior
=
.
never
...
@@ -112,10 +113,27 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
...
@@ -112,10 +113,27 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
}
}
@objc
func
logout
()
{
@objc
func
logout
()
{
YHLoginManager
.
shared
.
clearUserInfo
()
YHHUD
.
show
(
.
progress
(
message
:
"退出登录中..."
))
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
self
.
viewModel
.
logout
()
{
YHHUD
.
flash
(
message
:
"退出成功"
)
[
weak
self
]
success
,
error
in
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
guard
let
self
=
self
else
{
return
}
YHHUD
.
hide
()
if
success
{
DispatchQueue
.
main
.
async
{
YHHUD
.
flash
(
message
:
"退出成功"
)
YHLoginManager
.
shared
.
clearUserInfo
()
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
return
}
var
msg
=
"退出失败"
if
let
error
=
error
,
!
error
.
errorMsg
.
isEmpty
{
msg
=
error
.
errorMsg
}
YHHUD
.
flash
(
message
:
msg
)
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
95525c33
...
@@ -162,6 +162,7 @@ class YHAllApiName {
...
@@ -162,6 +162,7 @@ class YHAllApiName {
//登录
//登录
struct
Auth
{
struct
Auth
{
static
let
login
=
"infoflow/auth/login"
static
let
login
=
"infoflow/auth/login"
static
let
logout
=
"infoflow/auth/logout"
}
}
//获取验证
//获取验证
...
...
pete谢兆麟
@pete
mentioned in commit
d9e4e9d7
·
Apr 18, 2024
mentioned in commit
d9e4e9d7
mentioned in commit d9e4e9d7eaa321d89a3c6dcb3330514d3b664418
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment