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
17f3d1af
Commit
17f3d1af
authored
Sep 14, 2021
by
mingyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
defautl sass appid
parent
8e7c74b2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
7 deletions
+12
-7
Gemfile.lock
Gemfile.lock
+1
-1
saas.rb
app/apis/dingtalk/api/inner/saas.rb
+4
-3
apps_controller.rb
app/controllers/dingtalk/admin/apps_controller.rb
+1
-0
user.rb
app/models/dingtalk/ext/user.rb
+3
-3
app.rb
app/models/dingtalk/model/app.rb
+1
-0
_index_tbody.html.erb
app/views/dingtalk/admin/apps/_index_tbody.html.erb
+1
-0
_index_thead.html.erb
app/views/dingtalk/admin/apps/_index_thead.html.erb
+1
-0
No files found.
Gemfile.lock
View file @
17f3d1af
...
...
@@ -7,7 +7,7 @@ GIT
GIT
remote: https://github.com/work-design/rails_com.git
revision:
0fa82f6df70ac2222a9a5fdeb8f0d209ba01eeb7
revision:
953ef46899c750d41ea6e09aba71c9376363e1ce
specs:
rails_com (1.2.9)
acme-client
...
...
app/apis/dingtalk/api/inner/saas.rb
View file @
17f3d1af
...
...
@@ -13,12 +13,13 @@ module Dingtalk::Api
end
end
def
get_employee_code
(
mobile
,
tenant_id
)
def
get_employee_code
(
mobile
)
payload
=
{
areaCode:
'86'
,
namespace:
'local'
namespace:
'local'
,
tenantId:
app
.
tenant_id
,
mobile:
mobile
}
payload
.
merge!
mobile:
mobile
,
tenantId:
tenant_id
r
=
post
'/mozi/employee/get_by_mobile'
,
payload
,
base:
BASE
...
...
app/controllers/dingtalk/admin/apps_controller.rb
View file @
17f3d1af
...
...
@@ -12,6 +12,7 @@ module Dingtalk
:name
,
:corp_id
,
:agent_id
,
:tenant_id
,
:app_key
,
:app_secret
]
...
...
app/models/dingtalk/ext/user.rb
View file @
17f3d1af
...
...
@@ -6,9 +6,9 @@ module Dingtalk
attribute
:employee_code
,
:string
end
def
sync_employee_code
(
mobile
,
tenant_id
,
app_key
)
app
=
SaasApp
.
find_by
(
app_key:
app_key
)
info
=
app
.
api
.
get_employee_code
(
mobile
,
tenant_id
)
def
sync_employee_code
(
mobile
,
app_key
=
nil
)
app
=
SaasApp
.
find_by
(
app_key:
app_key
)
||
SaasApp
.
first
info
=
app
.
api
.
get_employee_code
(
mobile
)
self
.
employee_code
=
info
[
'employeeCode'
]
self
end
...
...
app/models/dingtalk/model/app.rb
View file @
17f3d1af
...
...
@@ -14,6 +14,7 @@ module Dingtalk
attribute
:jsapi_ticket
,
:string
attribute
:oauth2_state
,
:string
attribute
:jsapi_ticket_expires_at
,
:datetime
attribute
:tenant_id
,
:string
,
comment:
'专有钉钉,租户ID'
has_many
:dingtalk_users
,
foreign_key: :appid
,
primary_key: :app_key
end
...
...
app/views/dingtalk/admin/apps/_index_tbody.html.erb
View file @
17f3d1af
...
...
@@ -7,3 +7,4 @@
<p>
<%=
model
.
app_key
%>
</p>
<p>
<%=
model
.
app_secret
%>
</p>
</td>
<td>
<%=
model
.
tenant_id
%>
</td>
app/views/dingtalk/admin/apps/_index_thead.html.erb
View file @
17f3d1af
...
...
@@ -7,4 +7,5 @@
<p>
<%=
Dingtalk
::
App
.
human_attribute_name
(
:app_key
)
%>
</p>
<p>
<%=
Dingtalk
::
App
.
human_attribute_name
(
:app_secret
)
%>
</p>
</th>
<th>
<%=
Dingtalk
::
App
.
human_attribute_name
(
:tenant_id
)
%>
</th>
<th></th>
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