feat: remove try catch as example
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
This commit is contained in:
parent
d93a2b3f23
commit
855ba735a9
|
@ -137,7 +137,6 @@ export const useUserStore = defineStore('user', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const login = async (username, password, remember) => {
|
const login = async (username, password, remember) => {
|
||||||
try {
|
|
||||||
const params = { user: username, password };
|
const params = { user: username, password };
|
||||||
const { data } = await api.post('Accounts/login', params);
|
const { data } = await api.post('Accounts/login', params);
|
||||||
|
|
||||||
|
@ -154,9 +153,6 @@ export const useUserStore = defineStore('user', () => {
|
||||||
await fetchTokenConfig();
|
await fetchTokenConfig();
|
||||||
startInterval();
|
startInterval();
|
||||||
await onLogin();
|
await onLogin();
|
||||||
} catch (error) {
|
|
||||||
throw new Error('Error logging in');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const tryAutoLogin = async () => {
|
const tryAutoLogin = async () => {
|
||||||
|
@ -180,7 +176,6 @@ export const useUserStore = defineStore('user', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchTokenConfig = async () => {
|
const fetchTokenConfig = async () => {
|
||||||
try {
|
|
||||||
const { data } = await api.get('AccessTokenConfigs/findOne', {
|
const { data } = await api.get('AccessTokenConfigs/findOne', {
|
||||||
filter: { fields: ['renewInterval', 'renewPeriod'] }
|
filter: { fields: ['renewInterval', 'renewPeriod'] }
|
||||||
});
|
});
|
||||||
|
@ -188,10 +183,6 @@ export const useUserStore = defineStore('user', () => {
|
||||||
tokenConfig.value = data;
|
tokenConfig.value = data;
|
||||||
storage.value.setItem('renewPeriod', data.renewPeriod);
|
storage.value.setItem('renewPeriod', data.renewPeriod);
|
||||||
return data;
|
return data;
|
||||||
} catch (error) {
|
|
||||||
notify('errors.tokenConfig', 'negative');
|
|
||||||
console.error('Error fetching token config:', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const renewToken = async () => {
|
const renewToken = async () => {
|
||||||
|
@ -247,14 +238,10 @@ export const useUserStore = defineStore('user', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchUser = async (userType = 'user') => {
|
const fetchUser = async (userType = 'user') => {
|
||||||
try {
|
|
||||||
const userData = await api.get('VnUsers/getCurrentUserData');
|
const userData = await api.get('VnUsers/getCurrentUserData');
|
||||||
|
|
||||||
if (userType === 'user') mainUser.value = userData.data;
|
if (userType === 'user') mainUser.value = userData.data;
|
||||||
else supplantedUser.value = userData.data;
|
else supplantedUser.value = userData.data;
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching user: ', error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const supplantUser = async supplantUser => {
|
const supplantUser = async supplantUser => {
|
||||||
|
|
Loading…
Reference in New Issue