|
|
@@ -953,27 +953,8 @@ class DeliveryController extends BaseController
|
|
|
];
|
|
|
DeliveryAuthTokenClass::add($data);
|
|
|
|
|
|
- $templatePath = Yii::getAlias('@common/components/delivery/html/auth-success-template.html');
|
|
|
- $template = '';
|
|
|
- if (is_file($templatePath) && is_readable($templatePath)) {
|
|
|
- $template = file_get_contents($templatePath);
|
|
|
- }
|
|
|
- if ($template === false || $template === '') {
|
|
|
- $template = '<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>{{title}}</title></head><body><h1>{{heading}}</h1><p>{{message}}</p></body></html>';
|
|
|
- }
|
|
|
-
|
|
|
- $content = strtr($template, [
|
|
|
- '{{title}}' => '授权成功',
|
|
|
- '{{heading}}' => '授权成功',
|
|
|
- '{{message}}' => '您的滴滴账号已成功完成授权,现在可以返回使用聚合配送服务。',
|
|
|
- ]);
|
|
|
-
|
|
|
- $response = Yii::$app->response;
|
|
|
- $response->format = Response::FORMAT_HTML;
|
|
|
- $response->content = $content;
|
|
|
Yii::info('滴滴授权回调保存成功', 'didi');
|
|
|
-
|
|
|
- return $response;
|
|
|
+ return $this->asJson(['code' => 200, 'msg' => 'auth success', 'data' => ['msg'=>'success']]);
|
|
|
} catch (\Exception $e) {
|
|
|
Yii::error('滴滴授权回调保存失败' . $e->getMessage(), 'didi');
|
|
|
}
|