feat: 完善鉴权和密码功能,添加飞书通知模块
- 完善Token过期/不存在时跳转登录重新认证 - 实现正常的账号密码登录验证(邮箱/手机号+密码) - 用户初始化密码设为工号(sn) - 添加修改密码功能(API+前端页面) - 修复扫码登录后跳转问题(zustand persist格式) - 创建飞书通知服务 FeishuNotificationService - 设置页面添加修改密码入口 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,8 @@ class FeishuUtil
|
||||
]);
|
||||
|
||||
if ($response['code'] !== 0) {
|
||||
throw new Exception('获取 app_access_token 失败: ' . ($response['msg'] ?? '未知错误'));
|
||||
$errorMsg = $response['msg'] ?? $response['message'] ?? '未知错误';
|
||||
throw new Exception('获取 app_access_token 失败: ' . $errorMsg);
|
||||
}
|
||||
|
||||
$token = $response['tenant_access_token'];
|
||||
@@ -109,7 +110,8 @@ class FeishuUtil
|
||||
error_log("📝 获取 user_access_token 响应: " . json_encode($response));
|
||||
|
||||
if ($response['code'] !== 0) {
|
||||
throw new Exception('获取 user_access_token 失败: ' . ($response['msg'] ?? '未知错误'));
|
||||
$errorMsg = $response['msg'] ?? $response['message'] ?? '未知错误';
|
||||
throw new Exception('获取 user_access_token 失败: ' . $errorMsg);
|
||||
}
|
||||
|
||||
if (!isset($response['data']['access_token'])) {
|
||||
@@ -149,7 +151,8 @@ class FeishuUtil
|
||||
error_log("📝 获取用户信息响应: " . json_encode($response));
|
||||
|
||||
if ($response['code'] !== 0) {
|
||||
throw new Exception('获取用户信息失败: ' . ($response['msg'] ?? '未知错误'));
|
||||
$errorMsg = $response['msg'] ?? $response['message'] ?? '未知错误';
|
||||
throw new Exception('获取用户信息失败: ' . $errorMsg);
|
||||
}
|
||||
|
||||
$userInfo = $response['data'] ?? [];
|
||||
|
||||
Reference in New Issue
Block a user