xieruidong 2 年之前
父节点
当前提交
bf52469de2

+ 1 - 0
application/admin/controller/Index.php

@@ -52,6 +52,7 @@ class Index extends Backend
         $this->view->assign('fixedmenu', $fixedmenu);
         $this->view->assign('referermenu', $referermenu);
         $this->view->assign('title', __('Home'));
+        $this->view->assign('kf_url', Qiyu::instance()->login($this->admin()));
         return $this->view->fetch();
     }
 

+ 3 - 1
application/admin/view/index/index.html

@@ -52,6 +52,8 @@
 
         <!-- 加载JS脚本 -->
         {include file="common/script" /}
-        <script></script>
+        {notempty name="kf_url"}
+        <script src="{$kf_url}"></script>
+        {/notempty}
     </body>
 </html>

+ 1 - 1
application/common/service/Qiyu.php

@@ -19,7 +19,7 @@ class Qiyu{
 
     public function login(Admin $admin){
         $data=[
-            'staffName'=>$admin['username'],
+            'staffName'=>sprintf('service%d',$admin['id']),
         ];
         $json=$this->post('http://qiyukf.com/openapi/staff/login',$data);
         return $json['result']['sdk_url']??null;