-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
executable file
·87 lines (78 loc) · 1.84 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
var app = angular.module('chat',['ngFileUpload']);
const {ipcRenderer} = electron;
// app.config(function($routeProvider) {
// $routeProvider
// .when('/login', {
// templateUrl: 'view1.html',
// controller: 'FirstController'
// })
// .when('/view2', {
// templateUrl: 'view2.html',
// controller: 'SecondController'
// })
// .otherwise({
// redirectTo: '/view1'
// });
// });
// var __appurl = "http://localhost:8080/";
var __appurl = 'http://www.atishay.tk/'
//variables for api's
var api = __appurl + "api/";
var phoneNumber = api +'verifyPhoneNumber';
var login = api + 'login';
var signup = api + 'register';
var sendMess = api + 'sendMessage';
var me = api + 'me';
var searchURL = api + 'searchUsers';
// local
// Dev server
// var __appurl = "http://180.151.69.138:2023/"
// var __appurl = 'http://192.168.10.145:5000/'
function checkError(err, status){
if(err && err.message){
return alert(err.message);
}else{
return alert('Please check your internet connection');
}
if(status == 401){
window.location.href = 'login.html';
}
}
function message(message){
return alert(message);
}
function storeId(id){
if(!id){
return;
}
// localStorage.setItem('userId', id);
return;
}
function deleteId(id){
if(!id){
return;
}
// localStorage.removeItem('id');
return;
}
function getId(){
// var userId = localStorage.getItem('id');
return userId;
}
function storeToken(token){
if(!token){
return;
}
// localStorage.setItem('token', token);
return;
}
function deleteToken(token){
if(!token){
return;
}
// localStorage.removeItem('token');
return;
}
function getUser(){
ipcRenderer.send('getUser', {});
}