刚安装完,登录后台登录不能显示验证码
部署

如图所示:

已开启调试模式,接口返回内容如下:

{"code":0,"message":"Malformed UTF-8 characters, possibly incorrectly encoded","traces":[{"name":"InvalidArgumentException","file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/framework\/src\/think\/response\/Json.php","line":50,"code":0,"message":"Malformed UTF-8 characters, possibly incorrectly encoded","trace":[{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/framework\/src\/think\/Response.php","line":389,"function":"output","class":"think\\response\\Json","type":"->","args":[false]},{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/think-trace\/src\/TraceDebug.php","line":75,"function":"getContent","class":"think\\Response","type":"->","args":[]},{"function":"handle","class":"think\\trace\\TraceDebug","type":"->","args":[{},{}]},{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/framework\/src\/think\/Middleware.php","line":134,"function":"call_user_func","args":[[{},"handle"],{},{}]},{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/framework\/src\/think\/Pipeline.php","line":85,"function":"think\\{closure}","class":"think\\Middleware","type":"->","args":[{},{}]},{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/framework\/src\/think\/Pipeline.php","line":66,"function":"think\\{closure}","class":"think\\Pipeline","type":"->","args":[{}]},{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/framework\/src\/think\/Http.php","line":197,"function":"then","class":"think\\Pipeline","type":"->","args":[{}]},{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/vendor\/topthink\/framework\/src\/think\/Http.php","line":162,"function":"runWithRequest","class":"think\\Http","type":"->","args":[{}]},{"file":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/public\/index.php","line":56,"function":"run","class":"think\\Http","type":"->","args":[]}],"source":{"first":41,"source":["     * @throws \\Exception\n","     *\/\n","    protected function output($data): string\n","    {\n","        try {\n","            \/\/ 返回JSON数据格式到客户端 包含状态信息\n","            $data = json_encode($data, $this->options['json_encode_param']);\n","\n","            if (false === $data) {\n","                throw new \\InvalidArgumentException(json_last_error_msg());\n","            }\n","\n","            return $data;\n","        } catch (\\Exception $e) {\n","            if ($e->getPrevious()) {\n","                throw $e->getPrevious();\n","            }\n","            throw $e;\n","        }\n"]}}],"datas":[],"tables":{"GET Data":{"id":"605f6fca-d157-4149-9d96-e8668dae171c"},"POST Data":[],"Files":null,"Cookies":[],"Session":[],"Server\/Request Data":{"DOCUMENT_ROOT":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/public","REMOTE_ADDR":"127.0.0.1","REMOTE_PORT":"43234","SERVER_SOFTWARE":"PHP\/8.3.4 (Development Server)","SERVER_PROTOCOL":"HTTP\/1.1","SERVER_NAME":"0.0.0.0","SERVER_PORT":"8000","REQUEST_URI":"\/api\/common\/clickCaptcha?id=605f6fca-d157-4149-9d96-e8668dae171c","REQUEST_METHOD":"GET","SCRIPT_NAME":"\/index.php","SCRIPT_FILENAME":"\/data\/data\/com.termux\/files\/home\/yiis\/bm\/public\/index.php","PATH_INFO":"\/api\/common\/clickCaptcha","PHP_SELF":"\/index.php\/api\/common\/clickCaptcha","QUERY_STRING":"id=605f6fca-d157-4149-9d96-e8668dae171c","HTTP_HOST":"localhost:8000","HTTP_CONNECTION":"keep-alive","HTTP_SEC_CH_UA":"\"Android WebView\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\"","HTTP_ACCEPT":"application\/json, text\/plain, *\/*","HTTP_THINK_LANG":"zh-cn","HTTP_SERVER":"true","HTTP_SEC_CH_UA_MOBILE":"?1","HTTP_USER_AGENT":"Mozilla\/5.0 (Linux; Android 12; M2101K9C Build\/SKQ1.211006.001) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/123.0.6312.3 Mobile Safari\/537.36","HTTP_SEC_CH_UA_PLATFORM":"\"Android\"","HTTP_SEC_FETCH_SITE":"same-origin","HTTP_SEC_FETCH_MODE":"cors","HTTP_SEC_FETCH_DEST":"empty","HTTP_REFERER":"http:\/\/localhost:8000\/index.html\/","HTTP_ACCEPT_ENCODING":"gzip, deflate, br, zstd","HTTP_ACCEPT_LANGUAGE":"zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7","REQUEST_TIME_FLOAT":1712280023.43586,"REQUEST_TIME":1712280023,"argv":["id=605f6fca-d157-4149-9d96-e8668dae171c"],"argc":1}}}

已检查数据库字符集都是utf8mb4

已自查没有安装在中文目录下。

请问该如何解决?

已采纳
genouka
genouka
这家伙很懒,什么也没写~
5月前

自己解决了。termux的php带的gd不支持png和jpeg,直接在config/buildadmin.php里把验证码关了就行了

0个回答默认排序 投票数排序
没有更多回答了~
请先登录
0
1
0
1