Implement exercise 2.1
This commit is contained in:
@@ -55,6 +55,7 @@ export const useAccountStore = defineStore("accountStore", {
|
|||||||
*/
|
*/
|
||||||
async login(): Promise<boolean> {
|
async login(): Promise<boolean> {
|
||||||
const feedbackStore = useFeedbackStore()
|
const feedbackStore = useFeedbackStore()
|
||||||
|
const exerciseStore = useExerciseStore()
|
||||||
this.fetchInProgress = true
|
this.fetchInProgress = true
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
@@ -72,14 +73,18 @@ export const useAccountStore = defineStore("accountStore", {
|
|||||||
this.userAccountToken = result.data.token
|
this.userAccountToken = result.data.token
|
||||||
|
|
||||||
getAccount(this.userAccountToken)
|
getAccount(this.userAccountToken)
|
||||||
.then(account => {
|
.then(response => {
|
||||||
this.userAccount = account.data
|
this.userAccount = response.data
|
||||||
|
|
||||||
feedbackStore.addSnackbar(BannerStateEnum.ACCOUNTLOGINSUCCESSFUL)
|
feedbackStore.addSnackbar(BannerStateEnum.ACCOUNTLOGINSUCCESSFUL)
|
||||||
this.fetchInProgress = false
|
this.fetchInProgress = false
|
||||||
|
|
||||||
this.privilegeBuy = true
|
this.privilegeBuy = true
|
||||||
this.adminPanelVisible = account.data.accountRole.privilegeAdminPanel
|
this.adminPanelVisible = response.data.accountRole.privilegeAdminPanel
|
||||||
|
|
||||||
|
if (response.data.accountRoleId == 3) {
|
||||||
|
exerciseStore.solveExercise(2, 1)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|||||||
Reference in New Issue
Block a user