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
9d238680
Commit
9d238680
authored
Sep 13, 2021
by
mingyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add current platform
parent
5ea2dd5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
Gemfile.lock
Gemfile.lock
+3
-2
saas.rb
app/apis/dingtalk/api/inner/saas.rb
+2
-1
saas.rb
app/apis/dingtalk/api/saas.rb
+3
-2
No files found.
Gemfile.lock
View file @
9d238680
...
...
@@ -7,7 +7,7 @@ GIT
GIT
remote: https://github.com/work-design/rails_com.git
revision:
62d866862c729077c67329a0faf255ebaa49eba2
revision:
45c5d36f3b00416bb719b73bde82cee16338a380
specs:
rails_com (1.2.9)
acme-client
...
...
@@ -30,7 +30,7 @@ GIT
GIT
remote: https://github.com/work-design/rails_extend.git
revision:
9f79c3ba99e3d590841736b4a7855f54035a43cc
revision:
0c2ef4ef6c5538dfeb7df0692012177431d2f59e
specs:
rails_extend (1.0.0)
rails (>= 6.0)
...
...
@@ -251,6 +251,7 @@ GEM
zeitwerk (2.4.2)
PLATFORMS
x86_64-darwin
x86_64-darwin-20
x86_64-linux
...
...
app/apis/dingtalk/api/inner/saas.rb
View file @
9d238680
module
Dingtalk::Api
module
Inner::Saas
BASE
=
'https://openplatform.dg-work.cn'
#BASE = 'https://openplatform.dg-work.cn'
BASE
=
'https://openplatform-pro.ding.zj.gov.cn'
def
getuserinfo
(
code
)
r
=
post
'/rpc/oauth2/dingtalk_app_user.json'
,
auth_code:
code
,
base:
BASE
...
...
app/apis/dingtalk/api/saas.rb
View file @
9d238680
module
Dingtalk::Api
class
Saas
<
Base
include
Inner
::
Saas
BASE
=
'https://openplatform.dg-work.cn'
#BASE = 'https://openplatform.dg-work.cn'
BASE
=
'https://openplatform-pro.ding.zj.gov.cn'
def
token
headers
=
sign_header
(
'POST'
,
'/gettoken.json'
)
r
=
@client
.
post
'gettoken.json'
,
headers:
headers
,
base:
BASE
r
=
@client
.
post
'
/
gettoken.json'
,
headers:
headers
,
base:
BASE
{
'access_token'
=>
r
.
dig
(
'content'
,
'data'
,
'accessToken'
),
'expires_in'
=>
r
.
dig
(
'content'
,
'data'
,
'expiresIn'
)
...
...
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