fix page verify registration

This commit is contained in:
Paolo Arena
2019-03-13 18:11:26 +01:00
parent 313963d14b
commit 1be96c06dd
11 changed files with 113 additions and 108 deletions

View File

@@ -39,10 +39,10 @@ export const removeAuthHeaders = () => {
delete axiosInstance.defaults.headers.Authorization
}
async function Request(type: string, path: string, payload: any, setAuthToken?: boolean): Promise<Types.AxiosSuccess | Types.AxiosError> {
async function Request(type: string, path: string, payload: any): Promise<Types.AxiosSuccess | Types.AxiosError> {
let ricevuto = false
try {
// console.log(`Axios Request [${type}]:`, axiosInstance.defaults)
console.log(`Axios Request [${type}]:`, axiosInstance.defaults, 'path:', path)
let response: AxiosResponse
if (type === 'post' || type === 'put' || type === 'patch') {
response = await axiosInstance[type](path, payload, {
@@ -52,7 +52,7 @@ async function Request(type: string, path: string, payload: any, setAuthToken?:
}
})
ricevuto = true
// console.log('Request Response: ', response)
console.log('Request Response: ', response)
// console.log(new Types.AxiosSuccess(response.data, response.status))
const setAuthToken = (path === '/updatepwd')
@@ -109,7 +109,7 @@ async function Request(type: string, path: string, payload: any, setAuthToken?:
}
}
catch (error) {
setTimeout(function () {
setTimeout(() => {
GlobalStore.state.connData.uploading_server = (GlobalStore.state.connData.uploading_server === 1) ? -1 : GlobalStore.state.connData.uploading_server
GlobalStore.state.connData.downloading_server = (GlobalStore.state.connData.downloading_server === 1) ? -1 : GlobalStore.state.connData.downloading_server
}, 1000)