as is
This commit is contained in:
@@ -9,7 +9,7 @@ import type {
|
||||
} from "./models/AntiForgeryToken";
|
||||
|
||||
class AxiosHelper {
|
||||
private readonly REFRESH_TOKEN_URL: string = "/common/refreshtoken";
|
||||
private readonly REFRESH_TOKEN_URL: string = "/user/refreshtoken";
|
||||
private constructor(config?: CreateAxiosDefaults) {
|
||||
this.axios = Axios.create({
|
||||
withCredentials: true,
|
||||
|
||||
@@ -36,6 +36,14 @@ export const editUser = async (
|
||||
return await AxiosHelper.getInstance().post("/user/edit", params);
|
||||
};
|
||||
|
||||
export const signOut = async (): Promise<M.ApiResponseMessage> => {
|
||||
return await AxiosHelper.getInstance().post("/user/signout");
|
||||
};
|
||||
|
||||
export const refreshToken = async (): Promise<M.AccessTokenResponse> => {
|
||||
return await AxiosHelper.getInstance().post("/user/refreshtoken");
|
||||
};
|
||||
|
||||
//district
|
||||
export const districtTop3Levels = async (): Promise<M.DistrictsResponse> => {
|
||||
return await AxiosHelper.getInstance().get("/district/top3level");
|
||||
@@ -67,14 +75,6 @@ export const csrfToken = async (): Promise<M.AntiForgeryTokenResponse> => {
|
||||
return csrfResult;
|
||||
};
|
||||
|
||||
export const signOut = async (): Promise<M.ApiResponseMessage> => {
|
||||
return await AxiosHelper.getInstance().post("/common/signout");
|
||||
};
|
||||
|
||||
export const refreshToken = async (): Promise<M.AccessTokenResponse> => {
|
||||
return await AxiosHelper.getInstance().post("/common/refreshtoken");
|
||||
};
|
||||
|
||||
//category
|
||||
export const getCategoryTree = async (): Promise<M.CategoryListResponse> => {
|
||||
return await AxiosHelper.getInstance().get("/category/list");
|
||||
@@ -83,6 +83,12 @@ export const getCategoryTree = async (): Promise<M.CategoryListResponse> => {
|
||||
//product
|
||||
export const productSearch = async (
|
||||
params: M.ProductSearchParms,
|
||||
): Promise<M.ProductSearchResponse> => {
|
||||
return await AxiosHelper.getInstance().get("/product/search", params);
|
||||
};
|
||||
|
||||
export const productList = async (
|
||||
params: M.ProductSearchParms,
|
||||
): Promise<M.ProductSearchResponse> => {
|
||||
return await AxiosHelper.getInstance().get("/product/list", params);
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&:nth-last-of-type() {
|
||||
&:nth-last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { productReducer, initialState } from "../../store/product";
|
||||
import * as actions from "../../store/product/action";
|
||||
import {
|
||||
getCategoryTree,
|
||||
productSearch,
|
||||
productList,
|
||||
productDetail,
|
||||
productDelete,
|
||||
productEdit,
|
||||
@@ -75,7 +75,7 @@ export function Component() {
|
||||
orderBys.push(ProductOrderBys.CreateTime);
|
||||
else orderBys.push(ProductOrderBys.CreateTimeDesc);
|
||||
|
||||
const result = await productSearch({
|
||||
const result = await productList({
|
||||
categoryId: states.categoryId,
|
||||
keyword: states.keyword,
|
||||
orderBys: orderBys,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { type SignInState } from "./state";
|
||||
import { type SignInAction } from "./action";
|
||||
import { UserRoles } from "../../api/models";
|
||||
|
||||
export const initialState: SignInState = {
|
||||
isSubmiting: false,
|
||||
@@ -9,7 +10,7 @@ export const initialState: SignInState = {
|
||||
},
|
||||
signUpUser: {
|
||||
account: "",
|
||||
defaultRole: "Buyer",
|
||||
defaultRole: UserRoles.Buyer,
|
||||
nickName: "",
|
||||
password: "",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user