Просмотр исходного кода

全局中间件 处理REQUEST空格转换

Zhouzhendong 5 лет назад
Родитель
Сommit
7ece5fa26e

+ 1 - 0
app/Http/Kernel.php

@@ -19,6 +19,7 @@ class Kernel extends HttpKernel
         \App\Http\Middleware\TrimStrings::class,
         \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
         \App\Http\Middleware\TrustProxies::class,
+        \App\Http\Middleware\DecodingRequest::class,
     ];
 
     /**

+ 26 - 0
app/Http/Middleware/DecodingRequest.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+use Illuminate\Support\Facades\URL;
+
+class DecodingRequest
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        if ($request->method() == "GET"){
+            foreach ($request->input() as $key => $value){
+                if ($value != null)$request->offsetSet($key, str_replace("%20"," ",$value));
+            }
+        }
+        return $next($request);
+    }
+}

+ 0 - 2
app/Providers/AppServiceProvider.php

@@ -3,14 +3,12 @@
 namespace App\Providers;
 
 use App\Http\Controllers\Controller;
-use App\InventoryAccountMission;
 use App\Services\CommodityService;
 use App\Services\common\BatchUpdateService;
 use App\Services\CommodityBarcodeService;
 use App\Services\common\DataHandlerService;
 use App\Services\DepositoryService;
 use App\Services\InventoryAccountMissionService;
-use App\Services\InventoryAccountService;
 use App\Services\InventoryCompareService;
 use App\Services\OracleBasSkuService;
 use App\Services\OracleDocAsnDetailService;

+ 25 - 0
public/css/app.css

@@ -228,6 +228,31 @@ table.table-striped tbody tr:hover.td-yellow {
   background: #fdf3db;
 }
 
+table tr.focusing td,
+table.table-striped tbody tr.focusing td {
+  background: #d5aba1;
+}
+
+table tr.focusing td.td-warm,
+table.table-striped tbody tr.focusing td.td-warm {
+  background: #e7ae80;
+}
+
+table tr.focusing td.td-cool,
+table.table-striped tbody tr.focusing td.td-cool {
+  background: #5f8fcd;
+}
+
+table tr.focusing td.td-helpful,
+table.table-striped tbody tr.focusing td.td-helpful {
+  background: #69cb9c;
+}
+
+table tr.focusing td.td-yellow,
+table.table-striped tbody tr.focusing td.td-yellow {
+  background: #d9c290;
+}
+
 .row-even {
   background-color: rgba(0, 0, 0, 0.05);
 }

+ 2 - 2
public/js/app.js

@@ -83218,8 +83218,8 @@ module.exports = tempTip;
 /*! no static exports found */
 /***/ (function(module, exports, __webpack_require__) {
 
-__webpack_require__(/*! D:\wamp64\www\bswas\resources\js\app.js */"./resources/js/app.js");
-module.exports = __webpack_require__(/*! D:\wamp64\www\bswas\resources\sass\app.scss */"./resources/sass/app.scss");
+__webpack_require__(/*! D:\Demo\bswas\resources\js\app.js */"./resources/js/app.js");
+module.exports = __webpack_require__(/*! D:\Demo\bswas\resources\sass\app.scss */"./resources/sass/app.scss");
 
 
 /***/ }),

+ 3 - 6
resources/js/queryForm/queryForm.js

@@ -45,11 +45,11 @@ const query = function getQueryForm(data) {
                     //     }
                     // }
                     // console.log(map.value);
-                    form.append("<input name='" + key + "' value='" + map.value + "'>")
+                    form.append("<input name='" + key + "' value='" + map.value.replace(" ","%20") + "'>");
                     // form.append("<input name='" + key + "' value='" + encodeURIComponent(map.value) + "'>")
                 } else if ('array' === fetchJsType(map.value)) {
                     let string = map.value.join(',');
-                    form.append("<input  name='" + key + "' value='" + string + "'>")
+                    form.append("<input  name='" + key + "' value='" + string.replace(" ","%20") + "'>");
                     // form.append("<input  name='" + key + "' value='" + encodeURIComponent(string) + "'>")
                 }
             }
@@ -63,7 +63,6 @@ const query = function getQueryForm(data) {
             }
             _hidden_div.html('');
             _hidden_div.append(form);
-            // console.log(form);
             form.submit();
         }
 
@@ -1209,9 +1208,7 @@ const query = function getQueryForm(data) {
     // url path on search form option  renderer
     function searchOptionToUrlsearch() {
         let data = (window.location.search);
-        // let data = decodeURIComponent(window.location.search);
-        data = decodeURIComponent(data);
-        data.replace("\\+","%20");
+        data = decodeURIComponent(data).replace('%20'," ");
         if (!!data) {
             data = (data.substr(1)).split('&');
             data = convertArrayToObj(data);