aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/api/index.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-27 21:37:29 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commit01f1135df1bbf44217124e78850cf1e12911e01e (patch)
tree629ddbfa799c695a9817ee8521d12db69d097526 /vnext/src/api/index.js
parent1662e167d29eec80a48037b3fac7ed5f1bcbe4f7 (diff)
LoginButton refactoring and snapshots
Diffstat (limited to 'vnext/src/api/index.js')
-rw-r--r--vnext/src/api/index.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/vnext/src/api/index.js b/vnext/src/api/index.js
index b190bc48..591f874a 100644
--- a/vnext/src/api/index.js
+++ b/vnext/src/api/index.js
@@ -1,7 +1,9 @@
import axios from 'axios';
+const apiBaseUrl = 'https://api.juick.com';
+
const client = axios.create({
- baseURL: 'https://api.juick.com/'
+ baseURL: apiBaseUrl
});
client.interceptors.request.use(config => {
if (localStorage.visitor) {
@@ -61,4 +63,16 @@ export function comment(mid, rid, body, attach) {
form.append('body', body);
form.append('attach', attach);
return client.post('/comment', form)
+}
+
+function socialLink(network) {
+ return `${apiBaseUrl}/_${network}login?state=${window.location.protocol}//${window.location.host}${window.location.pathname}`;
+}
+
+export function facebookLink() {
+ return socialLink('fb');
+}
+
+export function vkLink() {
+ return socialLink('vk');
} \ No newline at end of file