Jelajahi Sumber

Wesmiler OTC 提交更新 0729

APPLE 3 tahun lalu
induk
melakukan
8c1f01ddad
1 mengubah file dengan 12 tambahan dan 0 penghapusan
  1. 12 0
      app/Services/Api/AdvertService.php

+ 12 - 0
app/Services/Api/AdvertService.php

@@ -116,6 +116,18 @@ class AdvertService extends BaseService
     public function saveAdvert($userId)
     {
         $params = request()->all();
+        $userInfo = MemberService::make()->getInfo($userId);
+        // 交易密码
+        $tradePassword = isset($params['trade_password']) ? trim($params['trade_password']) : '';
+        $password = isset($userInfo['trade_password']) ? trim($userInfo['trade_password']) : '';
+        if (empty($password)) {
+            return message(2005, false);
+        }
+
+        if (!$tradePassword || get_password($tradePassword . md5($tradePassword . 'otc')) != $password) {
+            return message(2016, false);
+        }
+
         $data = [
             'id'=> isset($params['id'])? $params['id'] : 0,
             'type'=> isset($params['type'])? $params['type'] : 1,