作者 lyh

gx

@@ -138,6 +138,11 @@ class LoginController extends BaseController @@ -138,6 +138,11 @@ class LoginController extends BaseController
138 * @time :2023/6/28 16:13 138 * @time :2023/6/28 16:13
139 */ 139 */
140 public function stringTranslation(){ 140 public function stringTranslation(){
  141 + $this->request->validate([
  142 + 'str'=>'required',
  143 + ],[
  144 + 'str.required' => '翻译字符串不能为空',
  145 + ]);
141 $str = Translate::tran($this->param['str'], 'en'); 146 $str = Translate::tran($this->param['str'], 'en');
142 $this->response('success',Code::SUCCESS,strtolower($str)); 147 $this->response('success',Code::SUCCESS,strtolower($str));
143 } 148 }