5、执行以下sql语句创建管理员
-- -- 表的结构 `companys` -- DROP TABLE IF EXISTS `companys`; CREATE TABLE IF NOT EXISTS `companys` ( `company_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '公司id', `company_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '公司名称', `eid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `passport_uid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `company_admin_operator_id` bigint(20) NOT NULL COMMENT '公司管理员id', `created` int(11) NOT NULL, `updated` int(11) DEFAULT NULL, `expiredAt` bigint(20) DEFAULT NULL COMMENT '过期时间', `deleted_at` datetime DEFAULT NULL, `industry` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '所属行业', `is_disabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否禁用', `third_params` json DEFAULT NULL COMMENT '第三方特殊字段存储(DC2Type:json_array)', `salesman_limit` int(11) NOT NULL DEFAULT '20' COMMENT '导购员数量', `is_open_pc_template` int(11) DEFAULT '2' COMMENT '是否开启pc模板 1 开启 2不开启', `pc_domain` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'PC域名', `h5_domain` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'H5域名', `is_open_domain_setting` int(11) DEFAULT '2' COMMENT '是否开启域名配置 1 开启 2不开启', PRIMARY KEY (`company_id`), UNIQUE KEY `idx_passportuid` (`passport_uid`), KEY `idx_pc_domain` (`pc_domain`), KEY `idx_h5_domain` (`h5_domain`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=18 ; -- -- 转存表中的数据 `companys` -- INSERT INTO `companys` (`company_id`, `company_name`, `eid`, `passport_uid`, `company_admin_operator_id`, `created`, `updated`, `expiredAt`, `deleted_at`, `industry`, `is_disabled`, `third_params`, `salesman_limit`, `is_open_pc_template`, `pc_domain`, `h5_domain`, `is_open_domain_setting`) VALUES (1, NULL, '66200701709062', '88200702317791', 1, 1650768579, 1652077874, 1683613874, NULL, NULL, 0, '[]', 20, 2, NULL, NULL, 2); -- -------------------------------------------------------- -- -- 表的结构 `operators` -- DROP TABLE IF EXISTS `operators`; CREATE TABLE IF NOT EXISTS `operators` ( `operator_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '账号id', `mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '手机号', `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `eid` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `passport_uid` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `created` int(11) NOT NULL, `updated` int(11) DEFAULT NULL, `operator_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'admin' COMMENT '操作员类型类型。admin:超级管理员;staff:员工;distributor:店铺管理员;dealer:经销商', `login_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '员工账号名', `company_id` bigint(20) DEFAULT NULL COMMENT '公司id', `distributor_ids` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci COMMENT '员工管理的店铺id集合', `shop_ids` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci COMMENT '员工管理的门店id集合', `lastloginip` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '添加时候的ip', `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '名称', `head_portrait` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci COMMENT '头像', `regionauth_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '区域id', `contact` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '联系人姓名', `split_ledger_info` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '分账信息', `is_disable` int(11) DEFAULT '0' COMMENT '是否禁用 1:是 0:否', `adapay_open_account_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'adapay子商户开户时间', `dealer_parent_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '经销商子账号父级id', `is_dealer_main` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1' COMMENT '是否是经销商主账号 1:是 0:不是', PRIMARY KEY (`operator_id`), UNIQUE KEY `idx_passportuid` (`passport_uid`), KEY `idx_eid` (`eid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; -- -- 转存表中的数据 `operators` -- INSERT INTO `operators` (`operator_id`, `mobile`, `password`, `eid`, `passport_uid`, `created`, `updated`, `operator_type`, `login_name`, `company_id`, `distributor_ids`, `shop_ids`, `lastloginip`, `username`, `head_portrait`, `regionauth_id`, `contact`, `split_ledger_info`, `is_disable`, `adapay_open_account_time`, `dealer_parent_id`, `is_dealer_main`) VALUES (1, 'AAA改成手机号', 'admin88需要修改密码', '66200701709062', '88200702317791', 1650768579, 1650768579, 'admin', NULL, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, '1'), (2, 'BBB改成手机号', 'admin88需要修改密码', '66200701709062', '', 1650768579, 1650768579, 'staff', NULL, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, '1'); -- -------------------------------------------------------- -- -- 表的结构 `resources` -- DROP TABLE IF EXISTS `resources`; CREATE TABLE IF NOT EXISTS `resources` ( `resource_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '资源包id', `resource_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '资源包名称', `company_id` bigint(20) NOT NULL COMMENT '公司id', `eid` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '企业id', `passport_uid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `shop_num` int(11) NOT NULL COMMENT '资源门店数', `left_shop_num` int(11) NOT NULL COMMENT '可用门店数', `source` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '资源来源。demo:开通试用,purchased:购买,gift:赠品', `available_days` int(11) NOT NULL COMMENT '可用天数', `active_at` bigint(20) NOT NULL COMMENT '激活时间', `expired_at` bigint(20) NOT NULL COMMENT '过期时间', `active_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '激活码', `issue_id` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '在线开通工单号', `goods_code` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '商品code', `product_code` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '基础系统code', PRIMARY KEY (`resource_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; -- -- 转存表中的数据 `resources` -- INSERT INTO `resources` (`resource_id`, `resource_name`, `company_id`, `eid`, `passport_uid`, `shop_num`, `left_shop_num`, `source`, `available_days`, `active_at`, `expired_at`, `active_code`, `issue_id`, `goods_code`, `product_code`) VALUES (1, '1店版', 1, '66200701709062', '88200702317791', 1, 1, 'demo', 365, 1650768579, 1683613874, 'VyBWNlI5W21XcgExBDcFOlRrUzgIblllAnVWOQ==', NULL, NULL, NULL), (2, '200店版', 1, '66200701709062', '88200702317791', 200, 200, 'purchased', 365, 1652077874, 1683613874, 'C3xXNwBtX2UJNFQiXUVaUVc2UDwGZwwxUDUGZQNjUDZQZANvB2gOOlNgUj4BdVM6', NULL, NULL, NULL), (3, '1店版', 1, '66221001778930', '88221002387671', 1, 1, 'demo', 15, 1673341427, 1674637427, 'ViFbO1Y9CT8DJgk5BzQHOAE+UzhRN1llUiUHaA==', NULL, NULL, NULL), (4, '1店版', 1, '66221101780516', '88221102389257', 1, 1, 'demo', 15, 1673341450, 1674637450, 'Cn0HZwRvWmwAJQc3UmEGOQE+UzhVM15iUyQGaQ==', NULL, NULL, NULL); -- -- 表的结构 `companys_employee_rel_roles` -- DROP TABLE IF EXISTS `companys_employee_rel_roles`; CREATE TABLE IF NOT EXISTS `companys_employee_rel_roles` ( `company_id` bigint(20) NOT NULL COMMENT '公司id', `role_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT '角色id', `operator_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT '员工id', PRIMARY KEY (`company_id`,`role_id`,`operator_id`), KEY `idx_company_id` (`company_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 转存表中的数据 `companys_employee_rel_roles` -- INSERT INTO `companys_employee_rel_roles` (`company_id`, `role_id`, `operator_id`) VALUES (1, '1', '11'), (1, '1', '2'); -- -------------------------------------------------------- -- -- 表的结构 `companys_roles` -- DROP TABLE IF EXISTS `companys_roles`; CREATE TABLE IF NOT EXISTS `companys_roles` ( `role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色id', `company_id` bigint(20) NOT NULL COMMENT '公司id', `role_name` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT '角色名称', `permission` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '权限,json数据', `created` int(11) NOT NULL, `updated` int(11) DEFAULT NULL, `role_source` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'platform' COMMENT '角色平台来源,platform: 平台角色,distributor:店铺管理角色', PRIMARY KEY (`role_id`), KEY `idx_company_id` (`company_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- 转存表中的数据 `companys_roles` -- INSERT INTO `companys_roles` (`role_id`, `company_id`, `role_name`, `permission`, `created`, `updated`, `role_source`) VALUES (1, 1, '运营', '{"shopmenu_alias_name":["index","goodsphysical","goodscategory","goodsattributes","goodsparams","goodsmaincategory","goodsbrand","itemtags","itemstagupload","rate","brandmaterial","arrivalnotice","tradenormalorders","aftersaleslist","shippingtemplates","normalordersupload","wl-logistics","servicepayment","aftersalesrefundlist","order-Refunderrorlogs","tradeservice","tradeverification","mallreservation","reservationsetting","reservationorder","ordersetting","kdniao","sfbsp","aftersalesreason","tradesetting","memberlist","member-list-view","member-export","member-guide","member-vip-delay","member-add-rights","member-send-coupons","member-send-sms","member-tag","member-modify-phone-number","managecard","managecardorder","whitelistlist","whitelistuploade","pointrule","pointoverview","analysisrights","member-rights-list","member-rights-delay","member-right-transfer","member-rights-export","Managetag","smssend","closeAccount","manageinfomation","mallrecharge","managecustomer","trustlogin","wxapp-template-list","wxapp-template-edit","wxapp-authorized","wxapp-data-analysis","wxapp-editsourcemanagement","wxapp-editcategory","wxapp-custompage","noticemessage","colorstyle","membercentersetting","searchrecommend","cartrecommend","cartremind","salespersonshelfindex","shopwxshop","membermarketing","couponspackage","coupongive","couponsend","pointupvaluation","extrapoint","Registrationactivity","Registrationrecord","ugcindex","ugcflags","ugctags","ugctopic","ugcreview","ugcpoint","ugctpos","wheel","recommendlike","SpecificCrowdDiscount","marketingindex","liveroomlist","marketingspluspricebuy","marketingpackage","limitedtimesale","memberpreference","goodslimit","marketingseckill","marketingsfulldiscount","marketingsfullminus","marketingsfullgift","marketingactivity","groupsindex","marketingbargain","popularizesetting","promotersetting","popularizelist","popularizedata","popularizewithdraw","popularizegoods","taskbrokerage","taskbrokeragecount","financialManageservicepayment","financialFinancialManageAftersalesrefundlist","financialFinancialManageRefunderrorlogs","financialFinancialManageAftersaleslist","financialFinancialManageSalesreportlist","dada","goodsstatistics","orderstatistics","member-statistics","distributordata","selformelementsetting","selformtempsetting","planting","shopscreen_category","bigScreenAd","homeCarousel","searchKeyWords","articlecolumns","basearticle","Articlegeneralcolumns","sharesetting","wxshopsetting","wxaindex","brand","brandmenu","brandfans","brandreply","EChat","meiqia","extminilink","staffleader","merchantstaff","platformstaff","platformstaffroles","adapay_merchant","approveDataPass","applyDataPass","assetpayment","shopexerp","dataAnalysis","regionauth","openapi","workwechat","publicsetting","GoodsShareSetting","certificate","baseexport","datamessage","assetaccountactivation","mallcoologs","operator-logs","mpsgoodslogs","privacylogs","omsqueuelog","shopmenu","openscreenad","agreement"],"version":"1"}', 1675320895, 1675320895, 'platform'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
php artisan doctrine:migrations:migrate
php artisan doctrine:migrations:diff
php artisan doctrine:migrations:migrate
case 'h5app' :
bash api
常见问题
'middleware' => ['dingoguard:h5app', 'api.auth'], 'providers' => 'jwt'
$authInfo = $request->get('auth');
$authInfo = $request->get('auth'); $allParams = $request->all('imei_sn','user_id'); $user_id= $authInfo['user_id']??$allParams['user_id'];
$user_id= $authInfo['user_id'];