1111
This commit is contained in:
@@ -283,10 +283,20 @@ Route::group('v1/', function () {
|
||||
|
||||
|
||||
|
||||
// 旧版场景获客对外接口(计划级 apiKey,保持兼容)
|
||||
Route::group('v1/api/scenarios', function () {
|
||||
Route::any('', 'app\cunkebao\controller\plan\PostExternalApiV1Controller@index');
|
||||
});
|
||||
|
||||
// 新版开放接口(账号级 apiKey + JWT)
|
||||
// ① 公开:用 apiKey + sign 换取 JWT Token
|
||||
Route::post('v1/open/auth/token', 'app\common\controller\OpenAuthController@getToken');
|
||||
|
||||
// ② 需要 JWT:所有业务接口
|
||||
Route::group('v1/open', function () {
|
||||
Route::post('scenarios', 'app\common\controller\OpenScenariosController@submit'); // 场景获客线索上报
|
||||
})->middleware(['jwt']);
|
||||
|
||||
|
||||
//小程序
|
||||
Route::group('v1/frontend', function () {
|
||||
|
||||
@@ -21,8 +21,8 @@ class PostCreateAddFriendPlanV1Controller extends BaseController
|
||||
*/
|
||||
public function generateApiKey()
|
||||
{
|
||||
// 生成5组随机字符串,每组5个字符
|
||||
$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
// 生成5组随机字符串,每组5个字符(包含大小写字母和数字)
|
||||
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$apiKey = '';
|
||||
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
|
||||
Reference in New Issue
Block a user