CaiWuXiTong/config/dingtalk.php
renshen 913d6203d9 钉钉登录权限:财务中心看全部,其他在职员工只看风险管控两个页面
- FinanceRoster 返回 restricted 标记:非财务中心在职员工可以登录,但只允许访问
  店铺违规信息预警、店铺流程
- 每次登录按当前部门刷新访问范围(财务中心=全部,其它=两个页面),手工账号不受影响
- SidebarPermissions 增加 restricted 范围,菜单与页面权限同步收口
- 补充登录范围测试
2026-10-24 13:24:59 +08:00

45 lines
2.4 KiB
PHP

<?php
return [
'enabled' => (bool) env('DINGTALK_LOGIN_ENABLED', false),
'client_id' => env('DINGTALK_CLIENT_ID'),
'client_secret' => env('DINGTALK_CLIENT_SECRET'),
'redirect_uri' => env(
'DINGTALK_REDIRECT_URI',
rtrim(env('APP_URL', 'https://caiwu.jiansuntuzhi.cn:8442'), '/').'/auth/dingtalk/callback'
),
// Verified HR roots: 简尚财务中心 and 龙晨品牌中心/财务中心.
'finance_department_ids' => array_values(array_filter(array_map('trim', explode(',', env('DINGTALK_FINANCE_DEPARTMENT_IDS', '22848291,994080505'))))),
// Individually approved, current enterprise members; never names or whole departments.
// This grants ordinary login only, with the exact courier page scope below.
'limited_login_user_ids' => array_values(array_filter(array_map('trim', explode(',', env('DINGTALK_LIMITED_LOGIN_USER_IDS', ''))))),
'limited_login_page_keys' => [
'courier-payables/courier-onboarding',
'courier-payables/courier-information',
'courier-payables/quote-management',
],
// 非财务中心员工:可以登录,但只能访问财务经营风险管控下的这两个页面。
'restricted_page_keys' => [
'financial-risk-control/store-violation-alert',
'financial-risk-control/process-statistics',
],
// When omitted, automatic provisioning requires exactly one enabled company.
'company_id' => env('DINGTALK_COMPANY_ID'),
// Explicitly approved enterprise user IDs only; never names or departments.
// Applies the highest role on first provisioning, not on subsequent logins.
'super_admin_user_ids' => array_values(array_filter(array_map('trim', explode(',', env('DINGTALK_SUPER_ADMIN_USER_IDS', ''))))),
'authorize_url' => env('DINGTALK_AUTHORIZE_URL', 'https://login.dingtalk.com/oauth2/auth'),
'token_url' => env('DINGTALK_TOKEN_URL', 'https://api.dingtalk.com/v1.0/oauth2/userAccessToken'),
'user_url' => env('DINGTALK_USER_URL', 'https://api.dingtalk.com/v1.0/contact/users/me'),
'app_token_url' => env('DINGTALK_APP_TOKEN_URL', 'https://oapi.dingtalk.com/gettoken'),
'user_by_union_id_url' => env('DINGTALK_USER_BY_UNION_ID_URL', 'https://oapi.dingtalk.com/topapi/user/getbyunionid'),
'user_detail_url' => env('DINGTALK_USER_DETAIL_URL', 'https://oapi.dingtalk.com/topapi/v2/user/get'),
'timeout' => (int) env('DINGTALK_HTTP_TIMEOUT', 10),
'state_ttl_minutes' => (int) env('DINGTALK_STATE_TTL_MINUTES', 5),
];