更新租户端网站显示

This commit is contained in:
2026-03-10 18:05:10 +08:00
parent c00229f2ee
commit 7cdb591f69
5 changed files with 167 additions and 56 deletions
@@ -16,8 +16,9 @@ class ThemeController extends BaseController
{
private ThemeService $themeService;
public function __construct()
public function __construct(\think\App $app)
{
parent::__construct($app);
$this->themeService = new ThemeService();
}
@@ -50,9 +51,17 @@ class ThemeController extends BaseController
*/
public function switch()
{
$tid = Request::post('tid', 0, 'int');
// 从当前登录用户获取tid,而不是从前端参数
$tid = $this->getTenantId();
$themeKey = Request::post('theme_key', '');
if (empty($tid) || $tid == 0) {
return json([
'code' => 401,
'msg' => '未获取到租户ID,请重新登录'
]);
}
if (empty($themeKey)) {
return json([
'code' => 400,