Browse Source

标识更新

master
torsenli 3 years ago
parent
commit
9a2750819c
  1. 2
      app/Common/functions.php
  2. 2
      app/Http/Controllers/Api/V1/UdunWalletController.php
  3. 10
      app/Services/CoinService.php
  4. 4
      app/Services/UdunWalletService.php
  5. 2
      app/Services/UserWalletService.php
  6. 8
      resources/views/admin/kline.blade.php

2
app/Common/functions.php

@ -1154,7 +1154,7 @@ function sendEmailCode($email, $scene = 'verify_code')
// } // }
$code = getCode(); $code = getCode();
Mail::send('emails.verify_code', ['code' => $code], function ($message) use (&$email) { Mail::send('emails.verify_code', ['code' => $code], function ($message) use (&$email) {
$message->to($email, 'CXICoin')->subject('CXICoin'); $message->to($email, 'NVRCoin')->subject('NVRCoin');
}); //dd(Mail::failures()); }); //dd(Mail::failures());
if (Mail::failures()) { if (Mail::failures()) {
return '发送失败'; return '发送失败';

2
app/Http/Controllers/Api/V1/UdunWalletController.php

@ -30,7 +30,7 @@ class UdunWalletController extends ApiController
} }
// 先验签 // 先验签
$sign = md5($res['body'] . config('coin.api_key', '8efc3adbb26ffcad20bc6a0915bd7219') . $res['nonce'] . $res['timestamp']); $sign = md5($res['body'] . config('coin.api_key', '399f1b34c5f3cfa508b8951f5acb694c') . $res['nonce'] . $res['timestamp']);
if ($res['sign'] != $sign) { if ($res['sign'] != $sign) {
info('=====优盾钱包回调通知验签失败2======', $res); info('=====优盾钱包回调通知验签失败2======', $res);
} }

10
app/Services/CoinService.php

@ -92,7 +92,7 @@ class CoinService
*/ */
public function createAddress($wallet, $coin_name, $addressType = null) public function createAddress($wallet, $coin_name, $addressType = null)
{ {
$map = [ $map = [
'BTC' => 0, 'BTC' => 0,
'ETH' => 60, 'ETH' => 60,
@ -104,11 +104,11 @@ class CoinService
// dd($map,$coin_name); // dd($map,$coin_name);
$coinType = $map[$coin_name] ?? null; $coinType = $map[$coin_name] ?? null;
if (blank($coinType)) return; if (blank($coinType)) return;
// info($coinType);
if (blank($addressType)) { if (blank($addressType)) {
// dd('22221'); // dd('22221');
$res = (new UdunWalletService())->createAddress($coinType); $res = (new UdunWalletService())->createAddress($coinType);
info($res); // info($res);
if ($res['code'] == 200) { if ($res['code'] == 200) {
$address = $res['data']['address']; $address = $res['data']['address'];
$wallet->update(['wallet_address' => $address]); $wallet->update(['wallet_address' => $address]);
@ -124,9 +124,9 @@ class CoinService
$account = UserWallet::query()->where(['user_id' => $wallet['user_id'], 'coin_name' => 'TRX'])->first(); $account = UserWallet::query()->where(['user_id' => $wallet['user_id'], 'coin_name' => 'TRX'])->first();
$field = 'trx_wallet_address'; $field = 'trx_wallet_address';
} }
if (empty($account['wallet_address'])) { if (empty($account['wallet_address'])) {
$res = (new UdunWalletService())->createAddress($coinType); $res = (new UdunWalletService())->createAddress($coinType);
if ($res['code'] == 200) { if ($res['code'] == 200) {
$address = $res['data']['address']; $address = $res['data']['address'];

4
app/Services/UdunWalletService.php

@ -53,7 +53,7 @@ class UdunWalletService
// 回调 // 回调
//$callUrl = config('app.url') . '/api/udun/notify'; //$callUrl = config('app.url') . '/api/udun/notify';
// $callUrl = env('NOTIFY_URL') . '/api/udun/notify'; // $callUrl = env('NOTIFY_URL') . '/api/udun/notify';
$callUrl = 'https://sses.cxicoin.com/api/udun/notify'; $callUrl = 'https://mgsc.nvrcoin.com/api/udun/notify';
$body = array( $body = array(
'merchantId' => $this->merchantId, 'merchantId' => $this->merchantId,
@ -79,7 +79,7 @@ class UdunWalletService
); );
$data_string = json_encode($data); $data_string = json_encode($data);
// var_dump($url);
return json_decode($this->http_post($url, $data_string), true); return json_decode($this->http_post($url, $data_string), true);
} }

2
app/Services/UserWalletService.php

@ -490,10 +490,10 @@ class UserWalletService
$wallet = []; $wallet = [];
if ($coin_id == 1) { if ($coin_id == 1) {
$user_wallet = UserWallet::query()->where(['user_id' => $user_id, 'coin_id' => $coin_id])->firstOrFail(); $user_wallet = UserWallet::query()->where(['user_id' => $user_id, 'coin_id' => $coin_id])->firstOrFail();
// dd($user_wallet);
if ($address_type == 1) { if ($address_type == 1) {
$wallet['address'] = $user_wallet['omni_wallet_address']; $wallet['address'] = $user_wallet['omni_wallet_address'];
} elseif ($address_type == 2) { } elseif ($address_type == 2) {
$wallet['address'] = $user_wallet['wallet_address']; $wallet['address'] = $user_wallet['wallet_address'];
} else { } else {
$wallet['address'] = $user_wallet['trx_wallet_address']; $wallet['address'] = $user_wallet['trx_wallet_address'];

8
resources/views/admin/kline.blade.php

@ -7,10 +7,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>风控</title> <title>风控</title>
<link href="../vendors/dcat-admin/adminlte/index.min.css" rel="stylesheet"> <link href="../vendors/dcat-admin/adminlte/index.min.css" rel="stylesheet">
<script src="https://sses.cxicoin.com/vendors/dcat-admin/adminlte/echarts.min.js"></script> <script src="../vendors/dcat-admin/adminlte/echarts.min.js"></script>
<script src="https://sses.cxicoin.com/vendors/dcat-admin/adminlte/vue.min.js"></script> <script src="..//vendors/dcat-admin/adminlte/vue.min.js"></script>
<script src="https://sses.cxicoin.com/vendors/dcat-admin/adminlte/index.js"></script> <script src="..//vendors/dcat-admin/adminlte/index.js"></script>
<script src="https://sses.cxicoin.com/vendors/dcat-admin/adminlte/axios.min.js"></script> <script src="..//vendors/dcat-admin/adminlte/axios.min.js"></script>
<style> <style>
body { body {
background: #4CA1AF; background: #4CA1AF;

Loading…
Cancel
Save