更新租户端网站显示
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user