From 654a1b864eec0f7044f47baa29f8f5eed48dc9ba Mon Sep 17 00:00:00 2001 From: xu Date: Thu, 21 Nov 2019 12:09:08 +0800 Subject: [PATCH] app-ht 1. F 处理授权失败的设备,时间改为null --- app-api/config/url-rules.php | 3 ++- app-ht/modules/device/controllers/DeviceController.php | 6 +++--- app-ht/modules/device/views/device/auth-fail-index.php | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app-api/config/url-rules.php b/app-api/config/url-rules.php index 996efbe..fbb1b35 100644 --- a/app-api/config/url-rules.php +++ b/app-api/config/url-rules.php @@ -5,12 +5,13 @@ return [ 'POST authDevice' => 'auth-device/index', - //'POST authDeviceT' => 'auth-device/indext', + 'POST authDeviceN' => 'auth-device/index-no-encode', 'POST checkOtaVersion' => 'upgrade/check-version', 'POST reportOtaUpgradeEvent' => 'upgrade/report-upgrade-event', 'POST checkAppVersion' => 'upgrade/check-app-version', 'POST reportAppUpgradeEvent' => 'upgrade/report-app-upgrade-event', 'POST reportDeviceVersion' => 'upgrade/report-device-version', + 'POST PTest' => 'upgrade/p-test', //'POST CryptTxt' => 'auth-device/crypt-txt', 'GET errorPage' => 'site/error-page-info', 'GET minaQuery' => 'site/mina-query', diff --git a/app-ht/modules/device/controllers/DeviceController.php b/app-ht/modules/device/controllers/DeviceController.php index 6dd06de..8fc544b 100644 --- a/app-ht/modules/device/controllers/DeviceController.php +++ b/app-ht/modules/device/controllers/DeviceController.php @@ -780,11 +780,11 @@ class DeviceController extends BaseController if ($needGen) { $trans = Yii::$app->getDb()->beginTransaction(); try { - Device::createWithMacSerialNo($batchId, $batchNo, $deviceId, $tt, 1, DeviceStatus::NO_AUTH); + $rNewDevice = Device::createWithMacSerialNo($batchId, $batchNo, $deviceId, $tt, 1, DeviceStatus::NO_AUTH); $deviceFailModel->is_delete = 1; $deviceFailModel->save(); $trans->commit(); - $e->message = '处理成功'; + $e->message = '处理成功,序列号为:'. (isset($rNewDevice->serial_no)? $rNewDevice->serial_no:''); $e->success = true; } catch(Exception $exception) { $trans->rollBack(); @@ -811,7 +811,7 @@ class DeviceController extends BaseController $deviceFailModel->is_delete = 1; $deviceFailModel->save(); $trans->commit(); - $e->message = '处理成功'; + $e->message = '处理成功, 序列号为'.$newDeviceModel->serial_no; $e->success = true; } catch (Exception $exception) { $trans->rollBack(); diff --git a/app-ht/modules/device/views/device/auth-fail-index.php b/app-ht/modules/device/views/device/auth-fail-index.php index 36f938f..930fcda 100644 --- a/app-ht/modules/device/views/device/auth-fail-index.php +++ b/app-ht/modules/device/views/device/auth-fail-index.php @@ -145,6 +145,8 @@ $this->params['breadcrumbs'][] = $this->title; if (!res.success) { alert(res.message); return false; + } else { + alert(res.message); } window.location.reload(); }, 'json') -- libgit2 0.21.0