增加店铺列表页面,增加vue-amap,修改登录相关接口类型

This commit is contained in:
2025-02-12 13:52:52 +08:00
parent a599adc63e
commit 81d6ef44ef
18 changed files with 1399 additions and 62 deletions

View File

@@ -3,8 +3,8 @@ const baseURL = "account/admin/";
const AuthAPI = {
/** 登录接口*/
login(data: LoginFormData) {
return request<any, LoginResult>({
login(data: loginRequest) {
return request<any, loginResponse>({
url: `${baseURL}auth/login`,
method: "post",
data: data,
@@ -13,14 +13,14 @@ const AuthAPI = {
/** 获取验证码接口*/
getCaptcha() {
return request<any, CaptchaInfo>({
return request<any, codeResponse>({
url: `${baseURL}auth/captcha`,
method: "get",
});
},
/**getPermission */
getPermission() {
return request<any, CaptchaInfo>({
return request<any, codeResponse>({
url: `${baseURL}auth/permission`,
method: "get",
});
@@ -28,34 +28,327 @@ const AuthAPI = {
};
export default AuthAPI;
/**
* 验证码信息
*
* CzgResult«?»
*/
export interface codeResponse {
code?: number | null;
data?: null;
msg?: null | string;
[property: string]: any;
}
/** 登录表单数据 */
export interface LoginFormData {
/** 用户名 */
username: string;
/** 密码 */
password: string;
/** 验证码缓存uuid */
uuid: string;
/** 验证码 */
code: string;
/** 登录类型
* 0:商户登录
* 1:员工登录
/**
* 登录参数
*
* SysLoginDTO
*/
export interface loginRequest {
/**
* 验证码
*/
loginType: number;
code: null | string;
/**
* 登录类型 0:商户登录 1:员工登录
*/
loginType: number | null;
/**
* 密码
*/
password: null | string;
/**
* 用户名
*/
username: null | string;
/**
* 验证码uid
*/
uuid: null | string;
[property: string]: any;
}
/** 登录响应 */
export interface LoginResult {
/** 访问令牌 */
token: string;
/**
* token信息
*
* CzgResult«LoginVO»
*/
export interface loginResponse {
code?: number | null;
data?: LoginVO;
msg?: null | string;
[property: string]: any;
}
/** 验证码信息 */
export interface CaptchaInfo {
/** 验证码缓存uuid */
uuid: string;
/** 验证码图片Base64字符串 */
code: string;
/**
* LoginVO
*/
export interface LoginVO {
/**
* 登录类型0商户 1员工
*/
loginType?: number | null;
/**
* 接口权限集
*/
promissionList?: string[] | null;
/**
* 店铺信息
*/
shopInfo?: TbShopInfo;
/**
* token信息
*/
tokenInfo?: SaTokenInfo;
[property: string]: any;
}
/**
* 店铺信息
*
* TbShopInfo
*/
export interface TbShopInfo {
/**
* 详细地址
*/
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;
/**
* 是否允许会员自定义金额 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;
}
/**
* token信息
*
* SaTokenInfo
*/
export interface SaTokenInfo {
/**
* 此 token 是否已经登录
*/
isLogin?: boolean | null;
/**
* 登录设备类型
*/
loginDevice?: null | string;
/**
* 此 token 对应的 LoginId未登录时为 null
*/
loginId?: { [key: string]: any };
/**
* 多账号体系下的账号类型
*/
loginType?: null | string;
/**
* Account-Session 剩余有效时间(单位: 秒)
*/
sessionTimeout?: number | null;
/**
* 自定义数据(暂无意义,留作扩展)
*/
tag?: null | string;
/**
* token 距离被冻结还剩多少时间(单位: 秒)
*/
tokenActiveTimeout?: number | null;
/**
* token 名称
*/
tokenName?: null | string;
/**
* Token-Session 剩余有效时间(单位: 秒)
*/
tokenSessionTimeout?: number | null;
/**
* token 剩余有效期(单位: 秒)
*/
tokenTimeout?: number | null;
/**
* token 值
*/
tokenValue?: null | string;
[property: string]: any;
}

43
src/api/account/menu.ts Normal file
View File

@@ -0,0 +1,43 @@
import request from "@/utils/request";
const baseURL = "account/admin/";
const MenuApi = {
/** 获取当前用户菜单列表*/
getRoutes() {
return request<any, RouteVO>({
url: `${baseURL}menus`,
method: "get",
});
},
};
export default MenuApi;
/** RouteVO路由对象 */
export interface RouteVO {
/** 子路由列表 */
children: RouteVO[];
/** 组件路径 */
component?: string;
/** 路由属性 */
meta?: Meta;
/** 路由名称 */
name?: string;
/** 路由路径 */
path?: string;
/** 跳转链接 */
redirect?: string;
}
/** Meta路由属性 */
export interface Meta {
/** 【目录】只有一个子路由是否始终显示 */
alwaysShow?: boolean;
/** 是否隐藏(true-是 false-否) */
hidden?: boolean;
/** ICON */
icon?: string;
/** 【菜单】是否开启页面缓存 */
keepAlive?: boolean;
/** 路由title */
title?: string;
}

60
src/api/account/shop.ts Normal file
View File

@@ -0,0 +1,60 @@
import request from "@/utils/request";
const baseURL = "account/admin/shopInfo";
const ShopApi = {
/** 获取店铺列表*/
getList(params: PageQuery) {
return request<any, ShopInfoEditDTO[]>({
url: `${baseURL}`,
method: "get",
params: params,
});
},
add(data: ShopInfoEditDTO) {
return request<any, ShopInfoEditDTO>({
url: `${baseURL}`,
method: "post",
data,
});
},
edit(data: ShopInfoEditDTO) {
return request<any, ShopInfoEditDTO>({
url: `${baseURL}`,
method: "put",
data,
});
},
};
export default ShopApi;
/**
* ShopInfoEditDTO
*/
export interface ShopInfoEditDTO {
accountName?: null | string;
accountPwd?: null | string;
activateCode?: null | string;
address?: null | string;
chainName?: null | string;
detail?: null | string;
frontImg?: null | string;
id: number | null;
lat?: null | string;
lng?: null | string;
logo?: null | string;
phone?: null | string;
profiles?: null | string;
roleId?: number | null;
shopName?: null | string;
shopType?: null | string;
[property: string]: any;
}
export interface PageQuery {
page: number;
shopName?: string;
size: number;
status?: number;
[property: string]: any;
}