lab6 vue done
This commit is contained in:
parent
17968c2cea
commit
5e6d8104dc
8
front/src/models/User.js
Normal file
8
front/src/models/User.js
Normal file
@ -0,0 +1,8 @@
|
||||
export default class User{
|
||||
constructor(data) {
|
||||
this.id = data?.id;
|
||||
this.login = data?.login;
|
||||
this.password = data?.password;
|
||||
this.role = data?.role;
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
name="Пароль">
|
||||
</div>
|
||||
<div class="login__buttons mt-5">
|
||||
<button type="submit" class="login__confirm" id="login__confirm" @click="login">Войти</button>
|
||||
<button type="submit" class="login__confirm btn btn-primary" id="login__confirm" @click="login">Войти</button>
|
||||
<a class="login__registration" href="registration">Регистрация</a>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<input class="password-input form-control" v-model="password" id="password" required="" validate="false" placeholder="Пароль" type="password" name="Пароль">
|
||||
</div>
|
||||
<div class="registration__buttons">
|
||||
<button class="registration__confirm" id="reg_btn" type="submit">Зарегестрироваться</button><a class="registration__login" href="/login">Уже есть аккаунт</a>
|
||||
<button class="registration__confirm btn btn-primary" id="reg_btn" type="submit">Зарегестрироваться</button><a class="registration__login" href="/login">Уже есть аккаунт</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<tr v-for="(user, index) in users" :key="index">
|
||||
<td>{{ user.id }}</td>
|
||||
<td>{{ user.login }}</td>
|
||||
<td>{{ user.role }}</td>
|
||||
<td>{{ user.userRole }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -21,7 +21,8 @@ import axios from 'axios'
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
users: []
|
||||
users: [],
|
||||
userRole: "",
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
@ -39,13 +40,12 @@ export default {
|
||||
"Authorization": getTokenForHeader(),
|
||||
}
|
||||
};
|
||||
axios .create({
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + localStorage.getItem("token")
|
||||
}}).get(`http://localhost:8080`, requestParams)
|
||||
.then(response => {
|
||||
this.users = response.data;
|
||||
})
|
||||
axios.create({
|
||||
headers: {'Authorization': 'Bearer ' + localStorage.getItem("token")
|
||||
}}).get('http://localhost:8080', requestParams)
|
||||
.then(response => {
|
||||
this.users = response.data;
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
|
@ -1,8 +1,10 @@
|
||||
package ru.ulstu.is.sbapp.Repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import ru.ulstu.is.sbapp.database.model.User;
|
||||
|
||||
public interface IUserRepository extends JpaRepository<User, Long> {
|
||||
@Query("SELECT u FROM User u WHERE u.login = :login")
|
||||
User findOneByLoginIgnoreCase(String login);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user