|
@@ -11,8 +11,8 @@ const changeCategory = (data) => ({
|
|
|
export const getCategory = () => {
|
|
|
return (dispatch) => {
|
|
|
axios.get('api/v1/category/list').then((res) => {
|
|
|
- if (res.success === 1) {
|
|
|
- dispatch(changeCategory(res.models));
|
|
|
+ if (res.code === 0) {
|
|
|
+ dispatch(changeCategory(res.data));
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -21,7 +21,7 @@ export const getCategory = () => {
|
|
|
export const getUser = () => {
|
|
|
return (dispatch) => {
|
|
|
// axios.get('/auth/master/v1/get').then((res) => {
|
|
|
- // if (res.success === 1) {
|
|
|
+ // if (res.code === 0) {
|
|
|
// dispatch({
|
|
|
// type: constants.GET_USER,
|
|
|
// data: fromJS(res.model)
|
|
@@ -34,10 +34,9 @@ export const getUser = () => {
|
|
|
export const getConfing = () => {
|
|
|
return (dispatch) => {
|
|
|
axios.get('api/v1/config/list').then((res) => {
|
|
|
- if (res.success === 1) {
|
|
|
- const {models} = res;
|
|
|
- let data = {};
|
|
|
- models.forEach(item => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const {data} = res;
|
|
|
+ data.forEach(item => {
|
|
|
if (item.configKey === "name") {
|
|
|
data.title = item.configValue;
|
|
|
}
|