diff --git a/.env.production b/.env.production index 72449c3..3e0ca2b 100644 --- a/.env.production +++ b/.env.production @@ -1,13 +1,13 @@ -# 代理前缀 -VITE_APP_BASE_API = '/prod-api' + # WebSocket端点(可选) #VITE_APP_WS_ENDPOINT=wss://api.youlai.tech/ws # 接口地址 +VITE_APP_BASE_API = 'https://tapi.cashier.sxczgkj.cn/' + -VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 正式 # WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws diff --git a/README.md b/README.md index 8137a30..af6e304 100644 --- a/README.md +++ b/README.md @@ -125,3 +125,35 @@ server { 执行 `pnpm run commit` 唤起 git commit 交互,根据提示完成信息的输入和选择。 ![](https://foruda.gitee.com/images/1687755823165218215/c1705416_716974.png) + +新版银收客后台管理系统web端 + +admin +12345 +可测试功能: +1.店铺管理 + 店铺管理 + 角色管理 + 员工列表 +2.系统管理 + 系统参数 + 角色管理 + 菜单管理 + 小程序页面 + 版本管理 +3.激活码 + 激活码列表 + 商品分组 +4.线上店铺 + 店铺装修 +5.经营工具 + 台桌管理 +6.应用中心 + 营销中心 + 霸王餐 +7.商品管理 + 常用单位 + 商品分类 + 商品规格 +8.用户管理 + 用户列表 diff --git a/src/api/account/menu.ts b/src/api/account/menu.ts index ba291ef..34c496a 100644 --- a/src/api/account/menu.ts +++ b/src/api/account/menu.ts @@ -18,7 +18,7 @@ const MenuApi = { }); }, get(id: string) { - return request({ + return request({ url: `${baseURL}/detail`, method: "get", params: { id } @@ -103,101 +103,59 @@ export interface addRequest { /** * 是否选中父级菜单 */ - activeMenu?: string; + activeMenu?: null | string; /** * 是否缓存 */ - cache?: number; + cache: number | string; /** * 组件 */ - component?: string; + component: number | string; /** * 是否隐藏 */ - hidden?: number; + hidden: number | string; /** * 图标 */ - icon?: string; + icon: string; /** * 是否外链 */ - iFrame?: number; + iFrame: number | string; /** * 菜单排序 */ - menuSort?: number; + menuSort: number; + /** + * 组件名称 + */ + name: string; /** * 链接地址 */ - path?: string; + path: number | string; /** * 权限表示 */ - permission?: string; + permission?: null | string; /** * 上级菜单,不传递则为顶级菜单 */ - pid?: number; - title: string; + pid?: number | string; + title: string | string; /** * 菜单类型 0 菜单 1按钮 2接口 */ - type: number | null; + type: number | string; [property: string]: any; } /** * MenuEditDTO */ -export interface editRequest { - /** - * 菜单类型 0 菜单 1按钮 2接口 - */ - type: number; - /** - * 是否选中父级菜单 - */ - activeMenu?: string; - /** - * 是否缓存 - */ - cache?: number; - /** - * 组件 - */ - component?: string; - /** - * 是否隐藏 - */ - hidden?: number; - /** - * 图标 - */ - icon?: string; +export interface editRequest extends addRequest { id: number | string; - /** - * 是否外链 - */ - iFrame?: number; - /** - * 菜单排序 - */ - menuSort?: number; - /** - * 链接地址 - */ - path?: string; - /** - * 权限表示 - */ - permission?: string; - /** - * 上级菜单,不传递则为顶级菜单 - */ - pid: number | string | null; - title: string; - [property: string]: any; } /** @@ -305,4 +263,94 @@ export interface MenuVO { */ updateTime?: string; [property: string]: any; +} + +/** + * 菜单结构 + * + * CzgResult«SysMenu» + */ + +export interface SysMenu { + /** + * 是否选中父级菜单 + */ + activeMenu?: null | string; + /** + * 缓存 + */ + cache?: boolean | null; + /** + * 组件 + */ + component?: null | string; + /** + * 创建者 + */ + createBy?: null | string; + /** + * 创建日期 + */ + createTime?: null | string; + /** + * 隐藏 + */ + hidden?: boolean | null; + /** + * 图标 + */ + icon?: null | string; + /** + * 是否外链 + */ + iFrame?: boolean | null; + /** + * 商户使用 0:否;1:是; + */ + isShop?: number | null; + /** + * ID + */ + menuId?: number | null; + /** + * 排序 + */ + menuSort?: number | null; + /** + * 组件名称 + */ + name?: null | string; + /** + * 链接地址 + */ + path?: null | string; + /** + * 权限 + */ + permission?: null | string; + /** + * 上级菜单ID + */ + pid?: number | null; + /** + * 子菜单数目 + */ + subCount?: number | null; + /** + * 菜单标题 + */ + title?: null | string; + /** + * 菜单类型 0 菜单 1按钮 3接口 + */ + type?: number | null; + /** + * 更新者 + */ + updateBy?: null | string; + /** + * 更新时间 + */ + updateTime?: null | string; + [property: string]: any; } \ No newline at end of file diff --git a/src/api/account/shop.ts b/src/api/account/shop.ts index 225dca8..45ecba8 100644 --- a/src/api/account/shop.ts +++ b/src/api/account/shop.ts @@ -24,9 +24,23 @@ const ShopApi = { data, }); }, + get(params: getRequest) { + return request({ + url: `${baseURL}/detail`, + method: "get", + params + }); + } }; export default ShopApi; +export interface getRequest { + /** + * 店铺id,可不传,不传递则为获取当前用户店铺 + */ + id?: string | number; + [property: string]: any; +} /** * ShopInfoEditDTO @@ -58,3 +72,202 @@ export interface PageQuery { status?: number; [property: string]: any; } + + +/** +* ShopInfo +*/ +export interface ShopInfo { + /** + * 详细地址 + */ + address?: null | string; + /** + * 项目分类 + */ + article?: null | string; + /** + * 背景图 + */ + backImg?: null | string; + /** + * 开票系统账号 + */ + bindAccount?: null | string; + /** + * 台桌预订短信 + */ + bookingSms?: null | string; + /** + * 营业时间(周结束) + */ + businessEndDay?: null | string; + /** + * 营业时间(周开始) + */ + businessStartDay?: null | string; + /** + * 营业时间 + */ + businessTime?: null | string; + /** + * 连锁店扩展店名 + */ + chainName?: null | string; + /** + * 市 + */ + cities?: null | string; + /** + * 积分群体 all-所有 vip-仅针对会员 + */ + consumeColony?: null | string; + /** + * 联系人姓名 + */ + contactName?: null | string; + /** + * 封面图 + */ + coverImg?: null | string; + createTime?: null | string; + /** + * 店铺简介 + */ + detail?: null | string; + /** + * 区/县 + */ + districts?: null | string; + /** + * 就餐模式 堂食 dine-in 外带 take-out + */ + eatModel?: null | string; + /** + * 到期时间 + */ + expireTime?: null | string; + /** + * 门头照 + */ + frontImg?: null | string; + /** + * 使用系统用户 sys_user id + */ + id?: number | null; + /** + * 是否开启会员余额支付 + */ + isAccountPay?: number | null; + /** + * 是否允许会员自定义金额 1 允许 0 不允许 + */ + isCustomAmount?: number | null; + /** + * 是否开启会员充值密码 1 启用 0 禁用 + */ + isMemberInPwd?: number | null; + /** + * 是否启用会员价 0否1是 + */ + isMemberPrice?: number | null; + /** + * 是否开启会员退款密码 1 启用 0 禁用 + */ + isMemberReturnPwd?: number | null; + /** + * 是否开启退款密码 1 启用 0 禁用 + */ + isReturnPwd?: number | null; + /** + * 是否免除桌位费 0否1是 + */ + isTableFee?: number | null; + /** + * 经纬度 + */ + lat?: null | string; + /** + * 经纬度 + */ + lng?: null | string; + /** + * 店铺logo + */ + logo?: null | string; + /** + * 主店id + */ + mainId?: number | null; + /** + * 0停业 1,正常营业 2,网上售卖 + */ + onSale?: number | null; + /** + * 操作密码 + */ + operationPwd?: null | string; + /** + * 店铺收款码 + */ + paymentQrcode?: null | string; + /** + * 联系电话 + */ + phone?: null | string; + /** + * trial试用版,release正式 + */ + profiles?: null | string; + /** + * 省 + */ + provinces?: null | string; + registerType?: null | string; + /** + * 数电发票类型 + */ + sdType?: null | string; + /** + * 店铺名称 + */ + shopName?: null | string; + /** + * 商家二维码 + */ + shopQrcode?: null | string; + /** + * 店铺类型 单店--only 连锁店--chain--加盟店join (对应原来 type) + */ + shopType?: null | string; + /** + * 小程序码(零点八零首页) + */ + smallQrcode?: null | string; + /** + * -1 平台禁用 0-过期,1正式营业, + */ + status?: number | null; + /** + * 店铺口号 + */ + subTitle?: null | string; + /** + * 桌位费 + */ + tableFee?: number | null; + /** + * 商家标签 + */ + tag?: null | string; + /** + * 税率 + */ + taxAmount?: null | string; + /** + * 管理 0否 1是, 1 为直接管理 可切换店铺 0 不可以切换 + */ + tubeType?: number | null; + updateTime?: null | string; + [property: string]: any; +} \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index f531eb5..6520f8f 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -126,7 +126,7 @@ export const constantRoutes: RouteRecordRaw[] = [ }, { path: "role", - component: () => import("@/views/shop/role.vue"), + component: () => import("@/views/admim/system/role/index.vue"), name: "shopRole", meta: { title: "角色管理", diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 28fc8e4..fadbc52 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -3,6 +3,7 @@ import { usePermissionStoreHook } from "@/store/modules/permission"; import { useDictStoreHook } from "@/store/modules/dict"; import AuthAPI, { type loginRequest } from "@/api/account/login"; +import ShopApi from "@/api/account/shop"; import UserAPI, { type UserInfo } from "@/api/system/user"; import { setToken, setRefreshToken, getRefreshToken, clearToken } from "@/utils/auth"; @@ -12,7 +13,9 @@ export const useUserStore = defineStore("user", () => { const promissionList = useStorage("promissionList", [] as string[]); localStorage.setItem("shopId", "" + userInfo.value.shopId); - + if (userInfo.value.shopId) { + getUserInfo() + } /** * 登录 * @@ -43,15 +46,16 @@ export const useUserStore = defineStore("user", () => { */ function getUserInfo() { return new Promise((resolve, reject) => { - UserAPI.getInfo(userInfo.value.shopId) + ShopApi.get({ id: userInfo.value.shopId }) .then((data) => { if (!data) { reject("Verification failed, please Login again."); return; } localStorage.setItem("shopId", "" + userInfo.value.shopId); - Object.assign(userInfo.value, { ...data }); - resolve(data); + console.log("获取用户信息", data); + Object.assign(userInfo.value, { ...data, roles: [], promissionList: [], shopId: userInfo.value.shopId }); + resolve(userInfo.value); }) .catch((error) => { reject(error); diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts index 3a2d7ce..a7fba09 100644 --- a/src/utils/websocket.ts +++ b/src/utils/websocket.ts @@ -58,19 +58,17 @@ class WebSocketManager { this.client.onopen = () => { this.connected = true; console.log("WebSocket 连接已建立"); - ElNotification.success('WebSocket 连接已建立') + // ElNotification.success('WebSocket 连接已建立') this.sendMessage(this.initParams) }; this.client.onclose = () => { if (!this.connected) { - ElMessageBox.alert('WebSocket 连接已断开', 'Title', { - // if you want to disable its autofocus - // autofocus: false, - confirmButtonText: '立即重连', - callback: () => { - this.sendMessage(this.initParams) - }, - }) + // ElMessageBox.alert('WebSocket 连接已断开', 'Title', { + // confirmButtonText: '立即重连', + // callback: () => { + // this.sendMessage(this.initParams) + // }, + // }) } this.connected = false; console.log("WebSocket 连接已断开"); @@ -78,19 +76,17 @@ class WebSocketManager { }; this.client.onerror = (error) => { console.error("WebSocket 发生错误:", error); - ElNotification({ - title: "提示", - message: "WebSocket 发生错误", - type: "error", - }); - ElMessageBox.alert('WebSocket 发生错误', 'Title', { - // if you want to disable its autofocus - // autofocus: false, - confirmButtonText: '立即重连', - callback: () => { - this.sendMessage(this.initParams) - }, - }) + // ElNotification({ + // title: "提示", + // message: "WebSocket 发生错误", + // type: "error", + // }); + // ElMessageBox.alert('WebSocket 发生错误', 'Title', { + // confirmButtonText: '立即重连', + // callback: () => { + // this.sendMessage(this.initParams) + // }, + // }) }; this.client.onmessage = (event) => { const message = event.data; diff --git a/src/views/admim/system/menu/index.vue b/src/views/admim/system/menu/index.vue index e0e91f9..3cc209b 100644 --- a/src/views/admim/system/menu/index.vue +++ b/src/views/admim/system/menu/index.vue @@ -162,9 +162,14 @@ 接口 - - - + + @@ -237,8 +242,8 @@ - 开启 - 关闭 + 开启 + 关闭 @@ -265,9 +270,9 @@ - + - - \ No newline at end of file diff --git a/src/views/tool/table/components/choose-user.vue b/src/views/tool/table/components/choose-user.vue deleted file mode 100644 index f834fca..0000000 --- a/src/views/tool/table/components/choose-user.vue +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/views/tool/table/components/downloadTableCode.vue b/src/views/tool/table/components/downloadTableCode.vue deleted file mode 100644 index 92f0218..0000000 --- a/src/views/tool/table/components/downloadTableCode.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/tool/table/components/money-keyboard.vue b/src/views/tool/table/components/money-keyboard.vue deleted file mode 100644 index 11e1909..0000000 --- a/src/views/tool/table/components/money-keyboard.vue +++ /dev/null @@ -1,339 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/views/tool/table/components/pay-type.vue b/src/views/tool/table/components/pay-type.vue deleted file mode 100644 index 692dd8c..0000000 --- a/src/views/tool/table/components/pay-type.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/tool/table/components/subscribe.vue b/src/views/tool/table/components/subscribe.vue deleted file mode 100644 index d28d178..0000000 --- a/src/views/tool/table/components/subscribe.vue +++ /dev/null @@ -1,269 +0,0 @@ - - - - diff --git a/src/views/tool/table/components/table-diancan copy.vue b/src/views/tool/table/components/table-diancan copy.vue deleted file mode 100644 index 283e243..0000000 --- a/src/views/tool/table/components/table-diancan copy.vue +++ /dev/null @@ -1,3990 +0,0 @@ - - - - - - diff --git a/src/views/tool/table/components/table-diancan-back.vue b/src/views/tool/table/components/table-diancan-back.vue deleted file mode 100644 index a407f04..0000000 --- a/src/views/tool/table/components/table-diancan-back.vue +++ /dev/null @@ -1,3804 +0,0 @@ - - - - - - diff --git a/src/views/tool/table/components/table-diancan-oldList-back.vue b/src/views/tool/table/components/table-diancan-oldList-back.vue deleted file mode 100644 index 50452fd..0000000 --- a/src/views/tool/table/components/table-diancan-oldList-back.vue +++ /dev/null @@ -1,3839 +0,0 @@ - - - - - - diff --git a/src/views/tool/table/components/table-diancan.vue b/src/views/tool/table/components/table-diancan.vue deleted file mode 100644 index 1b5dcae..0000000 --- a/src/views/tool/table/components/table-diancan.vue +++ /dev/null @@ -1,4302 +0,0 @@ - - - - - - diff --git a/src/views/tool/table/components/table-edit.vue b/src/views/tool/table/components/table-edit.vue deleted file mode 100644 index 76171fc..0000000 --- a/src/views/tool/table/components/table-edit.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index e38920d..128ef0b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,7 @@ "allowJs": true, // 类型声明相关配置 - "types": ["node", "vite/client", "element-plus/global", "vuemap"] + "types": ["node", "vite/client", "element-plus/global"] }, "include": [