Fix: https url
This commit is contained in:
@@ -12,8 +12,7 @@ void main() {
|
||||
}
|
||||
|
||||
Future<String> getToken(String token, String clientId) async {
|
||||
debugPrint(token);
|
||||
var url = Uri.http('gymlink.freemyip.com:8080', 'api/auth/authorize_client');
|
||||
var url = Uri.https('gymlink.freemyip.com', 'api/auth/authorize_client');
|
||||
try {
|
||||
var response = await http.post(url,
|
||||
body: {'GymKey': token, 'id': clientId}); // Just testing token
|
||||
|
||||
@@ -53,7 +53,7 @@ class _DetailPageState extends State<DetailPage> {
|
||||
|
||||
Future<void> _getItem() async {
|
||||
final Uri url =
|
||||
Uri.http('gymlink.freemyip.com:8080', 'api/product/get/${widget.id}');
|
||||
Uri.https('gymlink.freemyip.com', 'api/product/get/${widget.id}');
|
||||
final response = await http.get(url, headers: {
|
||||
'Authorization': 'Bearer ${context.read<GymLinkProvider>().token}',
|
||||
});
|
||||
|
||||
@@ -10,8 +10,7 @@ Future<List<GymItem>> getItems(BuildContext context,
|
||||
{String searchText = '', String categoryId = ''}) async {
|
||||
final token = context.read<GymLinkProvider>().token;
|
||||
if (token != '') {
|
||||
final Uri url =
|
||||
Uri.http('gymlink.freemyip.com:8080', 'api/product/get-list');
|
||||
final Uri url = Uri.https('gymlink.freemyip.com', 'api/product/get-list');
|
||||
try {
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
@@ -48,7 +47,7 @@ Future<List<GymItem>> getItemsByIds(
|
||||
return [];
|
||||
}
|
||||
final Uri url =
|
||||
Uri.http('gymlink.freemyip.com:8080', 'api/product/get-products');
|
||||
Uri.https('gymlink.freemyip.com', 'api/product/get-products');
|
||||
try {
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
@@ -76,8 +75,8 @@ Future<List<GymItem>> getItemsByIds(
|
||||
Future<List<GymCategory>> getCategories(BuildContext context) async {
|
||||
final token = context.read<GymLinkProvider>().token;
|
||||
if (token != '') {
|
||||
final Uri url = Uri.http(
|
||||
'gymlink.freemyip.com:8080', 'api/category/get-internal-categories');
|
||||
final Uri url = Uri.https(
|
||||
'gymlink.freemyip.com', 'api/category/get-internal-categories');
|
||||
try {
|
||||
final response = await http.get(url, headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
let appState = window._appState;
|
||||
|
||||
function getToken(token) {
|
||||
fetch('http://gymlink.freemyip.com:8080/api/auth/authorize_client', {
|
||||
fetch('https://gymlink.freemyip.com/api/auth/authorize_client', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user