123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419 |
- <?php
- namespace app\mobile_v_2_1\controller;
- use app\mobile_v_2_1\logic\Cang as Logic;
- use think\Controller;
- use think\Exception;
- use think\Log;
- class Test extends Controller
- {
- //jiaqiancaifu.dahengdian.com/mobile/test/registerSendMobileCode
- public function registerSendMobileCode()
- {
- $curl = curl_init("https://jiaqiancaifu.dahengdian.com/mobile/user/registerSendMobileCode");
- $app = [
- 'mobile'=>'17316900863'
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/register
- public function register()
- {
- $curl = curl_init($this->urlCreate('user/register'));
- $app = [
- 'mobile'=>'17316900863',
- 'mobileCode'=>'6310',
- 'password'=>'111111',
- 'passwordRe'=>'111111'
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/logout
- public function logout()
- {
- $curl = curl_init($this->urlCreate('user/logout'));
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getLoginAd
- public function getLoginAd()
- {
- $curl = curl_init($this->urlCreate('ext/getLoginAd'));
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/loginByPassword
- public function loginByPassword()
- {
- $curl = curl_init($this->urlCreate('user/loginByPassword'));
- $app = [
- 'mobile'=>'17316900863',
- 'password'=>'qissen111111'
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getUserBankList
- public function getUserBankList()
- {
- $curl = curl_init($this->urlCreate('user/getUserBankList'));
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getUserInfo
- public function getUserInfo()
- {
- $curl = curl_init($this->urlCreate('user/getUserInfo'));
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/cang
- public function cang() {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/cang/create");
- $app = [
- 'moneySubject'=>'100.00',
- 'subjectID'=>'44',
- 'hongbaoIDS'=>[155]
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getUserHongbaoList
- public function getUserHongbaoList()
- {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/user/getUserHongbaoList");
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://wxapp.dahengdian.com/mobile_v_2_1/test/getIndexInfo
- public function getIndexInfo()
- {
- $curl = curl_init("http://wxapp.dahengdian.com/mobile_v_2_1/index/getIndexInfo");
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getSubjectList
- public function getSubjectList()
- {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/subject/getSubjectList");
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/contract
- public function contract()
- {
- $app = [
- 'money'=>'100.32',
- 'userBankID'=>13
- ];
- $url = 'http://jiaqiancaifu.dahengdian.com/mobile/h5/contract?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://wxapp.dahengdian.com/mobile_v_2_1/test/cancelUser
- public function cancelUser()
- {
- $app = [
- 'abcd'=>''
- ];
- $url = 'http://wxapp.dahengdian.com/mobile_v_2_1/h5/userCancelUser?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getBankList
- public function getBankList()
- {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/system/getBankList");
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/checkInfo
- public function checkInfo()
- {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/user/checkInfo");
- $app = [
- 'trueName'=>'张奇',
- 'passport'=>'230523198606180810',
- 'mobile'=>'13136180523',
- 'mobileCode'=>'892686',
- 'bankNumber'=>'6217001540014586968',
- 'bankID'=>4
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/checkInfoSendMobileCode
- public function checkInfoSendMobileCode()
- {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/user/checkInfoSendMobileCode");
- $app = [
- 'mobile'=>'13516825311'
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getConfig
- public function getConfig()
- {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/system/getConfig");
- $app = [
- 'mobile'=>'17316800863'
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getUserFinanceList
- public function getUserFinanceList()
- {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/user/getUserFinanceList");
- $app = new \stdClass();
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- return curl_exec($curl);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/userRecharge
- public function userRecharge()
- {
- $app = [
- 'money'=>'100.32',
- 'userBankID'=>13
- ];
- $url = 'http://jiaqiancaifu.dahengdian.com/mobile/h5/userRecharge?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/userDrawcash
- public function userDrawcash()
- {
- $app = [
- 'money'=>'1',
- 'userBankID'=>13
- ];
- $url = 'http://jiaqiancaifu.dahengdian.com/mobile/h5/userDrawcash?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/activeList
- public function activeList()
- {
- $app = [
- 'money'=>'1',
- 'userBankID'=>13
- ];
- $url = 'http://jiaqiancaifu.dahengdian.com/mobile/h5/activeList?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/subjectContent
- public function subjectContent()
- {
- $app = [
- 'subjectID'=>13
- ];
- $url = 'http://jiaqiancaifu.dahengdian.com/mobile/h5/subjectContent?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile_v_2_1/test/regAgreement
- public function regAgreement()
- {
- $app = [
- 'subjectID'=>13
- ];
- $url = 'http://jiaqiancaifu.dahengdian.com/mobile_v_2_1/h5/regAgreement?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/safe
- public function safe()
- {
- $app = [
- 'subjectID'=>13
- ];
- $url = 'http://jiaqiancaifu.dahengdian.com/mobile/h5/safe?track='.$this->dataCreateH5($app);
- $this->redirect($url);
- }
- //http://jiaqiancaifu.dahengdian.com/mobile/test/getSubjectContent
- public function getSubjectContent() {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/subject/getSubjectContent");
- $app = [
- 'subjectID'=>766
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- public function getCangList() {
- $curl = curl_init("http://jiaqiancaifu.dahengdian.com/mobile/cang/getCangList");
- $app = [
- 'status'=>1
- ];
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $this->dataCreate($app));
- curl_setopt($curl, CURLOPT_POST,true);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
- return curl_exec($curl);
- }
- public function urlCreate($apiIcon) {
- return 'http://wxapp.dahengdian.com/mobile_v_2_1/'.$apiIcon;
- }
- public function dataCreateH5($app = []) {
- $data['apiV'] = 'v1';
- $data['osV'] = 'android1.1';
- $data['osType'] = '2';
- $data['appV'] = '1';
- $data['deviceID'] = 'a898723jhjka89789auioajhfa';
- $data['token'] = '0787211ffebcc71c8a4d2f570231b948';
- $data['ip'] = '192.168.1.1';
- $data['channel'] = '123';
- $data['time'] = (int)THINK_START_TIME;
- $appJson = json_encode($app, JSON_UNESCAPED_UNICODE);
- Log::info($appJson);
- $signPre = 'aladfa5a4g46jh4vb44n4e4r4t'.$data['token'].$data['time'].$data['appV'].$data['apiV'].$data['osV'].$data['osType'].$data['deviceID'].$data['ip'].$data['channel'].$appJson;
- Log::info($signPre);
- $data['sign'] = md5($signPre);
- $data['app'] = $app;
- return json_encode($data);
- }
- public function dataCreate($app = []) {
- $data['apiV'] = 'v1';
- $data['osV'] = 'android1.1';
- $data['osType'] = '2';
- $data['appV'] = '1';
- $data['deviceID'] = 'a898723jhjka89789auioajhfa';
- $data['token'] = '0787211ffebcc71c8a4d2f570231b948';
- $data['ip'] = '192.168.1.1';
- $data['channel'] = '123';
- $data['time'] = (int)THINK_START_TIME;
- $data['app'] = $app;
- $appJson = json_encode($data['app'], JSON_UNESCAPED_UNICODE);
- Log::info($appJson);
- $signPre = 'aladfa5a4g46jh4vb44n4e4r4t'.$data['token'].$data['time'].$data['appV'].$data['apiV'].$data['osV'].$data['osType'].$data['deviceID'].$data['ip'].$data['channel'].$appJson;
- Log::info($signPre);
- $data['sign'] = md5($signPre);
- $data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
- return $data;
- }
- public function loginDataCreate($app) {
- $data['apiV'] = 'v1';
- $data['osV'] = 'android1.1';
- $data['osType'] = '2';
- $data['appV'] = '1';
- $data['deviceID'] = 'a898723jhjka89789auioajhfa';
- $data['token'] = '';
- $data['channel'] = '123';
- $data['time'] = (int)THINK_START_TIME;
- $data['app'] = $app;
- $data['ip'] = '192.168.1.1';
- $appJson = json_encode($data['app']);
- Log::info($appJson);
- $signPre = $data['token'].$data['time'].$data['appV'].$data['apiV'].$data['osV'].$data['osType'].$data['deviceID'].$data['ip'].$data['channel'].$appJson;
- Log::info($signPre);
- $data['sign'] = md5($signPre);
- Log::info($data);
- $data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
- }
- }
|