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
1f4fb272
Commit
1f4fb272
authored
Jun 25, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权逻辑
parent
d41e6aa9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
12 deletions
+76
-12
YHMyNameCardViewController.swift
.../Modules/Community(社区)/C/YHMyNameCardViewController.swift
+20
-2
YHMyInformationItemCell.swift
...ses/Modules/Community(社区)/V/YHMyInformationItemCell.swift
+1
-9
YHInformationAuthorizeViewModel.swift
...es/Community(社区)/VM/YHInformationAuthorizeViewModel.swift
+34
-0
YHAllowUseMyInfoViewController.swift
.../Modules/Login(登录)/C/YHAllowUseMyInfoViewController.swift
+4
-1
YHUserInfoSettingViewModel.swift
...ses/Modules/Login(登录)/VM/YHUserInfoSettingViewModel.swift
+16
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+1
-0
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHMyNameCardViewController.swift
View file @
1f4fb272
...
...
@@ -79,7 +79,11 @@ class YHMyNameCardViewController: YHBaseViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
requestNameCardInfo
()
if
isCurrentUser
{
requestAuthorization
()
}
else
{
requestNameCardInfo
()
}
}
func
createUI
()
{
...
...
@@ -219,7 +223,21 @@ extension YHMyNameCardViewController {
func
requestAuthorization
()
{
self
.
authorModel
.
requestUserAuthorization
{
success
,
error
in
self
.
requestNameCardInfo
()
if
self
.
authorModel
.
setModel
.
isclick_card
!=
2
{
YHCommonAlertView
.
show
(
""
,
"授权信息同步至您的名片并对您的好友可见"
,
"取消"
,
"确认"
,
fullGuestureEnable
:
false
)
{
self
.
authorModel
.
requestInformationToCardSubmit
(
agress
:
1
)
{
success
,
error
in
self
.
requestNameCardInfo
()
}
}
callBack
:
{
self
.
authorModel
.
requestInformationToCardSubmit
(
agress
:
2
)
{
success
,
error
in
self
.
authorModel
.
requestBusinessCardAuthorize
{
success
,
error
in
self
.
requestNameCardInfo
()
}
}
}
}
else
{
self
.
requestNameCardInfo
()
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHMyInformationItemCell.swift
View file @
1f4fb272
...
...
@@ -116,14 +116,6 @@ class YHMyInformationItemCell: UITableViewCell {
titleLabel
.
attributedText
=
questionAttrStr
messageTextField
.
placeholder
=
dataSource
.
prompts
messageTextField
.
text
=
dataSource
.
message
if
dataSource
.
type
==
.
constellation
{
let
arr
=
YHConstantArrayData
.
arrDegreeConstellation
arr
.
forEach
{
item
in
if
item
[
"id"
]
==
dataSource
.
message
{
messageTextField
.
text
=
item
[
"title"
]
}
}
}
if
dataSource
.
isUserKeyBoard
??
false
{
nextStepImageView
.
isHidden
=
true
centerButton
.
isHidden
=
true
...
...
@@ -183,7 +175,7 @@ class YHMyInformationItemCell: UITableViewCell {
case
.
constellation
:
YHOtherPickerView
.
show
(
type
:
.
constellation
,
selectTitle
:
self
.
dataSource
?
.
message
??
""
)
{
item
in
print
(
item
)
self
.
dataSource
?
.
message
=
item
.
index
self
.
dataSource
?
.
message
=
item
.
title
self
.
updateAllViews
()
if
let
block
=
self
.
block
{
block
(
self
.
dataSource
??
YHUserInformationModel
())
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/VM/YHInformationAuthorizeViewModel.swift
View file @
1f4fb272
...
...
@@ -204,4 +204,38 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
callBackBlock
(
false
,
err
)
}
}
func
requestInformationToCardSubmit
(
agress
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"information_to_card"
:
agress
,
"isclick_card"
:
2
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
People
.
authorizationSubmit
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
func
requestBusinessCardAuthorize
(
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
People
.
businessCardAuthorize
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Modules/Login(登录)/C/YHAllowUseMyInfoViewController.swift
View file @
1f4fb272
...
...
@@ -73,7 +73,10 @@ class YHAllowUseMyInfoViewController: YHBaseViewController {
}
viewModel
.
requestAuthorizationSubmit
(
agress
:
open
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
dismiss
(
animated
:
true
)
viewModel
.
requestBusinessCardAuthorize
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
dismiss
(
animated
:
true
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/VM/YHUserInfoSettingViewModel.swift
View file @
1f4fb272
...
...
@@ -67,4 +67,20 @@ class YHUserInfoSettingViewModel: YHBaseViewModel {
callBackBlock
(
false
,
err
)
}
}
func
requestBusinessCardAuthorize
(
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
People
.
businessCardAuthorize
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
1f4fb272
...
...
@@ -333,6 +333,7 @@ class YHAllApiName {
static
let
userInfo
=
"super-app/user-base/info"
static
let
userAuthorization
=
"super-app/user/authorization"
static
let
cardSave
=
"super-app/business-card/save"
static
let
businessCardAuthorize
=
"super-app/business-card/authorize"
}
}
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