Skip to content

Commit 6450883

Browse files
committed
there are some mistakes
1 parent c3e088f commit 6450883

File tree

12 files changed

+169
-169
lines changed

12 files changed

+169
-169
lines changed

src/admin/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ export default {
5252
.header-container {
5353
background: linear-gradient(to right, #3e3e59, #454573);
5454
padding: 15px 0;
55-
@include phones {
55+
/* @include phones {
5656
padding: 20px 0;
57-
}
57+
} */
5858
}
5959
.root-container {
6060
display: flex;
@@ -76,9 +76,9 @@ export default {
7676
background: url("../images/content/admin.jpg") center center no-repeat / cover;
7777
flex: 1;
7878
padding-top: 60px;
79-
@include phones {
79+
/* @include phones {
8080
padding-top: 30px;
81-
}
81+
} */
8282
}
8383
.page-title {
8484
margin-bottom: 60px;

src/admin/components/header.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<script>
1717
import { mapActions } from "vuex";
1818
export default {
19-
methods: {
20-
...mapActions("user", ["logout"]),
21-
logoutUser() {
22-
this.logout();
23-
this.$router.replace("/login");
24-
}
25-
}
19+
// methods: {
20+
// ...mapActions("user", ["logout"]),
21+
// logoutUser() {
22+
// this.logout();
23+
// this.$router.replace("/login");
24+
// }
25+
// }
2626
};
2727
</script>
2828

src/admin/components/pages/about.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ export default {
3434
data: () => ({
3535
title: ""
3636
}),
37-
computed : {
38-
...mapState("categories", {
39-
categories: state => state.categories
40-
})
41-
},
42-
created() {
43-
this.fetchCategories();
44-
},
45-
methods: {
46-
...mapActions("categories", ["addCategory", "fetchCategories"]),
47-
async addNewCategory() {
48-
try {
49-
await this.addCategory(this.title);
50-
} catch (error) {
51-
alert(error.message);
52-
}
53-
}
54-
}
37+
// computed : {
38+
// ...mapState("categories", {
39+
// categories: state => state.categories
40+
// })
41+
// },
42+
// created() {
43+
// this.fetchCategories();
44+
// },
45+
// methods: {
46+
// ...mapActions("categories", ["addCategory", "fetchCategories"]),
47+
// async addNewCategory() {
48+
// try {
49+
// await this.addCategory(this.title);
50+
// } catch (error) {
51+
// alert(error.message);
52+
// }
53+
// }
54+
// }
5555
};
5656
</script>
5757

src/admin/components/pages/login.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<template lang="pug">
22
.login-section
33
.login__content
4-
form(@submit.prevent="submit").login-form
4+
form.login-form
55
.login-form__title Авторизация
66
.login__row
77
label.input
88
.input__title
99
input(v-model="user.name" placeholder="login" type="text").input__elem.field__elem
10-
.error-box {{ validation.firstError('user.name') }}
10+
//- .error-box {{ validation.firstError('user.name') }}
1111
.login__row
1212
label.input
1313
.input__title
1414
input(v-model="user.password" placeholder="password" type="password").input__elem.field__elem
15-
.error-box {{ validation.firstError('user.password') }}
15+
//- .error-box {{ validation.firstError('user.password') }}
1616
.login__btn
1717
button(
1818
type="submit"

src/admin/components/pages/reviews.vue

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,28 @@ export default {
7575
}
7676
};
7777
},
78-
methods: {
79-
...mapActions("categories", ["addReview"]),
80-
handleFile(e) {
81-
const file = e.target.files[0];
82-
this.review.photo = file;
83-
this.renderImageFile(file);
84-
},
85-
send() {
86-
this.addReview(this.review);
87-
},
88-
renderImageFile(file) {
89-
const reader = new FileReader();
90-
try {
91-
reader.readAsDataURL(file);
92-
reader.onloadend = () => {
93-
this.renderedPhoto = reader.result;
94-
};
95-
} catch (error) {
96-
throw new Errow("Ошибка при чтении файла");
97-
}
98-
}
99-
}
78+
// methods: {
79+
// ...mapActions("categories", ["addReview"]),
80+
// handleFile(e) {
81+
// const file = e.target.files[0];
82+
// this.review.photo = file;
83+
// this.renderImageFile(file);
84+
// },
85+
// send() {
86+
// this.addReview(this.review);
87+
// },
88+
// renderImageFile(file) {
89+
// const reader = new FileReader();
90+
// try {
91+
// reader.readAsDataURL(file);
92+
// reader.onloadend = () => {
93+
// this.renderedPhoto = reader.result;
94+
// };
95+
// } catch (error) {
96+
// throw new Errow("Ошибка при чтении файла");
97+
// }
98+
// }
99+
// }
100100
};
101101
</script>
102102

src/admin/components/skill-item.vue

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ export default {
2525
editedSkill: { ...this.skill }
2626
};
2727
},
28-
props: {
29-
skill: {
30-
type: Object,
31-
default: () => {},
32-
required: true
33-
}
34-
},
35-
methods: {
36-
...mapActions("skills", ["removeSkill", "editSkill"]),
37-
async removeExistedSkill() {
38-
try {
39-
await this.removeSkill(this.skill);
40-
} catch (error) {}
41-
},
42-
async editExistedSkill() {
43-
try {
44-
await this.editSkill(this.editedSkill);
45-
this.editmode = false;
46-
} catch (error) {
47-
}
48-
}
49-
}
28+
// props: {
29+
// skill: {
30+
// type: Object,
31+
// default: () => {},
32+
// required: true
33+
// }
34+
// },
35+
// methods: {
36+
// ...mapActions("skills", ["removeSkill", "editSkill"]),
37+
// async removeExistedSkill() {
38+
// try {
39+
// await this.removeSkill(this.skill);
40+
// } catch (error) {}
41+
// },
42+
// async editExistedSkill() {
43+
// try {
44+
// await this.editSkill(this.editedSkill);
45+
// this.editmode = false;
46+
// } catch (error) {
47+
// }
48+
// }
49+
// }
5050
};
5151
</script>

src/admin/components/skills-group.vue

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,34 +38,34 @@ export default {
3838
}
3939
};
4040
},
41-
props: {
42-
category: {
43-
type: Object,
44-
default: () => {},
45-
required: true
46-
}
47-
},
48-
methods: {
49-
handleFile(e) {
50-
const file = e.target.files[0];
51-
this.file = file;
52-
const formData = new FormData();
53-
formData.append("photo", this.file);
54-
},
55-
...mapActions("skills", ["addSkill"]),
56-
async addNewSkill() {
57-
this.loading = true;
58-
try {
59-
await this.addSkill(this.skill);
60-
this.skill.title = "";
61-
this.skill.percent = "";
62-
} catch (error) {
63-
// handling error
64-
} finally {
65-
this.loading = false;
66-
}
67-
}
68-
}
41+
// props: {
42+
// category: {
43+
// type: Object,
44+
// default: () => {},
45+
// required: true
46+
// }
47+
// },
48+
// methods: {
49+
// handleFile(e) {
50+
// const file = e.target.files[0];
51+
// this.file = file;
52+
// const formData = new FormData();
53+
// formData.append("photo", this.file);
54+
// },
55+
// ...mapActions("skills", ["addSkill"]),
56+
// async addNewSkill() {
57+
// this.loading = true;
58+
// try {
59+
// await this.addSkill(this.skill);
60+
// this.skill.title = "";
61+
// this.skill.percent = "";
62+
// } catch (error) {
63+
// // handling error
64+
// } finally {
65+
// this.loading = false;
66+
// }
67+
// }
68+
// }
6969
};
7070
</script>
7171

src/admin/helpers/errorHandler.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
export const generateStdError = errorObj => {
2-
const errorResponseObject = errorObj.response.data;
1+
// export const generateStdError = errorObj => {
2+
// const errorResponseObject = errorObj.response.data;
33

4-
if (errorResponseObject.message) {
5-
console.log(errorResponseObject);
6-
switch (errorResponseObject.message) {
7-
case "The given data was invalid.":
8-
throw new Error("Ошибка валидации");
9-
default:
10-
console.error(errorResponseObject);
11-
throw new Error(errorResponseObject.message);
12-
}
13-
}
4+
// if (errorResponseObject.message) {
5+
// console.log(errorResponseObject);
6+
// switch (errorResponseObject.message) {
7+
// case "The given data was invalid.":
8+
// throw new Error("Ошибка валидации");
9+
// default:
10+
// console.error(errorResponseObject);
11+
// throw new Error(errorResponseObject.message);
12+
// }
13+
// }
1414

15-
if (errorResponseObject.error) {
16-
console.log(errorResponseObject);
15+
// if (errorResponseObject.error) {
16+
// console.log(errorResponseObject);
1717

18-
switch (errorResponseObject.error) {
19-
case "token_not_provided":
20-
throw new Error("Токен авторизации не предоставлен");
18+
// switch (errorResponseObject.error) {
19+
// case "token_not_provided":
20+
// throw new Error("Токен авторизации не предоставлен");
2121

22-
case "token_expired":
23-
throw new Error("Токен авторизации просрочен");
24-
default:
25-
console.error(errorResponseObject);
26-
throw new Error(errorResponseObject.error);
27-
}
28-
}
29-
};
22+
// case "token_expired":
23+
// throw new Error("Токен авторизации просрочен");
24+
// default:
25+
// console.error(errorResponseObject);
26+
// throw new Error(errorResponseObject.error);
27+
// }
28+
// }
29+
// };

src/admin/helpers/forms.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export const wrapIntoFormData = plainObject => {
2-
const formData = new FormData();
1+
// export const wrapIntoFormData = plainObject => {
2+
// const formData = new FormData();
33

4-
Object.keys(plainObject).forEach(key => {
5-
formData.append(key, plainObject[key]);
6-
});
4+
// Object.keys(plainObject).forEach(key => {
5+
// formData.append(key, plainObject[key]);
6+
// });
77

8-
return formData;
9-
};
8+
// return formData;
9+
// };

src/admin/helpers/pictures.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import requests from '@/requests';
1+
// import requests from '@/requests';
22

3-
export const renderer = file => {
4-
const reader = new FileReader();
3+
// export const renderer = file => {
4+
// const reader = new FileReader();
55

6-
return new Promise((resolve, reject) => {
7-
try {
8-
reader.readAsDataURL(file);
9-
reader.onloadend = () => {
10-
resolve(reader.result);
11-
};
12-
} catch (error) {
13-
throw new Error("Ошибка при чтении файла");
14-
}
15-
});
16-
};
6+
// return new Promise((resolve, reject) => {
7+
// try {
8+
// reader.readAsDataURL(file);
9+
// reader.onloadend = () => {
10+
// resolve(reader.result);
11+
// };
12+
// } catch (error) {
13+
// throw new Error("Ошибка при чтении файла");
14+
// }
15+
// });
16+
// };
1717

18-
export const getAbsoluteImgPath = imgPath => {
19-
const baseUrl = requests.defaults.baseURL;
20-
return `${baseUrl}/${imgPath}`
21-
}
18+
// export const getAbsoluteImgPath = imgPath => {
19+
// const baseUrl = requests.defaults.baseURL;
20+
// return `${baseUrl}/${imgPath}`
21+
// }

0 commit comments

Comments
 (0)