区县账号直接登录商户

This commit is contained in:
chenbo 2023-12-09 16:58:00 +08:00
parent b10c7ad25b
commit 2b61ed16f0
2 changed files with 13 additions and 1 deletions

View File

@ -13,7 +13,7 @@ use app\common\repositories\user\UserVisitRepository;
use crmeb\basic\BaseController;
use app\common\repositories\system\merchant\MerchantRepository as repository;
use think\App;
use think\Db;
use think\facade\Db;
use think\exception\ValidateException;
use think\facade\Cache;
@ -152,4 +152,15 @@ class Merchant extends BaseController
return app('json')->success($res);
}
public function merchant()
{
$merId = $this->request->param('mer_id');
$merchant = Db::name('merchant')->where('mer_id', $merId)->find();
$expire = time()+ 3600 * 24;
$token = md5($expire);
// 缓存token
Cache::set($token.'_merchant_'.$merchant['uid'], $expire);
return app('json')->success(compact('merchant', 'token', 'expire'));
}
}

View File

@ -761,6 +761,7 @@ Route::group('api/', function () {
Route::get('merchant_product_ranking', 'Merchant/merchantProductRanking');
Route::get('merchant_product_visit', 'Merchant/merchantProductVisit');
Route::get('merchant_product_cart', 'Merchant/merchantProductCart');
Route::get('merchant', 'Merchant/merchant');
// api.dataview.Finance
Route::get('withdraw_list', 'Finance/withdrawList');