From 82ba5ca80b917a59f2e69d495f7c4bce74c054e8 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 26 Jan 2022 09:11:43 +0800 Subject: [PATCH] * fix xuan web client, do not append web client related stuff if disabled, and use correct login url. --- .../ext/view/index.xuanxuan.html.hook.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/xuanxuan/module/index/ext/view/index.xuanxuan.html.hook.php b/xuanxuan/module/index/ext/view/index.xuanxuan.html.hook.php index e08e902655..250a95a63d 100644 --- a/xuanxuan/module/index/ext/view/index.xuanxuan.html.hook.php +++ b/xuanxuan/module/index/ext/view/index.xuanxuan.html.hook.php @@ -30,15 +30,19 @@ $(document).on('showapp', function(e, app) loadModel('im'); -$xuanConfig = new stdclass(); -$token = $this->im->userGetAuthToken($this->app->user->id, 'zentaoweb'); -$clientUrl = isset($this->config->webClientUrl) ? $this->config->webClientUrl : 'data/xuanxuan/web/'; +if(isset($this->config->xuanxuan->turnon) && $this->config->xuanxuan->turnon) +{ + $xuanConfig = new stdclass(); + $token = $this->im->userGetAuthToken($this->app->user->id, 'zentaoweb'); + $clientUrl = isset($this->config->webClientUrl) ? $this->config->webClientUrl : 'data/xuanxuan/web/'; + $backendUrl = $this->im->getServer('zentao'); -$xuanConfig->clientUrl = $clientUrl; -$xuanConfig->server = $this->im->getServer('zentao'); -$xuanConfig->account = $this->app->user->account; -$xuanConfig->authKey = $token->token; -$xuanConfig->debug = $this->config->debug; + $xuanConfig->clientUrl = $clientUrl; + $xuanConfig->server = parse_url($backendUrl, PHP_URL_HOST); + $xuanConfig->account = $this->app->user->account; + $xuanConfig->authKey = $token->token; + $xuanConfig->debug = $this->config->debug; +} ?>