Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails_dingtalk
Project
Overview
Details
Activity
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
other
rails_dingtalk
Commits
693d5bcb
Commit
693d5bcb
authored
Sep 05, 2021
by
mingyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dingtalk
parent
b948cf46
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
new.rb
app/apis/dingtalk/api/inner/new.rb
+1
-2
apps_controller.rb
app/controllers/dingtalk/apps_controller.rb
+1
-1
dingtalk_user_job.rb
app/jobs/dingtalk/dingtalk_user_job.rb
+9
-0
normal_app.rb
app/models/dingtalk/model/app/normal_app.rb
+5
-0
No files found.
app/apis/dingtalk/api/inner/new.rb
View file @
693d5bcb
...
@@ -3,8 +3,7 @@ module Dingtalk::Api
...
@@ -3,8 +3,7 @@ module Dingtalk::Api
BASE
=
'https://api.dingtalk.com/'
BASE
=
'https://api.dingtalk.com/'
def
getuserinfo
(
union_id
)
def
getuserinfo
(
union_id
)
r
=
get
"v1.0/contact/users/
#{
union_id
}
"
get
"v1.0/contact/users/
#{
union_id
}
"
r
[
'result'
]
end
end
end
end
...
...
app/controllers/dingtalk/apps_controller.rb
View file @
693d5bcb
...
@@ -3,7 +3,7 @@ module Dingtalk
...
@@ -3,7 +3,7 @@ module Dingtalk
before_action
:set_app
,
only:
[
:login
]
before_action
:set_app
,
only:
[
:login
]
def
info
def
info
result
=
@app
.
getuserinfo
(
params
[
:code
])
result
=
@app
.
xx
(
params
[
:code
])
render
json:
result
render
json:
result
end
end
...
...
app/jobs/dingtalk/dingtalk_user_job.rb
0 → 100644
View file @
693d5bcb
module
Dingtalk
class
DingtalkUserJob
<
ApplicationJob
def
perform
(
agency
)
agency
.
store_info
end
end
end
app/models/dingtalk/model/app/normal_app.rb
View file @
693d5bcb
...
@@ -6,5 +6,10 @@ module Dingtalk
...
@@ -6,5 +6,10 @@ module Dingtalk
has_one
:new_app
,
foreign_key: :app_key
,
primary_key: :app_key
has_one
:new_app
,
foreign_key: :app_key
,
primary_key: :app_key
end
end
def
xx
(
code
)
result
=
api
.
getuserinfo
(
code
)
new_app
.
api
.
getuserinfo
(
result
[
'unionid'
])
end
end
end
end
end
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