2019-11-23 01:41:47 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
class TutorialController extends Controller
|
|
|
|
{
|
2019-11-23 13:17:33 +08:00
|
|
|
public function getSubscribeUrl (Request $request) {
|
2019-11-23 01:41:47 +08:00
|
|
|
$user = User::find($request->session()->get('id'));
|
|
|
|
return response([
|
2019-11-23 13:27:38 +08:00
|
|
|
'data' => [
|
|
|
|
'subscribe_url' => config('v2board.app_url', env('APP_URL')) . '/api/v1/client/subscribe?token=' . $user['token']
|
|
|
|
]
|
2019-11-23 01:41:47 +08:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2019-11-23 13:17:33 +08:00
|
|
|
public function getAppleID (Request $request) {
|
2019-11-23 01:43:38 +08:00
|
|
|
$user = User::find($request->session()->get('id'));
|
|
|
|
if ($user->expired_at < time()) {
|
|
|
|
return response([
|
|
|
|
'data' => false
|
2019-11-23 01:44:02 +08:00
|
|
|
]);
|
2019-11-23 01:43:38 +08:00
|
|
|
}
|
|
|
|
return response([
|
|
|
|
'data' => [
|
|
|
|
'apple_id' => config('v2board.apple_id'),
|
|
|
|
'apple_id_password' => config('v2board.apple_id_password')
|
|
|
|
]
|
2019-11-23 01:44:02 +08:00
|
|
|
]);
|
2019-11-23 01:41:47 +08:00
|
|
|
}
|
|
|
|
}
|