This commit is contained in:
molong
2022-11-14 20:34:53 +08:00
parent 5cee9dcfab
commit d02cf12370
18 changed files with 4081 additions and 151 deletions

View File

@@ -24,6 +24,7 @@ class Index extends Base{
if(request()->isAjax()){
return ['code' => 1, 'data' => 'SentOS'];
}else{
$area = \think\facade\Db::name('areas')->select();
return view('/index');
}
}

View File

@@ -14,7 +14,14 @@ use app\services\system\ConfigService;
class Index extends Base{
public function version(){
$this->data['data'] = 'v1.5.0';
$system_info_mysql = \think\facade\Db::query("select version() as v;");
$this->data['data'] = [
['label' => '核心版本', 'values' => \think\facade\Env::get('version')],
['label' => '服务器操作系统', 'values' => PHP_OS],
['label' => '运行环境', 'values' => $_SERVER['SERVER_SOFTWARE']],
['label' => 'MYSQL版本', 'values' => $system_info_mysql[0]['v']],
['label' => '上传限制', 'values' => '10']
];
return $this->data;
}

View File

@@ -1,14 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\model;
class Member extends \think\Model{
protected $connection = 'bestcrm';
}

View File

@@ -9,7 +9,6 @@
namespace app\services\auth;
use app\model\auth\Users;
use app\model\Member;
use app\model\auth\Permissions;
use sent\tree\Tree;
use think\facade\Env;
@@ -33,12 +32,7 @@ class AuthService{
$user = Users::where($map)->field(['uid','username', 'password', 'email', 'avatar', 'department_id', 'status'])->findOrEmpty();
if (!$user->isEmpty()) {
if(!password_verify($params['password'], $user->password)){
$member = Member::where($map)->findOrEmpty();
if (!$member->isEmpty() && $member['password'] === md5($params['password'] . $member['salt'])) {
$user->save(['password'=>password_hash($params['password'], PASSWORD_DEFAULT)]);
}else{
throw new \think\Exception('密码不正确!', 100002);
}
throw new \think\Exception('密码不正确!', 100002);
}
if($user->status != 1){
@@ -46,12 +40,7 @@ class AuthService{
}
return $user->append(['token']);
}else{
$member = Member::where($map)->findOrEmpty();
if(!$member->isEmpty()){
$user = Users::create(['uid' => $member['uid'], 'username' => $member['username'], 'password' => password_hash($params['password'], PASSWORD_DEFAULT), 'nickname' => $member['nickname'], 'email' => $member['email'], 'department_id' => $member['department']]);
}else{
throw new \think\Exception('当前用户不存在', 100001);
}
throw new \think\Exception('当前用户不存在', 100001);
}
}

View File

@@ -40,43 +40,6 @@ return [
// 数据库表前缀
'prefix' => env('database.prefix', ''),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 是否需要断线重连
'break_reconnect' => false,
// 监听SQL
'trigger_sql' => env('app_debug', true),
// 开启字段缓存
'fields_cache' => false,
],
'bestcrm' => [
// 数据库类型
'type' => env('database.type', 'mysql'),
// 服务器地址
'hostname' => env('database.hostname', '127.0.0.1'),
// 数据库名
'database' => 'bestcrm_www',
// 用户名
'username' => 'bestcrm_www',
// 密码
'password' => 'L6XmtaD47rYxMA68',
// 端口
'hostport' => env('database.hostport', '3306'),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => env('database.charset', 'utf8'),
// 数据库表前缀
'prefix' => env('database.prefix', 'sent_'),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
@@ -94,7 +57,5 @@ return [
// 开启字段缓存
'fields_cache' => false,
]
// 更多的数据库配置信息
],
];

View File

@@ -48,7 +48,7 @@ class BaseData extends Migrator
$table = $this->table('system_config', ['engine' => 'InnoDB', 'collation' => 'utf8_general_ci', 'comment' => '系统配置表' ,'id' => 'id' ,'primary_key' => ['id']]);
$table->addColumn('name', 'string', ['limit' => 100,'null' => false,'default' => null,'signed' => true,'comment' => '配置名称',])
->addColumn('title', 'string', ['limit' => 200,'null' => false,'default' => null,'signed' => true,'comment' => '配置标题',])
->addColumn('value', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => false,'signed' => true,'comment' => '配置值',])
->addColumn('value', 'text', ['null' => false,'signed' => true,'comment' => '配置值',])
->addColumn('type', 'string', ['limit' => 100,'null' => false,'default' => null,'signed' => true,'comment' => '表单类型',])
->addColumn('group_name', 'string', ['limit' => 100,'null' => false,'default' => null,'signed' => true,'comment' => '分组',])
->addColumn('remark', 'string', ['limit' => 200,'null' => false,'default' => null,'signed' => true,'comment' => '描述',])

View File

@@ -39,7 +39,7 @@ class UserData extends Migrator
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '创建人ID',])
->addColumn('department_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '部门ID',])
->addColumn('user_type', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '用户类型',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '用户状态 1 正常 2 禁用',])
->addColumn('status', 'integer', ['default' => 1,'signed' => true,'comment' => '用户状态 1 正常 2 禁用',])
->addColumn('last_login_ip', 'string', ['limit' => 50,'null' => false,'default' => 0,'signed' => true,'comment' => '最后登录IP',])
->addColumn('last_login_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '最后登录时间',])
->addColumn('create_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
@@ -53,7 +53,7 @@ class UserData extends Migrator
->addColumn('mobile', 'string', ['limit' => 20,'null' => false,'default' => '','signed' => true,'comment' => '联系电话',])
->addColumn('email', 'string', ['limit' => 100,'null' => false,'default' => '','signed' => true,'comment' => '联系又想',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '创建人ID',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 正常 2 停用',])
->addColumn('status', 'integer', ['default' => 1,'signed' => true,'comment' => '1 正常 2 停用',])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '排序字段',])
->addColumn('create_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('update_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
@@ -64,7 +64,7 @@ class UserData extends Migrator
->addColumn('title', 'string', ['limit' => 100,'null' => false,'default' => '','signed' => true,'comment' => '操作名称',])
->addColumn('method', 'string', ['limit' => 20,'null' => false,'default' => 'POST','signed' => true,'comment' => '操作类型',])
->addColumn('route', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '操作路由',])
->addColumn('params', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => false,'signed' => true,'comment' => '操作参数',])
->addColumn('params', 'text', ['null' => false,'signed' => true,'comment' => '操作参数',])
->addColumn('client_ip', 'string', ['limit' => 100,'null' => false,'default' => '','signed' => true,'comment' => '客户端IP',])
->addColumn('browser', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '浏览器',])
->addColumn('code', 'string', ['limit' => 20,'null' => false,'default' => null,'signed' => true,'comment' => '状态码',])
@@ -76,7 +76,7 @@ class UserData extends Migrator
$table->addColumn('job_name', 'string', ['limit' => 15,'null' => false,'default' => '','signed' => true,'comment' => '岗位名称',])
->addColumn('coding', 'string', ['limit' => 50,'null' => false,'default' => '','signed' => true,'comment' => '编码',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '创建人ID',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 正常 2 停用',])
->addColumn('status', 'integer', ['default' => 1,'signed' => true,'comment' => '1 正常 2 停用',])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '排序字段',])
->addColumn('description', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '描述',])
->addColumn('create_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])

View File

@@ -37,16 +37,16 @@ class UserAuth extends Migrator
->addColumn('type', 'string', ['limit' => 20,'null' => true,'signed' => true,'comment' => '栏目类型',])
->addColumn('icon', 'string', ['limit' => 100,'null' => true,'signed' => true,'comment' => '图标',])
->addColumn('color', 'string', ['limit' => 10,'null' => true,'signed' => true,'comment' => '标题颜色',])
->addColumn('hidden', 'boolean', ['null' => true,'signed' => true,'comment' => '是否隐藏',])
->addColumn('hiddenBreadcrumb', 'boolean', ['null' => true,'signed' => true,'comment' => 'hiddenBreadcrumb',])
->addColumn('affix', 'boolean', ['null' => true,'signed' => true,'comment' => '是否固定',])
->addColumn('fullpage', 'boolean', ['null' => true,'signed' => true,'comment' => '是否全屏',])
->addColumn('hidden', 'integer', ['default' => 0,'signed' => true,'comment' => '是否隐藏'])
->addColumn('hiddenbreadcrumb', 'integer', ['default' => 0,'limit' => MysqlAdapter::INT_REGULAR,'signed' => true,'comment' => '是否隐藏面包屑菜单'])
->addColumn('affix', 'integer', ['default' => 0,'limit' => MysqlAdapter::INT_REGULAR,'comment' => '是否固定',])
->addColumn('fullpage', 'integer', ['default' => 0,'limit' => MysqlAdapter::INT_REGULAR,'comment' => '是否全屏',])
->addColumn('path', 'string', ['limit' => 200,'null' => false,'default' => null,'signed' => true,'comment' => '路径',])
->addColumn('redirect', 'string', ['limit' => 200,'null' => true,'signed' => true,'comment' => '重定向',])
->addColumn('component', 'string', ['limit' => 200,'null' => true,'signed' => true,'comment' => '组件',])
->addColumn('api_list', 'text', ['limit' => MysqlAdapter::TEXT_TINY,'null' => true,'signed' => true,'comment' => 'api接口列表',])
->addColumn('api_list', 'text', ['null' => true,'signed' => true,'comment' => 'api接口列表',])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 1,'signed' => true,'comment' => '排序',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '状态',])
->addColumn('status', 'integer', ['default' => 1,'signed' => true,'comment' => '状态',])
->addColumn('create_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => null,'signed' => true,'comment' => '创建时间',])
->addColumn('update_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => null,'signed' => true,'comment' => '更新时间',])
->create();
@@ -55,7 +55,7 @@ class UserAuth extends Migrator
->addColumn('identify', 'string', ['limit' => 20,'null' => false,'default' => 1,'signed' => true,'comment' => '角色的标识,用英文表示,用于后台路由权限',])
->addColumn('parent_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '父级ID',])
->addColumn('description', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '角色备注',])
->addColumn('data_range', 'boolean', ['null' => false,'default' => 0,'signed' => true,'comment' => '1 全部数据 2 自定义数据 3 仅本人数据 4 部门数据 5 部门及以下数据',])
->addColumn('data_range', 'integer', ['default' => 0,'signed' => true,'comment' => '1 全部数据 2 自定义数据 3 仅本人数据 4 部门数据 5 部门及以下数据',])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '排序',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '创建人ID',])
->addColumn('create_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
<?php
use think\migration\Seeder;
class BaseData extends Seeder
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run(){
$permissions = array(
array('id' => '1','creator_id' => '1','parent_id' => '0','name' => 'systems','title' => '系统','type' => 'menu','icon' => 'el-icon-tools','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/system','redirect' => '','component' => '','api_list' => '[]','sort' => '2','status' => '1','create_time' => '1647866389','update_time' => '1647831105','fullpage' => '0'),
array('id' => '2','creator_id' => '0','parent_id' => '1','name' => 'system','title' => '配置管理','type' => 'menu','icon' => 'el-icon-set-up','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/system/setting','redirect' => '','component' => 'system/setting','api_list' => '[]','sort' => '21','status' => '1','create_time' => '1647866389','update_time' => '1653363608','fullpage' => '0'),
array('id' => '3','creator_id' => '0','parent_id' => '15','name' => 'user','title' => '用户管理','type' => 'menu','icon' => 'el-icon-avatar','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/auth/user','redirect' => '','component' => 'auth/user','api_list' => '[]','sort' => '22','status' => '1','create_time' => '1647866389','update_time' => '1653363713','fullpage' => '0'),
array('id' => '4','creator_id' => '0','parent_id' => '15','name' => 'role','title' => '角色管理','type' => 'menu','icon' => 'el-icon-medal','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/auth/role','redirect' => '','component' => 'auth/role','api_list' => '[]','sort' => '23','status' => '1','create_time' => '1647866389','update_time' => '1653363781','fullpage' => '0'),
array('id' => '5','creator_id' => '0','parent_id' => '1','name' => 'dic','title' => '字典管理','type' => 'menu','icon' => 'el-icon-checked','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/system/dic','redirect' => '','component' => 'system/dic','api_list' => '[]','sort' => '24','status' => '1','create_time' => '1634565766','update_time' => '1653363627','fullpage' => '0'),
array('id' => '6','creator_id' => '0','parent_id' => '15','name' => 'department','title' => '部门管理','type' => 'menu','icon' => 'el-icon-tools','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/auth/department','redirect' => '','component' => 'auth/department','api_list' => '[]','sort' => '25','status' => '1','create_time' => '1647866389','update_time' => '1647830185','fullpage' => '0'),
array('id' => '7','creator_id' => '0','parent_id' => '15','name' => 'settingMenu','title' => '权限管理','type' => 'menu','icon' => 'el-icon-key','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/auth/menu','redirect' => '','component' => 'auth/menu','api_list' => '[]','sort' => '26','status' => '1','create_time' => '1647866389','update_time' => '1653363800','fullpage' => '0'),
array('id' => '8','creator_id' => '0','parent_id' => '1','name' => 'task','title' => '任务管理','type' => 'menu','icon' => 'el-icon-alarm-clock','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/system/task','redirect' => '','component' => 'system/task','api_list' => '[]','sort' => '27','status' => '1','create_time' => '1634565766','update_time' => '1653363635','fullpage' => '0'),
array('id' => '9','creator_id' => '0','parent_id' => '1','name' => 'client','title' => '客户端','type' => 'menu','icon' => 'el-icon-menu','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/system/client','redirect' => '','component' => 'system/client','api_list' => '[]','sort' => '28','status' => '1','create_time' => '1647866389','update_time' => '1653363681','fullpage' => '0'),
array('id' => '10','creator_id' => '0','parent_id' => '1','name' => 'log','title' => '日志管理','type' => 'menu','icon' => 'el-icon-management','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/system/log','redirect' => '','component' => 'system/log','api_list' => '[]','sort' => '29','status' => '1','create_time' => '1647866389','update_time' => '1653363706','fullpage' => '0'),
array('id' => '11','creator_id' => '1','parent_id' => '0','name' => 'home','title' => '首页','type' => 'menu','icon' => 'el-icon-home-filled','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/home','redirect' => '','component' => '','api_list' => '[]','sort' => '0','status' => '1','create_time' => '1647866389','update_time' => '1666057629','fullpage' => '0'),
array('id' => '12','creator_id' => '1','parent_id' => '11','name' => 'dashboard','title' => '仪表盘','type' => 'menu','icon' => 'el-icon-odometer','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '1','path' => '/dashboard','redirect' => '','component' => 'home/index','api_list' => '[]','sort' => '11','status' => '1','create_time' => '1647866389','update_time' => '1653363766','fullpage' => '0'),
array('id' => '14','creator_id' => '1','parent_id' => '11','name' => 'ucenter','title' => '个人设置','type' => 'menu','icon' => 'el-icon-operation','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/usercenter','redirect' => '','component' => 'ucenter','api_list' => '[]','sort' => '12','status' => '1','create_time' => '1647866389','update_time' => '1653363592','fullpage' => '0'),
array('id' => '15','creator_id' => '1','parent_id' => '0','name' => 'auth','title' => '权限','type' => 'menu','icon' => 'el-icon-lock','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/auth','redirect' => NULL,'component' => '','api_list' => '[]','sort' => '3','status' => '1','create_time' => '1647866389','update_time' => '1653363498','fullpage' => '0'),
array('id' => '16','creator_id' => '1','parent_id' => '0','name' => 'customer','title' => '客户','type' => 'menu','icon' => 'el-icon-stamp','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '','redirect' => NULL,'component' => '','api_list' => '[]','sort' => '1','status' => '1','create_time' => '1665135189','update_time' => '1666057618','fullpage' => '0'),
array('id' => '17','creator_id' => '1','parent_id' => '16','name' => 'companyList','title' => '企业数据','type' => 'menu','icon' => 'el-icon-apple','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '/company/list','redirect' => NULL,'component' => 'customer/company/list','api_list' => '[]','sort' => '1','status' => '1','create_time' => '1665135252','update_time' => '1666104518','fullpage' => '0'),
array('id' => '18','creator_id' => '1','parent_id' => '17','name' => 'insertCompany','title' => '导入数据','type' => 'button','icon' => '','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '','redirect' => NULL,'component' => '','api_list' => NULL,'sort' => '1','status' => '1','create_time' => '1666104522','update_time' => '1666104564','fullpage' => '0'),
array('id' => '19','creator_id' => '1','parent_id' => '17','name' => 'addCompany','title' => '添加企业','type' => 'button','icon' => NULL,'color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '','redirect' => NULL,'component' => '','api_list' => '[]','sort' => '1','status' => '1','create_time' => '1666524705','update_time' => '1666524963','fullpage' => '0'),
array('id' => '20','creator_id' => '1','parent_id' => '17','name' => 'deleteCompany','title' => '删除企业','type' => 'button','icon' => '','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '','redirect' => NULL,'component' => '','api_list' => NULL,'sort' => '1','status' => '1','create_time' => '1666524749','update_time' => '1666524825','fullpage' => '0'),
array('id' => '21','creator_id' => '1','parent_id' => '17','name' => 'showDetail','title' => '查看企业详情','type' => 'button','icon' => '','color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '','redirect' => NULL,'component' => '','api_list' => NULL,'sort' => '1','status' => '1','create_time' => '1666524836','update_time' => '1666524855','fullpage' => '0'),
array('id' => '22','creator_id' => '1','parent_id' => '17','name' => 'editCompany','title' => '编辑企业','type' => 'button','icon' => NULL,'color' => NULL,'hidden' => '0','hiddenbreadcrumb' => '0','affix' => '0','path' => '','redirect' => NULL,'component' => '','api_list' => '[]','sort' => '1','status' => '1','create_time' => '1666524859','update_time' => '1666524958','fullpage' => '0'),
array('id' => '23','creator_id' => '1','parent_id' => '16','name' => 'companyDetail','title' => '企业详情','type' => 'm-menu','icon' => 'el-icon-brush-filled','color' => NULL,'hidden' => '1','hiddenbreadcrumb' => '0','affix' => '0','path' => '/company/detail','redirect' => NULL,'component' => 'customer/company/detail','api_list' => '[]','sort' => '0','status' => '1','create_time' => '1666525508','update_time' => '1666579701','fullpage' => '0')
);
$this->table('permissions')->insert($permissions)->save();
}
}

View File

@@ -14,6 +14,9 @@ class Users extends Seeder
*/
public function run()
{
$user = array(
array('username' => 'admin', 'password' => password_hash('admin888', PASSWORD_DEFAULT), 'nickname' => '超级管理员', 'email' => 'admin@admin.com')
);
$this->table('users')->insert($user)->save();
}
}

View File

@@ -12,8 +12,8 @@ const DEFAULT_CONFIG = {
CORE_VER: "1.6.6",
//接口地址
// API_URL: "http://127.0.0.1:8000/",
API_URL: "http://q.dxpd.cn/",
API_URL: "http://127.0.0.1:8000/",
// API_URL: "http://q.dxpd.cn/",
//请求超时
TIMEOUT: 10000,
@@ -58,12 +58,12 @@ const DEFAULT_CONFIG = {
//控制台首页默认布局
DEFAULT_GRID: {
//默认分栏数量和宽度 例如 [24] [18,6] [8,8,8] [6,12,6]
layout: [12, 6, 6],
//小组件分布com取值:views/home/components 文件名
layout: [24, 12, 12],
//小组件分布com取值:pages/home/components 文件名
copmsList: [
['welcome'],
['about', 'ver'],
['time', 'progress']
['about'],
['ver']
]
}
}

76
ui/src/mixin/import.vue Normal file
View File

@@ -0,0 +1,76 @@
<script>
import excel from '@/utils/excel';
export default {
data(){
return {
insert_page: 1
}
},
methods:{
beforeUpload(file){
const fileExt = file.name.split('.').pop().toLocaleLowerCase()
if (fileExt === 'xlsx' || fileExt === 'xls') {
this.readFile(file)
this.file = file
} else {
this.$message.warning('文件:' + file.name + '不是EXCEL文件请选择后缀为.xlsx或者.xls的EXCEL文件。')
}
return false;
},
// 读取文件
readFile(file){
const reader = new FileReader()
reader.readAsArrayBuffer(file)
reader.onloadstart = () => {
this.uploadLoading = true
this.tableLoading = true
this.showProgress = true
}
reader.onprogress = e => {
this.progressPercent = Math.round(e.loaded / e.total * 100)
}
reader.onerror = () => {
this.$message.error('文件读取出错')
}
reader.onload = e => {
this.$message.success('文件读取成功')
const data = e.target.result
const { header, results } = excel.read(data, 'array')
console.log(header);
this.insertData(results)
}
},
insertData(data){console.log(data)
let list = [];
let pagesize = 100;
var length = data.length;
if (this.insert_page > Math.ceil(length / pagesize)) {
this.$message.success('全部导入完成')
// this.action.show = false;
// this.loading = true;
// this.search.page = 1;
this.$refs.table.reload(this.search);
return false;
}else{
for (var i = (pagesize * (this.insert_page - 1)); i < (pagesize * this.insert_page); i++) {
list.push(data[i]);
}
let current = pagesize * (this.insert_page - 1) + 1;
let lastNum = (pagesize * this.insert_page < length) ? (pagesize * this.insert_page) : length;
this.$message.success('正在导入第' + current + '至' + lastNum + '条,请耐心等待导入,当出现“全部导入完成”后关闭窗口!');
this.$API.customer.company.insert.post({data:list})
.then(res => {
if(res.code == 1){
this.insert_page = this.insert_page + 1;
this.$message.success('导入完成当前页!')
this.insertData(data);
}else{
this.$message.success('导入失败,请重新导入!')
}
})
}
}
}
}
</script>

View File

@@ -1,25 +1,28 @@
<template>
<el-card shadow="hover" header="关于项目" class="item-background">
<p>高性能 / 精致 / 优雅基于Vue3 + Element-Plus 的中后台前端解决方案如果喜欢就点个星星支持一下</p>
<p>
<a href='https://gitee.com/lolicode/scui' target="_blank">
<img src='https://gitee.com/lolicode/scui/badge/star.svg?theme=dark' alt='star' style="vertical-align: middle">
</a>
</p>
<el-card shadow="hover" header="关于我们" class="item-background">
<el-descriptions border :column="1">
<el-descriptions-item :label="item.lable" v-for="(item, index) in info" :key="index">{{item.values}}</el-descriptions-item>
</el-descriptions>
</el-card>
</template>
<script>
export default {
title: "关于项目",
icon: "el-icon-setting",
description: "点个星星支持一下",
data() {
return {
}
export default {
title: '关于我们',
icon: "el-icon-setting",
description: "点个星星支持一下",
data() {
return {
info: [
{lable: '总策划', values: '郭平平'},
{lable: '产品设计及研发团队', values: '南昌腾速科技有限公司'},
{lable: '界面及用户体验团队', values: 'https://www.tensent.cn/'},
{lable: '官方网址', values: 'SCUI研发团队'},
{lable: 'BUG反馈', values: 'http://bbs.sentcms.com'},
]
}
}
}
</script>
<style scoped>

View File

@@ -1,14 +1,8 @@
<template>
<el-card shadow="hover" header="版本信息">
<div style="height: 210px;text-align: center;">
<img src="static/images/ver.svg" style="height:140px"/>
<h2 style="margin-top: 15px;">管理系统 {{$CONFIG.CORE_VER}}</h2>
<p style="margin-top: 5px;">最新版本 {{ver}}</p>
</div>
<div style="margin-top: 20px;">
<el-button type="primary" plain round @click="golog">更新日志</el-button>
<el-button type="primary" plain round @click="gogit">gitee</el-button>
</div>
<el-descriptions border :column="1">
<el-descriptions-item :label="item.label" v-for="(item, index) in verInfo" :key="index">{{item.values}}</el-descriptions-item>
</el-descriptions>
</el-card>
</template>
@@ -19,7 +13,7 @@
description: "当前项目版本信息",
data() {
return {
ver: 'loading...'
verInfo: []
}
},
mounted() {
@@ -27,8 +21,8 @@
},
methods: {
async getVer(){
const ver = await this.$API.demo.ver.get()
this.ver = ver.data
const ver = await this.$API.system.version.get()
this.verInfo = ver.data
},
golog(){
// window.open("https://gitee.com/lolicode/scui/releases")

View File

@@ -1,24 +1,10 @@
<template>
<el-card shadow="hover" header="欢迎">
<el-card shadow="never" class="aboutTop">
<div class="welcome">
<div class="logo">
<img src="static/images/logo.png">
<h2>SentOS</h2>
</div>
<div class="tips">
<div class="tips-item">
<div class="tips-item-icon"><el-icon><el-icon-menu/></el-icon></div>
<div class="tips-item-message">这里是项目控制台你可以点击右上方的自定义按钮来添加移除或者移动部件</div>
</div>
<div class="tips-item">
<div class="tips-item-icon"><el-icon><el-icon-promotion/></el-icon></div>
<div class="tips-item-message">在提高前端算力减少带宽请求和代码执行力上多次优化并且持续着</div>
</div>
<div class="tips-item">
<div class="tips-item-icon"><el-icon><el-icon-milk-tea/></el-icon></div>
<div class="tips-item-message">项目目的让前端工作更快乐</div>
</div>
</div>
</div>
</el-card>
</template>
@@ -42,15 +28,16 @@
</script>
<style scoped>
.welcome {}
.welcome .logo {text-align: center;}
.welcome .logo img {vertical-align: bottom;width: 100px;height: 100px;margin-bottom: 20px;}
.welcome .logo h2 {font-size: 30px;font-weight: normal;display: flex;align-items: center;justify-content: center;}
.welcome .logo {text-align: center;}
.welcome .logo img {vertical-align: bottom;width: 100px;height: 100px;margin-bottom: 20px;}
.welcome .logo h2 {font-size: 30px;font-weight: normal;display: flex;align-items: center;justify-content: center;}
.tips {margin-top: 20px;padding:0 40px;}
.tips-item {display: flex;align-items: center;justify-content: center;padding:7.5px 0;}
.tips-item-icon {width: 40px;height:40px;display: flex;align-items: center;justify-content: center;border-radius: 50%;font-size: 18px;margin-right: 20px;color: var(--el-color-primary);background: rgba(180,180,180,0.1);}
.tips-item-message {flex: 1;font-size: 14px;}
.aboutTop {border:0;background: linear-gradient(to right, #8E54E9, #4776E6);color: #fff;}
.aboutTop-info {text-align: center}
.tips {padding:0 40px;}
.tips-item {display: flex;align-items: center;justify-content: center;padding:7.5px 0;}
.tips-item-icon {width: 40px;height:40px;display: flex;align-items: center;justify-content: center;border-radius: 50%;font-size: 18px;margin-right: 20px;color: var(--el-color-primary);background: rgba(180,180,180,0.1);}
.tips-item-message {flex: 1;font-size: 14px;}
.actions {text-align: center;margin: 40px 0 20px 0;}
.actions {text-align: center;margin: 40px 0 20px 0;}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large" @keyup.enter="login">
<el-form-item prop="user">
<el-input v-model="form.user" prefix-icon="el-icon-user" clearable :placeholder="$t('login.userPlaceholder')"></el-input>
</el-form-item>

View File

@@ -1,5 +1,5 @@
<template>
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large" @keyup.enter="login">
<el-form-item prop="phone">
<el-input v-model="form.phone" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.mobilePlaceholder')">
<template #prepend>+86</template>