From c76d3d3f1f554d19ad3444a52bcc1b7802d00b6b Mon Sep 17 00:00:00 2001 From: wang_yp Date: Mon, 22 Apr 2024 22:24:43 +0800 Subject: [PATCH] first commit --- src/components/menu/index.tsx | 18 +++++++++--------- src/pages/app/index.tsx | 18 +++++++++++++++--- src/service/apiConfig/userConfig.ts | 2 +- src/service/base.ts | 2 +- src/store/baseStore.ts | 8 ++++---- src/store/user/index.ts | 5 +++-- 6 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/components/menu/index.tsx b/src/components/menu/index.tsx index 769037d..da96761 100644 --- a/src/components/menu/index.tsx +++ b/src/components/menu/index.tsx @@ -16,16 +16,16 @@ const menuList: ItemType[] = [ icon: , label: "首页", }, - // userMenu, - cardMenu, - // contentMenu, - // dynimacStateMenu, + userMenu, + // cardMenu, + contentMenu, + dynimacStateMenu, activeMenu, - // merchant, - // system, - // rbac, - // taskMenu, - // app, + merchant, + system, + rbac, + taskMenu, + app, ]; export default menuList; diff --git a/src/pages/app/index.tsx b/src/pages/app/index.tsx index 4d90f64..17f14c6 100644 --- a/src/pages/app/index.tsx +++ b/src/pages/app/index.tsx @@ -19,11 +19,11 @@ const AppManage = (props: Store) => { const columns: ColumnsType = [ { title: "app名称", - dataIndex: "title", + dataIndex: "appName", }, { title: "图标", - dataIndex: "desc", + dataIndex: "appIcon", }, { title: "预览图片", @@ -94,7 +94,7 @@ const AppManage = (props: Store) => { type: "upload", label: "icon", name: "appIcon", - value:[], + value: [], }, { type: "upload", @@ -107,6 +107,18 @@ const AppManage = (props: Store) => { appStore.getlist(UserConfig.LIST); }, [appStore]); const onFinish = (values: any) => { + let ids = values.photosIds.map((item) => { + return item.id; + }); + let appIcon = values.appIcon.map((item) => { + return item.id; + }); + console.log(values); + values = { + ...values, + photosIds: ids.join(","), + appIcon: appIcon.join(","), + }; if (!id) { appStore.add(values); } else { diff --git a/src/service/apiConfig/userConfig.ts b/src/service/apiConfig/userConfig.ts index adb5ec0..55f5833 100644 --- a/src/service/apiConfig/userConfig.ts +++ b/src/service/apiConfig/userConfig.ts @@ -1,5 +1,5 @@ class UserConfig { - static LOGINURI: string = "user/login/system" + static LOGINURI: string = "login" static LIST: string = "user/list" static ADD: string = "user" static DELETE: string = "user" diff --git a/src/service/base.ts b/src/service/base.ts index bc2c0b6..29e066b 100644 --- a/src/service/base.ts +++ b/src/service/base.ts @@ -6,7 +6,7 @@ import axios, { AxiosResponse } from "axios"; axios.defaults.headers.common["CommonType"] = "shouka"; axios.defaults.headers.common["Content-Type"] = "application/json; charset=utf8"; axios.interceptors.request.use((config) => { - config.baseURL = "http://81.68.81.205:8181/apis/v1/"; + config.baseURL = "http://quwanya.cn:8899/v1/api/"; config.timeout = 5000; let token = window.localStorage.getItem("token") config.headers.Authorization = 'Bearer ' + token diff --git a/src/store/baseStore.ts b/src/store/baseStore.ts index e706eca..e7feeb7 100644 --- a/src/store/baseStore.ts +++ b/src/store/baseStore.ts @@ -64,16 +64,16 @@ class BaseStore implements BaseStoreInterface { PageSize: res.data?.pageSize } let data: Array = [] - if (!res.data.records) { + if (!res.data.list) { runInAction(() => { this.list = data; }) return; } - for (let i = 0; i < res.data.records.length; i++) { + for (let i = 0; i < res.data.list.length; i++) { data.push({ - key: res.data.records[i].id, - ...res.data.records[i] + key: res.data.list[i].id, + ...res.data.list[i] }) } runInAction(() => { diff --git a/src/store/user/index.ts b/src/store/user/index.ts index 7a40b35..0cbe976 100644 --- a/src/store/user/index.ts +++ b/src/store/user/index.ts @@ -29,9 +29,10 @@ class UserStore extends BaseStore { this.item = ""; } async login(params: UserInfos) { - let data = await baseHttp.forms(UserConfig.LOGINURI, { + let data = await baseHttp.post(UserConfig.LOGINURI, { acount: params.userName, - password: params.passWord, + passwd: params.passWord, + loginType:5 }) this._userinfo = { userName: data.data.name,