no message

Mix
鹿和sa0ChunLuyu 2 years ago
parent eac0067a0a
commit cad2d15527

@ -142,7 +142,7 @@ class Lu
self::$request->response_data = $data_str; self::$request->response_data = $data_str;
self::$request->save(); self::$request->save();
} }
return $res; return response()->json($res)->setEncodingOptions(JSON_UNESCAPED_UNICODE);
} }
// endregion // endregion
// region echo // region echo

@ -5,30 +5,35 @@ use Illuminate\Support\Str;
class Yo class Yo
{ {
public static function create_echo($id = 0) public static function create_echo($id = 0)
{ {
return Lu::echo(config('code.200.c'), 200, ['id' => $id]); return Lu::echo(config('code.200.c'), 200, ['id' => $id]);
} }
public static function delete_echo($id = 0) public static function delete_echo($id = 0)
{ {
return Lu::echo(config('code.200.d'), 200, ['id' => $id]); return Lu::echo(config('code.200.d'), 200, ['id' => $id]);
} }
public static function update_echo($id = 0) public static function update_echo($id = 0)
{ {
return Lu::echo(config('code.200.u'), 200, ['id' => $id]); return Lu::echo(config('code.200.u'), 200, ['id' => $id]);
} }
public static function error_echo($code, $replace = []) public static function error_echo($code, $replace = [])
{ {
$msg = config("code.{$code}"); $msg = config("code.{$code}");
if (count($replace)) $msg = Str::replaceArray('?', $replace, $msg); if (count($replace)) $msg = Str::replaceArray('?', $replace, $msg);
throw new HttpResponseException(response()->json(Lu::echo($msg, $code))); throw new HttpResponseException(Lu::echo($msg, $code));
} }
public static function echo($data = []) public static function debug($data)
{ {
return Lu::echo(config('code.200.r'), 200, $data); throw new HttpResponseException(Lu::echo('Debug', 100000, $data));
} }
public static function echo($data = [])
{
return Lu::echo(config('code.200.r'), 200, $data);
}
} }

Loading…
Cancel
Save