|
|
@@ -15,10 +15,10 @@ class QuestionBankService
|
|
|
public function __construct()
|
|
|
{
|
|
|
// 从配置文件读取base_url
|
|
|
- $this->baseUrl = config('services.question_bank.base_url', env('QUESTION_BANK_API_BASE', 'http://localhost:5015'));
|
|
|
+ $this->baseUrl = config('services.question_bank.base_url', env('QUESTION_BANK_API_BASE', 'http://localhost:5015/api'));
|
|
|
$this->baseUrl = rtrim($this->baseUrl, '/');
|
|
|
|
|
|
- // 如果配置中不包含/api,则添加它
|
|
|
+ // 确保 baseUrl 以 /api 结尾,但不要重复添加
|
|
|
if (!str_ends_with($this->baseUrl, '/api')) {
|
|
|
$this->baseUrl .= '/api';
|
|
|
}
|