Browse Source

H5授权登录

Kirin 2 years ago
parent
commit
96a3beddf3
2 changed files with 5 additions and 2 deletions
  1. 1 1
      app/api/controller/AuthController.php
  2. 4 1
      route/api/route.php

+ 1 - 1
app/api/controller/AuthController.php

@@ -415,6 +415,6 @@ class AuthController
     {
         $token = CacheService::get($key);
         if ($token) return app('json')->success('ok', compact('token'));
-        return app('json')->fail('授权失败');
+        return app('json')->fail('授权');
     }
 }

+ 4 - 1
route/api/route.php

@@ -32,6 +32,9 @@ Route::any('wechat/serve', 'wechat.WechatController/serve');//公众号服务
 Route::any('wechat/notify', 'wechat.WechatController/notify');//公众号支付回调
 Route::any('routine/notify', 'wechat.AuthController/notify');//小程序支付回调
 
+Route::get('h5Key', 'AuthController/h5Key');//授权登录Key
+Route::get('h5Token/:key', 'AuthController/h5Token');//授权登录Token
+
 //管理员订单操作类
 Route::group(function () {
     Route::get('admin/order/statistics', 'admin.StoreOrderController/statistics')->name('adminOrderStatistics');//订单数据统计
@@ -50,7 +53,7 @@ Route::group(function () {
 
 //会员授权接口
 Route::group(function () {
-
+    Route::post('h5Auth/:key', 'AuthController/h5Auth');//小程序支付回调
     Route::get('logout', 'AuthController/logout')->name('logout');// 退出登录
     Route::post('switch_h5', 'AuthController/switch_h5')->name('switch_h5');// 切换账号
     Route::post('binding', 'AuthController/binding_phone')->name('bindingPhone');// 绑定手机号