rabin 3 weeks ago
parent
commit
be5d4869da
50 changed files with 1626 additions and 97 deletions
  1. 89 0
      app/pan/api/Task.php
  2. 5 0
      app/pan/index.php
  3. 362 0
      app/pan/lib/Quark.php
  4. 37 0
      app/pan/table/account.php
  5. 31 0
      app/pan/table/manage/core.php
  6. 61 0
      app/pan/table/manage/user_pan_account.php
  7. 138 0
      app/pan/table/manage/user_pan_task.php
  8. 40 0
      app/pan/table/manage/user_pan_task_data.php
  9. 106 0
      app/pan/table/task.php
  10. 62 0
      app/pan/table/task_data.php
  11. 2 2
      package/manage/index.html
  12. 2 2
      package/manage/sector.html
  13. 1 1
      package/manage/static/css/213.89045697.css
  14. 1 1
      package/manage/static/css/780.4065063c.css
  15. 1 1
      package/manage/static/css/app.d065fbce.css
  16. 0 1
      package/manage/static/css/vab-chunk-c6f52c3a.5bd6db39.css
  17. 1 1
      package/manage/static/css/vab-plugins.f6f5c03c.css
  18. 1 1
      package/manage/static/js/213.6489ce89.js
  19. 1 1
      package/manage/static/js/592.41e25131.js
  20. 1 1
      package/manage/static/js/780.f3d655d2.js
  21. 1 1
      package/manage/static/js/962.faf0c7f7.js
  22. 0 1
      package/manage/static/js/app.42f2829b.js
  23. 1 1
      package/manage/static/js/vab-chunk-0b9a05e8.3a2acba3.js
  24. 1 1
      package/manage/static/js/vab-chunk-54e012b3.75c10119.js
  25. 1 1
      package/manage/static/js/vab-chunk-844ca20f.8fd468cb.js
  26. 1 1
      package/manage/static/js/vab-chunk-b3a4eaa1.509e2c01.js
  27. 0 5
      package/manage/static/js/vab-chunk-c6f52c3a.0f347998.js
  28. 5 0
      package/manage/static/js/vab-chunk-c6f52c3a.9c6f3318.js
  29. 1 1
      package/manage/static/js/vab-plugins.03df181f.js
  30. 4 0
      package/puppeteer/index.php
  31. 28 0
      src/collect/api/Test.php
  32. 11 0
      src/source/lib/Cate.php
  33. 1 1
      src/source/lib/Times.php
  34. 39 0
      src/source/table/cate.php
  35. 9 36
      src/source/table/info.php
  36. 30 13
      src/source/table/manage/core.php
  37. 55 0
      src/source/table/manage/set_zone_task_create.php
  38. 46 0
      src/source/table/manage/source_cate.php
  39. 16 12
      src/source/table/manage/source_info.php
  40. 24 4
      src/source/table/manage/source_zone.php
  41. 38 0
      src/source/table/task_produce.php
  42. 2 7
      src/source/table/zone.php
  43. 30 0
      src/tool/api/App.php
  44. 5 0
      src/tool/index.php
  45. 73 0
      src/tool/lib/User.php
  46. 51 0
      src/tool/table/info.php
  47. 54 0
      src/tool/table/manage/core.php
  48. 67 0
      src/tool/table/manage/tool_list.php
  49. 70 0
      src/tool/table/manage/user_tool_list.php
  50. 20 0
      src/tool/table/user.php

+ 89 - 0
app/pan/api/Task.php

@@ -0,0 +1,89 @@
+<?php namespace Pan\Api;
+use Dever;
+use Dever\Helper\Cmd;
+class Task
+{
+    private $type = array
+    (
+        1 => 'quark',
+    );
+    
+    # 执行任务
+    public function run()
+    {
+        $id = Dever::input('id');
+        $task = Dever::db('task', 'pan')->find(array('id' => $id, 'status' => array('in', '1,3')));
+        if ($task) {
+            $partition = Dever::call("manage/common.system", array(false, false));
+            $partition['id'] = $id;
+            Cmd::run('task.runAct', $partition, 'pan');
+        }
+        return '操作成功,后台程序运行中,请点击右上角刷新页面';
+    }
+
+    public function runAct()
+    {
+        $id = Dever::input('id');
+        $partition = Dever::input();
+        $id = $partition['id'];
+        unset($partition['id']);
+        $task_db = Dever::db('task', 'pan', 'default', $partition);
+        $task = $task_db->find(array('id' => $id));
+        $task_db->update(array('id' => $id), array('status' => 2));
+        $account = Dever::db('account', 'pan', 'default', $partition)->find($task['account_id']);
+        $class = $this->type[$account['type']];
+        Dever::load($class, 'pan')->run($account, $task, $partition);
+        $task_db->update(array('id' => $id), array('status' => 3));
+    }
+
+    # 导入分享
+    public function import()
+    {
+        $id = Dever::input('set')['account_task_id'] ?? false;
+        if ($id) {
+            $task = Dever::db('task', 'pan')->find(array('id' => $id));
+            if ($task) {
+                $partition = Dever::call("manage/common.system", array(false, false));
+                $partition['id'] = $id;
+                Cmd::run('task.importAct', $partition, 'pan');
+            }
+        }
+        
+        return '操作成功,后台程序运行中,请点击右上角刷新页面';
+    }
+
+    public function importAct()
+    {
+        $id = Dever::input('id');
+        $partition = Dever::input();
+        $id = $partition['id'];
+        unset($partition['id']);
+        $task = Dever::db('task', 'pan', 'default', $partition)->find(array('id' => $id));
+        $account = Dever::db('account', 'pan', 'default', $partition)->find($task['account_id']);
+        $class = $this->type[$account['type']];
+        Dever::load($class, 'pan')->import($account, $task, $partition);
+    }
+
+    # 取消分享
+    public function delete()
+    {
+        $id = Dever::input('id');
+        $data = Dever::db('task_data', 'pan')->select(array('id' => array('in', $id)));
+        if ($data) {
+            $share_id = array();
+            $account = array();
+            foreach ($data as $k => $v) {
+                if (!$account) {
+                    $account = Dever::db('account', 'pan')->find($v['account_id']);
+                }
+                $share_id[] = $v['share_id'];
+            }
+            $class = $this->type[$account['type']];
+            $state = Dever::load($class, 'pan')->delete($share_id, $account['cookie']);
+            if ($state) {
+                Dever::db('task_data', 'pan')->delete(array('id' => array('in', $id)));
+            }
+        }
+        return '取消分享成功';
+    }
+}

+ 5 - 0
app/pan/index.php

@@ -0,0 +1,5 @@
+<?php
+define('DEVER_APP_NAME', 'pan');
+define('DEVER_APP_LANG', '网盘');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+include(DEVER_APP_PATH . '../../boot.php');

+ 362 - 0
app/pan/lib/Quark.php

@@ -0,0 +1,362 @@
+<?php namespace Pan\Lib;
+use Dever;
+class Quark
+{
+    private $header;
+    private $partition;
+    public function run($account, $task, $partition)
+    {
+        if ($partition) {
+            $this->partition = $partition;
+        }
+        $this->header($account['cookie']);
+        if ($task['mul'] == 1 && $task['path']) {
+            $this->handle($account, $task);
+        } elseif ($task['file']) {
+            $file = Dever::load('view', 'upload')->local($task['file']);
+            $excel = Dever::load('import', 'excel')->act($file);
+            if ($excel) {
+                foreach ($excel as $k => $v) {
+                    if ($v['A']) {
+                        $task['path'] = trim($v['A']);
+                        $task['code'] = trim($v['B']);
+                        $this->handle($account, $task);
+                    }
+                }
+            }
+        }
+    }
+
+    # 处理
+    private function handle($account, $task)
+    {
+        if (empty($task['code'])) {
+            $task['code'] = '';
+        }
+        $temp = explode("\n", $task['path']);
+        $task['path'] = $temp[0];
+        if (isset($temp[1])) {
+            $task['code'] = $temp[1];
+        }
+        $path = pathinfo($task['path']);
+        if (strstr($path['filename'], '-')) {
+            $path = explode('-', $path['filename']);
+            $path = $path[0];
+        } else {
+            $path = $path['filename'];
+        }
+        
+        if ($task['type'] == 1) {
+            $this->save($path, $account, $task);
+        } elseif ($task['type'] == 2) {
+            $this->share($path, $account, $task);
+        }
+    }
+
+    # 转存
+    private function save($pwd_id, $account, $task, $end = false)
+    {
+        $token = $this->token($pwd_id, $task['code']);
+        if ($token) {
+            $page = 1;
+            $state = true;
+            while($state) {
+                $data = $this->detail($page, $pwd_id, $token);
+                if ($data) {
+                    foreach ($data as $k => $v) {
+                        $task_id = $this->saveFile($task['save_path'], $pwd_id, $token, $v['fid'], $v['share_fid_token'], $v['pdir_fid']);
+                        $check = $this->check($account['id'], $task['id'], $v['fid']);
+                        if (!$check) {
+                            $this->up($account['id'], $task['id'], $pwd_id, $v['fid'], $v['file_name'], $task_id, $task_id, $v);
+                        }
+                    }
+                    $page++;
+                } else {
+                    $state = false;
+                }
+            }
+        }
+    }
+
+    # 分享
+    private function share($path, $account, $task, $end = false)
+    {
+        $page = 1;
+        $state = true;
+        # 该path下是否还有目录,默认没有
+        $result = false;
+        while($state) {
+            # 获取当前目录下的文件列表
+            $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/file/sort?pr=ucpro&fr=pc&uc_param_str=&pdir_fid='.$path.'&_page='.$page.'&_size=50&_fetch_total=1&_fetch_sub_dirs=0&_sort=file_type:asc,updated_at:desc', array(), 'get', false, $this->header)->result();
+            $result = Dever::json_decode($result);
+            if (isset($result['data']['list']) && $result['data']['list']) {
+                $total = count($result['data']['list']);
+                foreach ($result['data']['list'] as $k => $v) {
+                    if ($task['oper_filter']) {
+                        $temp = explode("\n", $task['oper_filter']);
+                        foreach ($temp as $k => $v) {
+                            if (strstr($v['file_name'], $v)) {
+                                continue;
+                            }
+                        }
+                    }
+                    if ($v['file_type'] == 1) {
+                        # 文件
+                        $ext = pathinfo($v['file_name'], PATHINFO_EXTENSION);
+                        if ($task['oper_ext'] && (!strstr($task['oper_ext'], $ext) || !strstr($task['oper_ext'], 'file'))) {
+                            continue;
+                        }
+                        if ($end) {
+                            continue;
+                        }
+                    } else {
+                        $result = true;
+                        # 目录
+                        if ($end) {
+                            continue;
+                        }
+                        if ($task['oper_ext'] && !strstr($task['oper_ext'], 'dir')) {
+                            continue;
+                        }
+                        if ($task['oper'] == 2) {
+                            # 获取所有资源
+                            $this->handle($v['fid'], $account, $task);
+                        } elseif ($task['oper'] == 3) {
+                            # 寻找最后一级资源
+                            $last = $this->handle($v['fid'], $account, $task, true);
+                            if (!$last) {
+                                $this->handle($v['fid'], $account, $task);
+                            }
+                            continue;
+                        }
+                    }
+                    $check = $this->check($account['id'], $task['id'], $v['fid']);
+                    if (!$check) {
+                        $task_id = $this->create($v['fid'], $v['file_name']);
+                        if ($task_id) {
+                            $share_id = $this->task($task_id);
+                            if ($share_id) {
+                                $info = $this->password($share_id);
+                                $this->up($account['id'], $task['id'], $path, $v['fid'], $v['file_name'], $task_id, $share_id, $info, $page, $total, $k+1);
+                            }
+                        }
+                    }
+                }
+                $page++;
+            } else {
+                $state = false;
+            }
+        }
+        return $result;
+    }
+
+    # 导入分享数据
+    public function import($account, $task, $partition)
+    {
+        if ($partition) {
+            $this->partition = $partition;
+        }
+        $this->header($account['cookie']);
+        $page = 1;
+        $state = true;
+        while($state) {
+            $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/share/mypage/detail?pr=ucpro&fr=pc&uc_param_str=&_page='.$page.'&_size=50&_order_field=created_at&_order_type=desc&_fetch_total=1&_fetch_notify_follow=1', array(), 'get', false, $this->header)->result();
+            $result = Dever::json_decode($result);
+            if (isset($result['data']['list']) && $result['data']['list']) {
+                foreach ($result['data']['list'] as $k => $v) {
+                    $check = $this->check($account['id'], $task['id'], $v['first_fid'], $v['share_id']);
+                    if (!$check) {
+                        $this->up($account['id'], $task['id'], 'share', $v['first_fid'], $v['title'], false, $v['share_id'], $v);
+                    }
+                }
+                $page++;
+            } else {
+                $state = false;
+            }
+        }
+    }
+
+    private function header($cookie)
+    {
+        if (!$this->header) {
+            $this->header['accept'] = 'application/json, text/plain, */*';
+            $this->header['content-type'] = 'application/json';
+            $this->header['sec-ch-ua'] = '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"';
+            $this->header['ec-ch-ua-mobile'] = '?0';
+            $this->header['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
+            $this->header['sec-ch-ua-platform'] = '"Windows"';
+            $this->header['origin'] = 'https://pan.quark.cn';
+            $this->header['sec-fetch-site'] = 'same-site';
+            $this->header['sec-fetch-mode'] = 'cors';
+            $this->header['sec-fetch-dest'] = 'empty';
+            $this->header['accept-encoding'] = 'gzip, deflate, br';
+            $this->header['accept-language'] = 'zh-CN,zh;q=0.9';
+            $this->header['referer'] = 'https://pan.quark.cn/';
+            $this->header['cookie'] = $cookie;
+        }
+    }
+
+    # 获取token
+    private function token($pwd_id, $code)
+    {
+        $param = array();
+        $param['pwd_id'] = $pwd_id;
+        $param['passcode'] = $code;
+        $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/share/sharepage/token?pr=ucpro&fr=pc&uc_param_str=&__dt=405&__t=' . Dever::uuid(), $param, 'post', true, $this->header)->result();
+        $result = Dever::json_decode($result);
+        if (isset($result['data']['stoken']) && $result['data']['stoken']) {
+            return $result['data']['stoken'];
+        } else {
+            return false;
+        }
+    }
+
+    # 获取详情
+    private function detail($page, $pwd_id, $token)
+    {
+        $param = array();
+        $param['pwd_id'] = $pwd_id;
+        $param['stoken'] = $token;
+        $param['pdir_fid'] = '0';
+        $param['_page'] = $page;
+        $param['_size'] = 50;
+        $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/share/sharepage/detail', $param, 'get', false, $this->header)->result();
+        $result = Dever::json_decode($result);
+        if (isset($result['data']['list']) && $result['data']['list']) {
+            return $result['data']['list'];
+        } else {
+            return false;
+        }
+    }
+
+    # 开始分享
+    private function create($id, $name)
+    {
+        $param = array();
+        $param['expired_type'] = 1;
+        $param['fid_list'] = array($id);
+        $param['title'] = $name;
+        $param['url_type'] = 1;//2是有提取码,1是无提取码
+        //$param['passcode'] = '';
+        $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/share?pr=ucpro&fr=pc&uc_param_str=', $param, 'post', true, $this->header)->result();
+        $result = Dever::json_decode($result);
+        if (isset($result['data']['task_id']) && $result['data']['task_id']) {
+            return $result['data']['task_id'];
+        } else {
+            return false;
+        }
+    }
+
+    # 保存文件
+    private function saveFile($save_path, $pwd_id, $token, $first_id, $share_fid_token, $to_pdir_fid)
+    {
+        if ($save_path) {
+            $save_path = pathinfo($save_path);
+            $save_path = explode('-', $save_path['filename']);
+            $save_path = $save_path[0];
+        } else {
+            $save_path = '0';
+        }
+        $param['fid_list'] = $first_id;
+        $param['fid_token_list'] = array($share_fid_token);
+        $param['to_pdir_fid'] = $to_pdir_fid;
+        $param['pwd_id'] = $pwd_id;
+        $param['stoken'] = $token;
+        $param['pdir_fid'] = $save_path;
+        $param['scene'] = 'link';
+        $result = Dever::curl('https://drive.quark.cn/1/clouddrive/share/sharepage/save?pr=ucpro&fr=pc&uc_param_str=&__dt=&__t=', $param, 'post', true, $this->header)->result();
+        $result = Dever::json_decode($result);
+        if (isset($result['data']['task_id']) && $result['data']['task_id']) {
+            return $this->task($result['data']['task_id']);
+        } else {
+            return false;
+        }
+    }
+
+    # 启动分享任务
+    private function task($task_id)
+    {
+        $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/task?pr=ucpro&fr=pc&uc_param_str=&task_id='.$task_id.'&retry_index=0', array(), 'get', false, $this->header)->result();
+        $result = Dever::json_decode($result);
+        if (isset($result['data']['share_id']) && $result['data']['share_id']) {
+            return $result['data']['share_id'];
+        } elseif (isset($result['data']['task_id']) && $result['data']['task_id']) {
+            return $result['data']['task_id'];
+        } else {
+            return false;
+        }
+    }
+
+    # 获得分享链接
+    private function password($share_id)
+    {
+        $param['share_id'] = $share_id;
+        $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/share/password?pr=ucpro&fr=pc&uc_param_str=', $param, 'post', true, $this->header)->result();
+        $result = Dever::json_decode($result);
+        if (isset($result['data']['share_url']) && $result['data']['share_url']) {
+            return $result['data'];
+        } else {
+            return false;
+        }
+    }
+
+    # 删除分享
+    public function delete($share_id, $cookie)
+    {
+        $this->header($cookie);
+        $param['share_ids'] = $share_id;
+        $result = Dever::curl('https://drive-pc.quark.cn/1/clouddrive/share/delete?pr=ucpro&fr=pc&uc_param_str=', $param, 'post', true, $this->header)->result();
+        $result = Dever::json_decode($result);
+        if (isset($result['message']) && $result['message'] == 'ok') {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    # 检测数据
+    private function check($account_id, $account_task_id, $fid, $share_id = false)
+    {
+        if ($this->partition) {
+            $db = Dever::db('task_data', 'pan', 'default', $this->partition);
+        } else {
+            $db = Dever::db('task_data', 'pan');
+        }
+        $data['account_id'] = $account_id;
+        $data['account_task_id'] = $account_task_id;
+        $data['fid'] = $fid;
+        if ($share_id) {
+            $data['share_id'] = $share_id;
+        }
+        return $db->find($data);
+    }
+
+    # 保存数据
+    private function up($account_id, $account_task_id, $path, $fid, $file_name, $task_id, $share_id, $info, $page = 1, $total = 1, $num = 1)
+    {
+        if ($this->partition) {
+            $db = Dever::db('task_data', 'pan', 'default', $this->partition);
+        } else {
+            $db = Dever::db('task_data', 'pan');
+        }
+        $data['account_id'] = $account_id;
+        $data['account_task_id'] = $account_task_id;
+        $data['path'] = $path;
+        $data['fid'] = $fid;
+        $data['file_name'] = $file_name;
+        if ($task_id) {
+            $data['task_id'] = $task_id;
+        }
+        $data['share_id'] = $share_id;
+        $data['share_url'] = $info['share_url'];
+        if ($info) {
+            $data['info'] = Dever::json_encode($info);
+        }
+        $db->insert($data);
+        /*
+        $task_data = $db->find(array('share_id' => $data['share_id']));
+        if (!$task_data) {
+            $db->insert($data);
+        }*/
+    }
+}

+ 37 - 0
app/pan/table/account.php

@@ -0,0 +1,37 @@
+<?php
+return array
+(
+    'name' => '网盘账号表',
+    'partition' => 'Dever::call("manage/common.system", array(false, false))',
+    'struct' => array
+    (
+        'name' => array
+        (
+            'name'      => '名称',
+            'type'      => 'varchar(32)',
+        ),
+
+        'uid' => array
+        (
+            'name'      => '用户ID',
+            'type'      => 'int(11)',
+        ),
+
+        'type' => array
+        (
+            'name'      => '类型',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => array
+            (
+                1 => '夸克网盘',
+            ),
+        ),
+
+        'cookie' => array
+        (
+            'name'      => '登录cookie',
+            'type'      => 'text(255)',
+        ),
+    ),
+);

+ 31 - 0
app/pan/table/manage/core.php

@@ -0,0 +1,31 @@
+<?php
+return array
+(
+    'menu' => array
+    (
+        'user_pan_account' => array
+        (
+            'parent'    => 'user_tool_manage',
+            'name'      => '网盘账号',
+            'icon'      => 'airplay-line',
+            'sort'      => '100',
+            'show'      => 3,
+        ),
+        'user_pan_task' => array
+        (
+            'parent'    => 'user_tool_manage',
+            'name'      => '网盘任务',
+            'icon'      => 'airplay-line',
+            'sort'      => '101',
+            'show'      => 3,
+        ),
+        'user_pan_task_data' => array
+        (
+            'parent'    => 'user_tool_manage',
+            'name'      => '网盘任务数据',
+            'icon'      => 'airplay-line',
+            'sort'      => '102',
+            'show'      => 3,
+        ),
+    ),
+);

+ 61 - 0
app/pan/table/manage/user_pan_account.php

@@ -0,0 +1,61 @@
+<?php
+$extend = Dever::load('common', 'manage')->extend();
+$uid = $extend['data_id'];
+return array
+(
+    'source' => 'pan/account',
+    'list' => array
+    (
+        'where' => array('uid' => $uid),
+        'field'      => array
+        (
+            'name',
+            'type',
+            'cdate',
+        ),
+        'button' => array
+        (
+            '新增' => array('fastadd', array('uid' => $uid)),
+        ),
+        'data_button' => array
+        (
+            '编辑' => 'fastedit',
+            '任务' => array('route', array
+            (
+                'path' => 'user_tool_manage/user_pan_task',
+                'param' => array
+                (
+                    'set' => array('account_id' => 'id', 'menu' => 'user_tool_manage/user_tool_list', 'parent' => 'user_tool_manage/user_pan_account'),
+                ),
+            ), 'ChatLineSquare'),
+        ),
+        'search'    => array
+        (
+            'name',
+        ),
+    ),
+    'update' => array
+    (
+        'field'    => array
+        (
+            'uid' => array
+            (
+                'type' => 'hidden',
+            ),
+            'name' => array
+            (
+                'rules' => true,
+            ),
+            'type' => array
+            (
+                'rules' => true,
+            ),
+            'cookie' => array
+            (
+                'type' => 'textarea',
+                'rules' => true,
+                'autosize' => array('minRows' => 10),
+            ),
+        ),
+    ),
+);

+ 138 - 0
app/pan/table/manage/user_pan_task.php

@@ -0,0 +1,138 @@
+<?php
+$extend = Dever::load('common', 'manage')->extend();
+$uid = $extend['data_id'];
+$account_id = Dever::input('set')['account_id'] ?? 0;
+return array
+(
+    'source' => 'pan/task',
+    'list' => array
+    (
+        'where' => array('uid' => $uid),
+        'field'      => array
+        (
+            'name',
+            'type',
+            'status',
+            'cdate',
+        ),
+        'button' => array
+        (
+            '新增' => array('fastadd', array('uid' => $uid, 'account_id' => $account_id)),
+        ),
+        'data_button' => array
+        (
+            '编辑' => 'fastedit',
+            '数据' => array('route', array
+            (
+                'path' => 'user_tool_manage/user_pan_task_data',
+                'param' => array
+                (
+                    'set' => array('account_id' => 'account_id', 'account_task_id' => 'id', 'type' => 'type', 'menu' => 'user_tool_manage/user_tool_list', 'parent' => 'user_tool_manage/user_pan_account.user_tool_manage/user_pan_task', 'parent_param' => array('account_id' => $account_id, 'menu' => 'user_tool_manage/user_tool_list')),
+                ),
+            ), 'ChatLineSquare'),
+            '执行' => array('api', 'pan/task.run', '', 'status=1'),
+            '重新执行' => array('api', 'pan/task.run', '', 'status=3'),
+        ),
+        'search'    => array
+        (
+            'name',
+            'type',
+        ),
+    ),
+    'update' => array
+    (
+        'control' => array
+        (
+            'oper_ext' => array
+            (
+                'type' => 2,
+            ),
+            'oper_filter' => array
+            (
+                'type' => 2,
+            ),
+
+            'path' => array
+            (
+                'mul' => 1,
+            ),
+            'file' => array
+            (
+                'mul' => 2,
+            ),
+
+            'save_path' => array
+            (
+                'type' => 1,
+            ),
+        ),
+        'field'    => array
+        (
+            'uid' => array
+            (
+                'type' => 'hidden',
+            ),
+            'account_id' => array
+            (
+                'type' => 'hidden',
+            ),
+            'name' => array
+            (
+                'rules' => true,
+            ),
+            'type' => array
+            (
+                'type' => 'radio',
+                'rules' => true,
+                'control' => true,
+            ),
+            'mul' => array
+            (
+                'type' => 'radio',
+                'rules' => true,
+                'control' => true,
+            ),
+            'path' => array
+            (
+                'type' => 'textarea',
+                //'rules' => true,
+                'autosize' => array('minRows' => 4),
+                'desc' => '如有提取码,请用换行隔开填写',
+            ),
+            'file' => array
+            (
+                'type' => 'upload',
+                //'rules' => true,
+                'upload' => 4,
+                'yun' => true,
+                'multiple' => false,
+                'tip' => '',
+                'style' => 'list',
+                'desc' => '请上传excel文件,A列为链接,B列为提取码(可为空)',
+            ),
+            'save_path' => array
+            (
+                'type' => 'textarea',
+                'autosize' => array('minRows' => 4),
+                'desc' => '如果为空,就是保存到根目录',
+            ),
+            /*
+            'oper' => array
+            (
+                'rules' => true,
+            ),*/
+            'oper_ext' => array
+            (
+                'type' => 'textarea',
+                'autosize' => array('minRows' => 4),
+                'desc' => '输入要保留的资源后缀,如mp4,多个用换行隔开,目录请输入dir,文件请输入file,不输入则不限制后缀',
+            ),
+            'oper_filter' => array
+            (
+                'type' => 'textarea',
+                'autosize' => array('minRows' => 4),
+                'desc' => '输入后将过滤掉包括该名称的资源,多个用换行隔开',
+            ),
+        ),
+    ),
+);

+ 40 - 0
app/pan/table/manage/user_pan_task_data.php

@@ -0,0 +1,40 @@
+<?php
+$account_task_id = Dever::input('set')['account_task_id'] ?? 0;
+$type = Dever::input('set')['type'] ?? '转存';
+$button = $data_button = array();
+if ($type == '分享') {
+    $button = array
+    (
+        '取消分享' => array('api', 'pan/task.delete'),
+        '导入分享' => array('api', 'pan/task.import'),
+    );
+    $data_button = array
+    (
+        '取消分享' => array('api', 'pan/task.delete'),
+    );
+}
+return array
+(
+    'source' => 'pan/task_data',
+    'list' => array
+    (
+        'where' => array('account_task_id' => $account_task_id),
+        'field'      => array
+        (
+            'file_name',
+            'share_url',
+            'cdate',
+        ),
+        'button' => $button,
+        'data_button' => $data_button,
+        'search'    => array
+        (
+            'file_name',
+            'share_url',
+        ),
+        'export' => array
+        (
+            'out' => '导出',
+        ),
+    ),
+);

+ 106 - 0
app/pan/table/task.php

@@ -0,0 +1,106 @@
+<?php
+return array
+(
+    'name' => '任务表',
+    'partition' => 'Dever::call("manage/common.system", array(false, false))',
+    'struct' => array
+    (
+        'name' => array
+        (
+            'name'      => '名称',
+            'type'      => 'varchar(32)',
+        ),
+
+        'account_id' => array
+        (
+            'name'      => '网盘账号ID',
+            'type'      => 'int(11)',
+        ),
+
+        'uid' => array
+        (
+            'name'      => '用户ID',
+            'type'      => 'int(11)',
+        ),
+
+        'type' => array
+        (
+            'name'      => '类型',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => array
+            (
+                1 => '转存',
+                2 => '分享',
+            ),
+        ),
+
+        'mul' => array
+        (
+            'name'      => '链接类型',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => array
+            (
+                1 => '单链接',
+                2 => '多链接',
+            ),
+        ),
+
+        'oper' => array
+        (
+            'name'      => '资源类型',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => array
+            (
+                1 => '当前链接下资源',
+                //2 => '当前链接下资源及其子目录资源',
+                //3 => '最后一级目录下资源',
+            ),
+        ),
+
+        'oper_ext' => array
+        (
+            'name'      => '保留资源',
+            'type'      => 'varchar(500)',
+        ),
+
+        'oper_filter' => array
+        (
+            'name'      => '过滤资源',
+            'type'      => 'varchar(2000)',
+        ),
+
+        'path' => array
+        (
+            'name'      => '链接',
+            'type'      => 'varchar(5000)',
+        ),
+
+        'file' => array
+        (
+            'name'      => '文件',
+            'type'      => 'varchar(200)',
+        ),
+
+        'save_path' => array
+        (
+            'name'      => '转存路径',
+            'type'      => 'varchar(5000)',
+        ),
+
+        'status' => array
+        (
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => array
+            (
+                1 => '待执行',
+                2 => '进行中',
+                3 => '已完成',
+            ),
+        ),
+    ),
+);

+ 62 - 0
app/pan/table/task_data.php

@@ -0,0 +1,62 @@
+<?php
+return array
+(
+    'name' => '任务数据表',
+    'partition' => 'Dever::call("manage/common.system", array(false, false))',
+    'struct' => array
+    (
+        'account_id' => array
+        (
+            'name'      => '网盘账号ID',
+            'type'      => 'int(11)',
+        ),
+
+        'account_task_id' => array
+        (
+            'name'      => '网盘任务ID',
+            'type'      => 'int(11)',
+        ),
+
+        'path' => array
+        (
+            'name'      => '链接',
+            'type'      => 'varchar(5000)',
+        ),
+
+        'fid' => array
+        (
+            'name'      => '文件id',
+            'type'      => 'varchar(150)',
+        ),
+
+        'file_name' => array
+        (
+            'name'      => '文件名',
+            'type'      => 'varchar(300)',
+        ),
+
+        'task_id' => array
+        (
+            'name'      => '任务id',
+            'type'      => 'varchar(150)',
+        ),
+
+        'share_id' => array
+        (
+            'name'      => '分享id',
+            'type'      => 'varchar(150)',
+        ),
+
+        'share_url' => array
+        (
+            'name'      => '分享链接',
+            'type'      => 'varchar(2000)',
+        ),
+
+        'info' => array
+        (
+            'name'      => '分享信息',
+            'type'      => 'text(255)',
+        ),
+    ),
+);

+ 2 - 2
package/manage/index.html

@@ -1,5 +1,5 @@
-<!doctype html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"/><meta content="IE=edge" http-equiv="X-UA-Compatible"/><meta content="webkit" name="renderer"/><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport"/><link href="favicon.ico" rel="icon"/><title>Dever Manage</title><meta content="Dever,PHP,PHP框架,轻量,微服务,组件化,接口,低代码,后台,自定义后台,开发,快速开发,AI,人工智能,文档,轻应用,应用,时空之翼,神秘城" name="keywords"/><meta content="rabin@shemic.com" name="author"/><link href="static/css/loading.css?random=2024-03-29 18:10:25-shemic" rel="stylesheet"/><script>document.write(
+<!doctype html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"/><meta content="IE=edge" http-equiv="X-UA-Compatible"/><meta content="webkit" name="renderer"/><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport"/><link href="favicon.ico" rel="icon"/><title>Dever Manage</title><meta content="Dever,PHP,PHP框架,轻量,微服务,组件化,接口,低代码,后台,自定义后台,开发,快速开发,AI,人工智能,文档,轻应用,应用,时空之翼,神秘城" name="keywords"/><meta content="rabin@shemic.com" name="author"/><link href="static/css/loading.css?random=2024-04-18 10:27:22-shemic" rel="stylesheet"/><script>document.write(
         "<script type='text/javascript' src='config.js?" +
           Math.random() +
           "'><\/script>"
-      )</script><script defer="defer" src="static/js/app.5bd43b6f.js"></script><script defer="defer" src="static/js/213.a0d0f157.js"></script><link href="static/css/app.d065fbce.css" rel="stylesheet"><link href="static/css/213.89045697.css" rel="stylesheet"></head><body><noscript></noscript><div id="app"><div class="first-loading-wrp"><div class="loading-wrp"><span class="dot dot-spin"><i></i> <i></i> <i></i> <i></i></span></div><h1>Dever Manage</h1></div></div></body></html>
+      )</script><script defer="defer" src="static/js/app.42f2829b.js"></script><script defer="defer" src="static/js/213.6489ce89.js"></script><link href="static/css/app.d065fbce.css" rel="stylesheet"><link href="static/css/213.89045697.css" rel="stylesheet"></head><body><noscript></noscript><div id="app"><div class="first-loading-wrp"><div class="loading-wrp"><span class="dot dot-spin"><i></i> <i></i> <i></i> <i></i></span></div><h1>Dever Manage</h1></div></div></body></html>

+ 2 - 2
package/manage/sector.html

@@ -1,5 +1,5 @@
-<!doctype html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"/><meta content="IE=edge" http-equiv="X-UA-Compatible"/><meta content="webkit" name="renderer"/><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport"/><link href="favicon.ico" rel="icon"/><title>Dever Manage</title><meta content="Dever,PHP,PHP框架,轻量,微服务,组件化,接口,低代码,后台,自定义后台,开发,快速开发,AI,人工智能,文档,轻应用,应用,时空之翼,神秘城" name="keywords"/><meta content="rabin@shemic.com" name="author"/><link href="static/css/loading.css?random=2024-03-29 18:10:25-shemic" rel="stylesheet"/><script>document.write(
+<!doctype html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"/><meta content="IE=edge" http-equiv="X-UA-Compatible"/><meta content="webkit" name="renderer"/><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport"/><link href="favicon.ico" rel="icon"/><title>Dever Manage</title><meta content="Dever,PHP,PHP框架,轻量,微服务,组件化,接口,低代码,后台,自定义后台,开发,快速开发,AI,人工智能,文档,轻应用,应用,时空之翼,神秘城" name="keywords"/><meta content="rabin@shemic.com" name="author"/><link href="static/css/loading.css?random=2024-04-18 10:27:22-shemic" rel="stylesheet"/><script>document.write(
         "<script type='text/javascript' src='sector_config.js?" +
           Math.random() +
           "'><\/script>"
-      )</script><script defer="defer" src="static/js/app.5bd43b6f.js"></script><script defer="defer" src="static/js/213.a0d0f157.js"></script><link href="static/css/app.d065fbce.css" rel="stylesheet"><link href="static/css/213.89045697.css" rel="stylesheet"></head><body><noscript></noscript><div id="app"><div class="first-loading-wrp"><div class="loading-wrp"><span class="dot dot-spin"><i></i> <i></i> <i></i> <i></i></span></div><h1>Dever Manage</h1></div></div></body></html>
+      )</script><script defer="defer" src="static/js/app.42f2829b.js"></script><script defer="defer" src="static/js/213.6489ce89.js"></script><link href="static/css/app.d065fbce.css" rel="stylesheet"><link href="static/css/213.89045697.css" rel="stylesheet"></head><body><noscript></noscript><div id="app"><div class="first-loading-wrp"><div class="loading-wrp"><span class="dot dot-spin"><i></i> <i></i> <i></i> <i></i></span></div><h1>Dever Manage</h1></div></div></body></html>

File diff suppressed because it is too large
+ 1 - 1
package/manage/static/css/213.89045697.css


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/css/780.4065063c.css


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/css/app.d065fbce.css


File diff suppressed because it is too large
+ 0 - 1
package/manage/static/css/vab-chunk-c6f52c3a.5bd6db39.css


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/css/vab-plugins.f6f5c03c.css


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/213.6489ce89.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/592.41e25131.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/780.f3d655d2.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/962.faf0c7f7.js


File diff suppressed because it is too large
+ 0 - 1
package/manage/static/js/app.42f2829b.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/vab-chunk-0b9a05e8.3a2acba3.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/vab-chunk-54e012b3.75c10119.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/vab-chunk-844ca20f.8fd468cb.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/vab-chunk-b3a4eaa1.509e2c01.js


File diff suppressed because it is too large
+ 0 - 5
package/manage/static/js/vab-chunk-c6f52c3a.0f347998.js


File diff suppressed because it is too large
+ 5 - 0
package/manage/static/js/vab-chunk-c6f52c3a.9c6f3318.js


File diff suppressed because it is too large
+ 1 - 1
package/manage/static/js/vab-plugins.03df181f.js


+ 4 - 0
package/puppeteer/index.php

@@ -0,0 +1,4 @@
+<?php
+define('DEVER_PACKAGE',  'puppeteer');
+define('DEVER_APP_SETUP', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+include(dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../boot.php');

File diff suppressed because it is too large
+ 28 - 0
src/collect/api/Test.php


+ 11 - 0
src/source/lib/Cate.php

@@ -0,0 +1,11 @@
+<?php namespace Source\Lib;
+use Dever;
+class Cate
+{
+    # 获取分类列表
+    public function getList()
+    {
+        $data = Dever::db('cate', 'source')->select([]);
+        return $data;
+    }
+}

+ 1 - 1
src/source/lib/Times.php

@@ -2,7 +2,7 @@
 use Dever;
 class Times
 {
-    # 获取分类列表
+    # 获取列表
     public function getList()
     {
         /*

+ 39 - 0
src/source/table/cate.php

@@ -0,0 +1,39 @@
+<?php
+return array
+(
+    'name' => '资源分类表',
+    'partition' => 'Dever::call("manage/common.system")',
+    'struct' => array
+    (
+        'name' => array
+        (
+            'name'      => '分类名称',
+            'type'      => 'varchar(32)',
+        ),
+        'desc' => array
+        (
+            'name'      => '分类描述',
+            'type'      => 'varchar(800)',
+        ),
+        'status' => array
+        (
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => array
+            (
+                1 => '上架',
+                2 => '下架',
+            ),
+        ),
+    ),
+    'default' => array
+    (
+        'field' => 'name,cdate',
+        'value' => array
+        (
+            '"默认分类",' . DEVER_TIME,
+        ),
+        'num' => 1,
+    ),
+);

+ 9 - 36
src/source/table/info.php

@@ -32,6 +32,14 @@ return array
             'default'   => 1,
         ),
 
+        'cate_id' => array
+        (
+            'name'      => '分类',
+            'type'      => 'int(11)',
+            'value'     => 'Dever::call("source/cate.getList")',
+            'default'   => 1,
+        ),
+
         'content'       => array
         (
             'name'      => '内容',
@@ -40,45 +48,10 @@ return array
 
         'sort' => array
         (
-            'name'      => '排序',
+            'name'      => '排序序号',
             'type'      => 'int(11)',
             'default'   => '1',
         ),
-
-        'type' => array
-        (
-            'name'      => '类型',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '文章',
-                2 => '图片',
-                3 => '视频',
-                4 => '音频',
-                5 => '教程',
-                6 => '文件',
-                7 => '短剧',
-                8 => '影视剧',
-                9 => '票务',
-                10 => '攻略',
-                11 => '产品',
-                12 => '账号',
-                13 => '接口',
-            ),
-        ),
-
-        'publish' => array
-        (
-            'name'      => '分发',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '允许',
-                2 => '不允许',
-            ),
-        ),
         
         'status' => array
         (

+ 30 - 13
src/source/table/manage/core.php

@@ -23,7 +23,7 @@ return array
         # 账户相关菜单
         'set_user' => array
         (
-            'name' => '配置',
+            'name' => '资源',
             'icon' => 'settings-line',
             'sort' => '100',
             'module' => 'sector_user',
@@ -65,41 +65,58 @@ return array
         'source_info' => array
         (
             'parent'    => 'set_zone_source',
-            'name'      => '资源列表',
+            'name'      => '资源',
             'icon'      => 'door-open-line',
             'sort'      => '1',
         ),
 
+        'source_cate' => array
+        (
+            'parent'    => 'set_zone_source',
+            'name'      => '分类',
+            'icon'      => 'align-center',
+            'sort'      => '2',
+        ),
+
         'source_times' => array
         (
             'parent'    => 'set_zone_source',
-            'name'      => '时序列表',
+            'name'      => '时序',
             'icon'      => 'apps-line',
-            'sort'      => '2',
+            'sort'      => '3',
         ),
 
-        'set_zone_dispatch' => array
+        'set_zone_task' => array
         (
             'parent'    => 'set_zone',
-            'name'      => '资源调度',
+            'name'      => '资源任务',
             'icon'      => 'anticlockwise-2-line',
             'sort'      => '101',
         ),
 
-        'dispatch_channel' => array
+        'set_zone_task_create' => array
         (
-            'parent'    => 'set_zone_dispatch',
-            'name'      => '渠道管理',
+            'parent'    => 'set_zone_task',
+            'name'      => '生成',
             'icon'      => 'album-line',
             'sort'      => '1',
         ),
 
-        'dispatch_connect' => array
+        'set_zone_task_data' => array
         (
-            'parent'    => 'set_zone_dispatch',
-            'name'      => '通信规则',
-            'icon'      => 'coupon-4-line',
+            'parent'    => 'set_zone_task',
+            'name'      => '素材',
+            'icon'      => 'album-line',
             'sort'      => '2',
+            'show'      => 3,
+        ),
+
+        'set_zone_task_publish' => array
+        (
+            'parent'    => 'set_zone_task',
+            'name'      => '分发',
+            'icon'      => 'coupon-4-line',
+            'sort'      => '3',
         ),
     ),
 );

+ 55 - 0
src/source/table/manage/set_zone_task_create.php

@@ -0,0 +1,55 @@
+<?php
+return array
+(
+    'source' => 'source/task_produce',
+    'list' => array
+    (
+        'field'      => array
+        (
+            'id',
+            'name',
+            'cdate',
+        ),
+        'button' => array
+        (
+            '新增' => array('fastadd'),
+        ),
+        'data_button' => array
+        (
+            '编辑' => 'fastedit',
+        ),
+        'search'    => array
+        (
+            'name',
+        ),
+    ),
+    'update' => array
+    (
+        //'desc' => '原创声明:',
+        'field'    => array
+        (
+            'name' => array
+            (
+                'rules' => true,
+            ),
+            'cate_id' => array
+            (
+                'rules' => true,
+            ),
+            'times_id' => array
+            (
+                'rules' => true,
+            ),
+            'source/task_produce_content' => array
+            (
+                'name' => '内容素材',
+                'where'  => array('produce_id' => 'id'),
+            ),
+            'source/task_produce_file' => array
+            (
+                'name' => '附件素材',
+                'where'  => array('produce_id' => 'id'),
+            ),
+        ),
+    ),
+);

+ 46 - 0
src/source/table/manage/source_cate.php

@@ -0,0 +1,46 @@
+<?php
+/*
+$extend = Dever::load('common', 'manage')->extend();
+$zone_id = $extend['data_id'];
+*/
+return array
+(
+    'source' => 'source/cate',
+    'list' => array
+    (
+        'field'      => array
+        (
+            'id',
+            'name',
+            'status' => array
+            (
+                'type' => 'switch',
+                'show'  => '{status}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ),
+            'cdate',
+        ),
+        'button' => array
+        (
+            '新增' => array('add'),
+        ),
+        'data_button' => array
+        (
+            '编辑' => 'edit',
+        ),
+        'search'    => array
+        (
+            'name',
+            'status',
+        ),
+    ),
+    'update' => array
+    (
+        'field'    => array
+        (
+            'name',
+            'desc' => 'textarea',
+        ),
+    ),
+);

+ 16 - 12
src/source/table/manage/source_info.php

@@ -6,13 +6,16 @@ return array
     (
         'field'      => array
         (
-            'id',
+            'sort' => array
+            (
+                'type' => 'input',
+            ),
             'name' => array
             (
                 //'tip' => false,
             ),
+            'cate_id',
             'times_id',
-            'type',
             'status' => array
             (
                 'type' => 'switch',
@@ -32,40 +35,41 @@ return array
         ),
         'search'    => array
         (
+            'cate_id',
             'times_id',
-            'type',
             'status',
             'name',
         ),
     ),
     'update' => array
     (
+        'tab' => array
+        (
+            '基本信息' => 'name,cate_id,times_id,content',
+            '附件信息' => 'source/info_file',
+        ),
+        //'desc' => '原创声明:',
         'field'    => array
         (
             'name' => array
             (
                 'rules' => true,
             ),
-            'times_id' => array
-            (
-                'rules' => true,
-            ),
-            'type' => array
+            'cate_id' => array
             (
-                'type' => 'select',
                 'rules' => true,
             ),
-            'publish' => array
+            'times_id' => array
             (
-                'type' => 'radio',
                 'rules' => true,
             ),
+            /*
             'info' => array
             (
                 'type' => 'textarea',
                 //'rows' => 4,
                 'autosize' => array('minRows' => 4),
-            ),
+            ),*/
             'content' => array
             (
                 'rules' => true,

+ 24 - 4
src/source/table/manage/source_zone.php

@@ -20,11 +20,11 @@ return array
         ),
         'button' => array
         (
-            '新增' => array('fastadd', array('uid' => $uid)),
+            '新增' => array('add', array('uid' => $uid)),
         ),
         'data_button' => array
         (
-            '编辑' => 'fastedit',
+            '编辑' => 'edit',
         ),
         'search'    => array
         (
@@ -39,8 +39,28 @@ return array
             (
                 'type' => 'hidden',
             ),
-            'name',
-            'status' => 'radio',
+            'name' => array
+            (
+                'rules' => true,
+            ),
+            'logo' => array
+            (
+                'type' => 'upload',
+                'upload' => 1,
+                'yun' => true,
+                'multiple' => false,
+                'tip' => '',
+                'style' => 'pic',
+            ),
+            'content' => array
+            (
+                'type' => 'editor',
+                'editorMenu' => array
+                (
+                    'uploadImage' => 1,
+                    'uploadVideo' => 3,
+                ),
+            ),
         ),
         'check' => 'key',
         'end' => 'manage/system.update?system=sector',

+ 38 - 0
src/source/table/task_produce.php

@@ -0,0 +1,38 @@
+<?php
+return array
+(
+    'name' => '资源生成表',
+    'partition' => 'Dever::call("manage/common.system")',
+    'order' => 'sort asc',
+    'struct' => array
+    (
+        'name' => array
+        (
+            'name'      => '名称',
+            'type'      => 'varchar(32)',
+        ),
+
+        'times_id' => array
+        (
+            'name'      => '时序',
+            'type'      => 'int(11)',
+            'value'     => 'Dever::call("source/times.getList")',
+            'default'   => 1,
+        ),
+
+        'cate_id' => array
+        (
+            'name'      => '分类',
+            'type'      => 'int(11)',
+            'value'     => 'Dever::call("source/cate.getList")',
+            'default'   => 1,
+        ),
+
+        'sort' => array
+        (
+            'name'      => '排序序号',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ),
+    ),
+);

+ 2 - 7
src/source/table/zone.php

@@ -17,17 +17,12 @@ return array
         ),
         'logo' => array
         (
-            'name'      => 'LOGO图片',
-            'type'      => 'varchar(200)',
-        ),
-        'cover' => array
-        (
-            'name'      => '封面图',
+            'name'      => '源区LOGO',
             'type'      => 'varchar(200)',
         ),
         'content' => array
         (
-            'name'      => '内容介绍',
+            'name'      => '源区介绍',
             'type'      => 'text(255)',
         ),
         'status' => array

+ 30 - 0
src/tool/api/App.php

@@ -0,0 +1,30 @@
+<?php namespace Tool\Api;
+use Dever;
+class App
+{
+    # 安装应用
+    public function lock()
+    {
+        $extend = Dever::load('common', 'manage')->extend();
+        $where['uid'] = $extend['data_id'];
+        $where['tool_id'] = Dever::input('id');
+        $info = Dever::db('user', 'tool')->find($where);
+        if (!$info) {
+            Dever::db('user', 'tool')->insert($where);
+        }
+        return '安装成功';
+    }
+
+    # 卸载应用
+    public function unlock()
+    {
+        $extend = Dever::load('common', 'manage')->extend();
+        $where['uid'] = $extend['data_id'];
+        $where['tool_id'] = Dever::input('id');
+        $info = Dever::db('user', 'tool')->find($where);
+        if ($info) {
+            Dever::db('user', 'tool')->delete($where);
+        }
+        return '卸载成功';
+    }
+}

+ 5 - 0
src/tool/index.php

@@ -0,0 +1,5 @@
+<?php
+define('DEVER_APP_NAME', 'tool');
+define('DEVER_APP_LANG', '应用库');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+include(DEVER_APP_PATH . '../../boot.php');

+ 73 - 0
src/tool/lib/User.php

@@ -0,0 +1,73 @@
+<?php namespace Tool\Lib;
+use Dever;
+class User
+{
+    # 获取后台展示需要的数据
+    public function getData($where, $set)
+    {
+        $type = $set['type'];
+        $extend = Dever::load('common', 'manage')->extend();
+        $where['uid'] = $extend['data_id'];
+        $info = Dever::db('user', 'tool')->select($where, $set);
+        $data['head'] = $data['body'] = array();
+        $page = Dever::load('common', 'manage')->page('user_tool_manage/user_tool_list');
+        $data['field'] = $page->setting('field', $data['head']);
+        if ($type == 1 && $info) {
+            foreach ($info as $k => $v) {
+                $tool_info = Dever::db('info', 'tool')->find($v['tool_id']);
+                $body = $tool_info;
+                $button = $page->button('data_button', $body);
+                if ($button) {
+                    $body['button'] = $button;
+                }
+                $data['body'][] = $body;
+            }
+        } elseif ($type == 2) {
+            $not = array();
+            if ($info) {
+                foreach ($info as $k => $v) {
+                    $not[] = $v['tool_id'];
+                }
+                if ($not) {
+                    $where['id'] = array('not in', $not);
+                }
+            }
+            $data['body'] = Dever::db('info', 'tool')->select($where, $set);
+            if ($data['body']) {
+                foreach ($data['body'] as $k => $v) {
+                    $button = $page->button('data_button', $v);
+                    if ($button) {
+                        $data['body'][$k]['button'] = $button;
+                    }
+                }
+            }
+        }
+        
+        return $data;
+    }
+
+    # 获取类型
+    public function getType()
+    {
+        $data = array();
+        $data[] = array
+        (
+            'id' => '1',
+            'name' => '已安装',
+        );
+        $data[] = array
+        (
+            'id' => '2',
+            'name' => '未安装',
+        );
+
+        $result = array();
+        $result[] = array
+        (
+            'id' => 'root',
+            'name' => '类型',
+            'children' => $data,
+        );
+        return $result;
+    }
+}

+ 51 - 0
src/tool/table/info.php

@@ -0,0 +1,51 @@
+<?php
+return array
+(
+    'name' => '应用表',
+    'order' => 'sort asc',
+    'struct' => array
+    (
+        'name' => array
+        (
+            'name'      => '名称',
+            'type'      => 'varchar(32)',
+        ),
+
+        'path' => array
+        (
+            'name'      => '目录',
+            'type'      => 'varchar(32)',
+        ),
+
+        'info' => array
+        (
+            'name'      => '简介',
+            'type'      => 'varchar(800)',
+        ),
+
+        'pic' => array
+        (
+            'name'      => '封面',
+            'type'      => 'varchar(500)',
+        ),
+
+        'sort' => array
+        (
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ),
+        
+        'status' => array
+        (
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => array
+            (
+                1 => '上架',
+                2 => '下架',
+            ),
+        ),
+    ),
+);

+ 54 - 0
src/tool/table/manage/core.php

@@ -0,0 +1,54 @@
+<?php
+return array
+(
+    'menu' => array
+    (
+        # 系统相关菜单
+        'tool' => array
+        (
+            'name' => '应用',
+            'icon' => 'app-store-line',
+            'sort' => '2',
+            'module' => 'platform',
+        ),
+        'tool_manage' => array
+        (
+            'parent' => 'tool',
+            'name' => '应用管理',
+            'icon' => 'archive-drawer-line',
+            'sort' => '1',
+        ),
+        'tool_list' => array
+        (
+            'parent'    => 'tool_manage',
+            'name'      => '应用列表',
+            'icon'      => 'building-4-line',
+            'sort'      => '1',
+        ),
+
+        # 账户相关菜单
+        'user_tool' => array
+        (
+            'name' => '应用',
+            'icon' => 'app-store-line',
+            'sort' => '200',
+            'module' => 'sector_user',
+        ),
+
+        'user_tool_manage' => array
+        (
+            'parent'    => 'user_tool',
+            'name'      => '应用管理',
+            'icon'      => 'archive-drawer-line',
+            'sort'      => '100',
+        ),
+
+        'user_tool_list' => array
+        (
+            'parent'    => 'user_tool_manage',
+            'name'      => '应用列表',
+            'icon'      => 'building-4-line',
+            'sort'      => '1',
+        ),
+    ),
+);

+ 67 - 0
src/tool/table/manage/tool_list.php

@@ -0,0 +1,67 @@
+<?php
+return array
+(
+    'source' => 'tool/info',
+    'list' => array
+    (
+        'field'      => array
+        (
+            'id',
+            'name' => array
+            (
+                //'tip' => false,
+            ),
+            'path',
+            'status' => array
+            (
+                'type' => 'switch',
+                'show'  => '{status}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ),
+            'cdate',
+        ),
+        'button' => array
+        (
+            '新增' => array('add'),
+        ),
+        'data_button' => array
+        (
+            '编辑' => 'edit',
+        ),
+        'search'    => array
+        (
+            'status',
+            'name',
+        ),
+    ),
+    'update' => array
+    (
+        'field'    => array
+        (
+            'name' => array
+            (
+                'rules' => true,
+            ),
+            'path' => array
+            (
+                'rules' => true,
+            ),
+            'info' => array
+            (
+                'type' => 'textarea',
+                'rules' => true,
+                'autosize' => array('minRows' => 4),
+            ),
+            'pic' => array
+            (
+                'type' => 'upload',
+                'upload' => 1,
+                'yun' => true,
+                'multiple' => false,
+                'tip' => '',
+                'style' => 'pic',
+            ),
+        ),
+    ),
+);

+ 70 - 0
src/tool/table/manage/user_tool_list.php

@@ -0,0 +1,70 @@
+<?php
+$type = Dever::input('search')['type'] ?? 1;
+if ($type == 1) {
+    $data_button = array
+    (
+        //'访问' => array('route', 'user_tool_manage/user_pan_account', 'ChatLineSquare'),
+        '访问' => array('route', array
+        (
+            'path' => 'user_tool_manage/user_pan_account',
+            'param' => array
+            (
+                'set' => array('menu' => 'user_tool_manage/user_tool_list'),
+            ),
+        ), 'ChatLineSquare'),
+        '卸载' => array('api', 'tool/app.unlock', 'Unlock'),
+    );
+} else {
+    $data_button = array
+    (
+        '安装' => array('api', 'tool/app.lock', 'Lock'),
+    );
+}
+return array
+(
+    'list' => array
+    (
+        'data' => 'tool/user.getData', 
+        'where' => array('status' => 1),
+        'set' => array('type' => $type),
+        'type' => 'pic',
+        'layout' => array
+        (
+            'id' => 'name',
+            'image' => 'pic',
+        ),
+        # 展示左侧分栏
+        'column' => array
+        (
+            'key' => 'id',
+            'data' => 'tool/user.getType',
+            'active' => 1,
+            'where' => 'type',
+        ),
+        'field'      => array
+        (
+            'id',
+            'name',
+            'pic',
+            'cdate',
+        ),
+        'button' => array
+        (
+            
+        ),
+        'data_button' => $data_button,
+        'search'    => array
+        (
+            'name' => array
+            (
+                'name' => '应用名称',
+            ),
+            'type' => array
+            (
+                'name' => '类型',
+                'type' => 'hidden',
+                'value' => $type,
+            ),
+        ),
+    ),
+);

+ 20 - 0
src/tool/table/user.php

@@ -0,0 +1,20 @@
+<?php
+return array
+(
+    'name' => '账户应用',
+    'partition' => 'Dever::call("manage/common.system", array(false, false))',
+    'struct' => array
+    (
+        'uid' => array
+        (
+            'name'      => '用户ID',
+            'type'      => 'int(11)',
+        ),
+
+        'tool_id' => array
+        (
+            'name'      => '应用id',
+            'type'      => 'int(11)',
+        ),
+    ),
+);

Some files were not shown because too many files changed in this diff