thrown in /home/wwwtp6/config/define.php on line 8
PHP Fatal error: Uncaught think\exception\ErrorException: Constant API_SUCCESS already defined in /home/wwwtp6/config/define.php:8
Stack trace:
#0 [internal function]: think\initializer\Error->appError(8, 'Constant API_SU...', '/home/wwwtp6/co...', 8, Array)
#1 /home/wwwtp6/config/define.php(8): define('API_SUCCESS', 1000)
#2 /home/wwwtp6/vendor/topthink/fr
#3 /home/wwwtp6/vendor/topthink/fr
#4 /home/wwwtp6/vendor/topthink/fr
#5 /home/wwwtp6/vendor/topthink/fr
#6 /home/wwwtp6/vendor/topthink/think-swoole/src/Swoole.php(180): think\App->initialize()
#7 /home/wwwtp6/vendor/topthink/think-swoole/src/Swoole.php(168): think\swoole\Swoole->prepareApplication()
#8 {main}
define.php 代码
<?php
/**
* 一些公用的常量
*/
use think\facade\Env;
//---Logic和service、api的return码--
define('API_SUCCESS', 1000); //成功
define('API_ERROR', 1001); //失败
define('API_LOCATION', 1002); //跳转
define('API_UNAUTHORIZED', 401); //未登录或者登录超时
?>
把define删了就可以正常启动,但是有这块代码就会报错
最佳答案