Commit 654a1b864eec0f7044f47baa29f8f5eed48dc9ba
1 parent
907c39d8
Exists in
master
app-ht
1. F 处理授权失败的设备,时间改为null
Showing
3 changed files
with
7 additions
and
4 deletions
Show diff stats
app-api/config/url-rules.php
@@ -5,12 +5,13 @@ return [ | @@ -5,12 +5,13 @@ return [ | ||
5 | 5 | ||
6 | 6 | ||
7 | 'POST authDevice' => 'auth-device/index', | 7 | 'POST authDevice' => 'auth-device/index', |
8 | - //'POST authDeviceT' => 'auth-device/indext', | 8 | + 'POST authDeviceN' => 'auth-device/index-no-encode', |
9 | 'POST checkOtaVersion' => 'upgrade/check-version', | 9 | 'POST checkOtaVersion' => 'upgrade/check-version', |
10 | 'POST reportOtaUpgradeEvent' => 'upgrade/report-upgrade-event', | 10 | 'POST reportOtaUpgradeEvent' => 'upgrade/report-upgrade-event', |
11 | 'POST checkAppVersion' => 'upgrade/check-app-version', | 11 | 'POST checkAppVersion' => 'upgrade/check-app-version', |
12 | 'POST reportAppUpgradeEvent' => 'upgrade/report-app-upgrade-event', | 12 | 'POST reportAppUpgradeEvent' => 'upgrade/report-app-upgrade-event', |
13 | 'POST reportDeviceVersion' => 'upgrade/report-device-version', | 13 | 'POST reportDeviceVersion' => 'upgrade/report-device-version', |
14 | + 'POST PTest' => 'upgrade/p-test', | ||
14 | //'POST CryptTxt' => 'auth-device/crypt-txt', | 15 | //'POST CryptTxt' => 'auth-device/crypt-txt', |
15 | 'GET errorPage' => 'site/error-page-info', | 16 | 'GET errorPage' => 'site/error-page-info', |
16 | 'GET minaQuery' => 'site/mina-query', | 17 | 'GET minaQuery' => 'site/mina-query', |
app-ht/modules/device/controllers/DeviceController.php
@@ -780,11 +780,11 @@ class DeviceController extends BaseController | @@ -780,11 +780,11 @@ class DeviceController extends BaseController | ||
780 | if ($needGen) { | 780 | if ($needGen) { |
781 | $trans = Yii::$app->getDb()->beginTransaction(); | 781 | $trans = Yii::$app->getDb()->beginTransaction(); |
782 | try { | 782 | try { |
783 | - Device::createWithMacSerialNo($batchId, $batchNo, $deviceId, $tt, 1, DeviceStatus::NO_AUTH); | 783 | + $rNewDevice = Device::createWithMacSerialNo($batchId, $batchNo, $deviceId, $tt, 1, DeviceStatus::NO_AUTH); |
784 | $deviceFailModel->is_delete = 1; | 784 | $deviceFailModel->is_delete = 1; |
785 | $deviceFailModel->save(); | 785 | $deviceFailModel->save(); |
786 | $trans->commit(); | 786 | $trans->commit(); |
787 | - $e->message = '处理成功'; | 787 | + $e->message = '处理成功,序列号为:'. (isset($rNewDevice->serial_no)? $rNewDevice->serial_no:''); |
788 | $e->success = true; | 788 | $e->success = true; |
789 | } catch(Exception $exception) { | 789 | } catch(Exception $exception) { |
790 | $trans->rollBack(); | 790 | $trans->rollBack(); |
@@ -811,7 +811,7 @@ class DeviceController extends BaseController | @@ -811,7 +811,7 @@ class DeviceController extends BaseController | ||
811 | $deviceFailModel->is_delete = 1; | 811 | $deviceFailModel->is_delete = 1; |
812 | $deviceFailModel->save(); | 812 | $deviceFailModel->save(); |
813 | $trans->commit(); | 813 | $trans->commit(); |
814 | - $e->message = '处理成功'; | 814 | + $e->message = '处理成功, 序列号为'.$newDeviceModel->serial_no; |
815 | $e->success = true; | 815 | $e->success = true; |
816 | } catch (Exception $exception) { | 816 | } catch (Exception $exception) { |
817 | $trans->rollBack(); | 817 | $trans->rollBack(); |
app-ht/modules/device/views/device/auth-fail-index.php
@@ -145,6 +145,8 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -145,6 +145,8 @@ $this->params['breadcrumbs'][] = $this->title; | ||
145 | if (!res.success) { | 145 | if (!res.success) { |
146 | alert(res.message); | 146 | alert(res.message); |
147 | return false; | 147 | return false; |
148 | + } else { | ||
149 | + alert(res.message); | ||
148 | } | 150 | } |
149 | window.location.reload(); | 151 | window.location.reload(); |
150 | }, 'json') | 152 | }, 'json') |