Function bodies 165 total
login function · javascript · L3-L9 (7 LOC)frontend/src/api/auth.js
export function login(data) {
return request({
url: '/auth/login',
method: 'post',
data
})
}getUserInfo function · javascript · L11-L16 (6 LOC)frontend/src/api/auth.js
export function getUserInfo() {
return request({
url: '/auth/info',
method: 'get'
})
}logout function · javascript · L18-L23 (6 LOC)frontend/src/api/auth.js
export function logout() {
return request({
url: '/auth/logout',
method: 'post'
})
}getFishList function · javascript · L3-L9 (7 LOC)frontend/src/api/fish.js
export function getFishList(params) {
return request({
url: '/fish',
method: 'get',
params
})
}getFishById function · javascript · L11-L16 (6 LOC)frontend/src/api/fish.js
export function getFishById(id) {
return request({
url: `/fish/${id}`,
method: 'get'
})
}addFish function · javascript · L18-L24 (7 LOC)frontend/src/api/fish.js
export function addFish(data) {
return request({
url: '/fish',
method: 'post',
data
})
}updateFish function · javascript · L26-L32 (7 LOC)frontend/src/api/fish.js
export function updateFish(id, data) {
return request({
url: `/fish/${id}`,
method: 'put',
data
})
}Repobility — same analyzer, your code, free for public repos · /scan/
deleteFish function · javascript · L34-L39 (6 LOC)frontend/src/api/fish.js
export function deleteFish(id) {
return request({
url: `/fish/${id}`,
method: 'delete'
})
}getPermissionList function · javascript · L3-L8 (6 LOC)frontend/src/api/permission.js
export function getPermissionList() {
return request({
url: '/permission',
method: 'get'
})
}getMenuTree function · javascript · L10-L15 (6 LOC)frontend/src/api/permission.js
export function getMenuTree() {
return request({
url: '/permission/menu',
method: 'get'
})
}getPermissionById function · javascript · L17-L22 (6 LOC)frontend/src/api/permission.js
export function getPermissionById(id) {
return request({
url: `/permission/${id}`,
method: 'get'
})
}addPermission function · javascript · L24-L30 (7 LOC)frontend/src/api/permission.js
export function addPermission(data) {
return request({
url: '/permission',
method: 'post',
data
})
}updatePermission function · javascript · L32-L38 (7 LOC)frontend/src/api/permission.js
export function updatePermission(id, data) {
return request({
url: `/permission/${id}`,
method: 'put',
data
})
}deletePermission function · javascript · L40-L45 (6 LOC)frontend/src/api/permission.js
export function deletePermission(id) {
return request({
url: `/permission/${id}`,
method: 'delete'
})
}getRoleList function · javascript · L3-L8 (6 LOC)frontend/src/api/role.js
export function getRoleList() {
return request({
url: '/role',
method: 'get'
})
}Want this analysis on your repo? https://repobility.com/scan/
getRoleById function · javascript · L10-L15 (6 LOC)frontend/src/api/role.js
export function getRoleById(id) {
return request({
url: `/role/${id}`,
method: 'get'
})
}addRole function · javascript · L17-L23 (7 LOC)frontend/src/api/role.js
export function addRole(data) {
return request({
url: '/role',
method: 'post',
data
})
}updateRole function · javascript · L25-L31 (7 LOC)frontend/src/api/role.js
export function updateRole(id, data) {
return request({
url: `/role/${id}`,
method: 'put',
data
})
}deleteRole function · javascript · L33-L38 (6 LOC)frontend/src/api/role.js
export function deleteRole(id) {
return request({
url: `/role/${id}`,
method: 'delete'
})
}getSaleList function · javascript · L3-L9 (7 LOC)frontend/src/api/sale.js
export function getSaleList(params) {
return request({
url: '/sale',
method: 'get',
params
})
}getFishList function · javascript · L11-L16 (6 LOC)frontend/src/api/sale.js
export function getFishList() {
return request({
url: '/sale/fish-list',
method: 'get'
})
}addSale function · javascript · L18-L24 (7 LOC)frontend/src/api/sale.js
export function addSale(data) {
return request({
url: '/sale',
method: 'post',
data
})
}deleteSale function · javascript · L26-L31 (6 LOC)frontend/src/api/sale.js
export function deleteSale(id) {
return request({
url: `/sale/${id}`,
method: 'delete'
})
}Repobility (the analyzer behind this table) · https://repobility.com
getDailyStats function · javascript · L34-L40 (7 LOC)frontend/src/api/sale.js
export function getDailyStats(date) {
return request({
url: '/sale/stats/daily',
method: 'get',
params: { date }
})
}getWeeklyStats function · javascript · L42-L48 (7 LOC)frontend/src/api/sale.js
export function getWeeklyStats(date) {
return request({
url: '/sale/stats/weekly',
method: 'get',
params: { date }
})
}getMonthlyStats function · javascript · L50-L56 (7 LOC)frontend/src/api/sale.js
export function getMonthlyStats(date) {
return request({
url: '/sale/stats/monthly',
method: 'get',
params: { date }
})
}getQuarterlyStats function · javascript · L58-L64 (7 LOC)frontend/src/api/sale.js
export function getQuarterlyStats(date) {
return request({
url: '/sale/stats/quarterly',
method: 'get',
params: { date }
})
}getYearlyStats function · javascript · L66-L72 (7 LOC)frontend/src/api/sale.js
export function getYearlyStats(year) {
return request({
url: '/sale/stats/yearly',
method: 'get',
params: { year }
})
}getUserList function · javascript · L3-L8 (6 LOC)frontend/src/api/user.js
export function getUserList() {
return request({
url: '/user',
method: 'get'
})
}getUserById function · javascript · L10-L15 (6 LOC)frontend/src/api/user.js
export function getUserById(id) {
return request({
url: `/user/${id}`,
method: 'get'
})
}addUser function · javascript · L17-L23 (7 LOC)frontend/src/api/user.js
export function addUser(data) {
return request({
url: '/user',
method: 'post',
data
})
}Source: Repobility analyzer · https://repobility.com
updateUser function · javascript · L25-L31 (7 LOC)frontend/src/api/user.js
export function updateUser(id, data) {
return request({
url: `/user/${id}`,
method: 'put',
data
})
}deleteUser function · javascript · L33-L38 (6 LOC)frontend/src/api/user.js
export function deleteUser(id) {
return request({
url: `/user/${id}`,
method: 'delete'
})
}loginAction function · javascript · L11-L19 (9 LOC)frontend/src/store/user.js
async function loginAction(loginForm) {
const res = await login(loginForm)
token.value = res.data.token
userInfo.value = res.data.userInfo
permissions.value = res.data.userInfo.permissions
roles.value = res.data.userInfo.roles
localStorage.setItem('token', res.data.token)
return res
}getUserInfoAction function · javascript · L21-L27 (7 LOC)frontend/src/store/user.js
async function getUserInfoAction() {
const res = await getUserInfo()
userInfo.value = res.data
permissions.value = res.data.permissions
roles.value = res.data.roles
return res
}logoutAction function · javascript · L29-L36 (8 LOC)frontend/src/store/user.js
function logoutAction() {
token.value = ''
userInfo.value = null
permissions.value = []
roles.value = []
localStorage.removeItem('token')
logout().catch(() => {})
}hasPermission function · javascript · L38-L40 (3 LOC)frontend/src/store/user.js
function hasPermission(permission) {
return permissions.value.includes(permission)
}hasRole function · javascript · L42-L44 (3 LOC)frontend/src/store/user.js
function hasRole(role) {
return roles.value.includes(role)
}GlobalExceptionHandler class · java · L14-L55 (42 LOC)src/main/java/com/dk/salesystem/config/GlobalExceptionHandler.java
public class GlobalExceptionHandler {
@ExceptionHandler(AuthenticationException.class)
@ResponseStatus(HttpStatus.UNAUTHORIZED)
public ApiResponse<Void> handleAuthenticationException(AuthenticationException e) {
return ApiResponse.error(401, "认证失败:" + e.getMessage());
}
@ExceptionHandler(BadCredentialsException.class)
@ResponseStatus(HttpStatus.UNAUTHORIZED)
public ApiResponse<Void> handleBadCredentialsException(BadCredentialsException e) {
return ApiResponse.error(401, "用户名或密码错误");
}
@ExceptionHandler(AccessDeniedException.class)
@ResponseStatus(HttpStatus.FORBIDDEN)
public ApiResponse<Void> handleAccessDeniedException(AccessDeniedException e) {
return ApiResponse.error(403, "权限不足");
}
@ExceptionHandler(MethodArgumentNotValidException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public ApiResponse<Void> handleValidationException(MethodArgumentNotValidException e) {
String message = e.getBRepobility — same analyzer, your code, free for public repos · /scan/
handleAuthenticationException method · java · L18-L20 (3 LOC)src/main/java/com/dk/salesystem/config/GlobalExceptionHandler.java
public ApiResponse<Void> handleAuthenticationException(AuthenticationException e) {
return ApiResponse.error(401, "认证失败:" + e.getMessage());
}handleBadCredentialsException method · java · L24-L26 (3 LOC)src/main/java/com/dk/salesystem/config/GlobalExceptionHandler.java
public ApiResponse<Void> handleBadCredentialsException(BadCredentialsException e) {
return ApiResponse.error(401, "用户名或密码错误");
}handleAccessDeniedException method · java · L30-L32 (3 LOC)src/main/java/com/dk/salesystem/config/GlobalExceptionHandler.java
public ApiResponse<Void> handleAccessDeniedException(AccessDeniedException e) {
return ApiResponse.error(403, "权限不足");
}handleValidationException method · java · L36-L42 (7 LOC)src/main/java/com/dk/salesystem/config/GlobalExceptionHandler.java
public ApiResponse<Void> handleValidationException(MethodArgumentNotValidException e) {
String message = e.getBindingResult().getAllErrors().stream()
.map(error -> error.getDefaultMessage())
.findFirst()
.orElse("参数验证失败");
return ApiResponse.error(400, message);
}handleRuntimeException method · java · L46-L48 (3 LOC)src/main/java/com/dk/salesystem/config/GlobalExceptionHandler.java
public ApiResponse<Void> handleRuntimeException(RuntimeException e) {
return ApiResponse.error(500, e.getMessage());
}handleException method · java · L52-L54 (3 LOC)src/main/java/com/dk/salesystem/config/GlobalExceptionHandler.java
public ApiResponse<Void> handleException(Exception e) {
return ApiResponse.error(500, "服务器内部错误:" + e.getMessage());
}MybatisPlusConfig class · java · L10-L18 (9 LOC)src/main/java/com/dk/salesystem/config/MybatisPlusConfig.java
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
}mybatisPlusInterceptor method · java · L13-L17 (5 LOC)src/main/java/com/dk/salesystem/config/MybatisPlusConfig.java
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}Want this analysis on your repo? https://repobility.com/scan/
authenticationProvider function · java · L59-L64 (6 LOC)src/main/java/com/dk/salesystem/config/SecurityConfig.java
public AuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
authProvider.setUserDetailsService(userDetailsService);
authProvider.setPasswordEncoder(passwordEncoder());
return authProvider;
}authenticationManager function · java · L67-L69 (3 LOC)src/main/java/com/dk/salesystem/config/SecurityConfig.java
public AuthenticationManager authenticationManager(AuthenticationConfiguration config) throws Exception {
return config.getAuthenticationManager();
}passwordEncoder function · java · L72-L74 (3 LOC)src/main/java/com/dk/salesystem/config/SecurityConfig.java
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}page 1 / 4next ›