- 新增 .editorconfig 文件统一代码风格配置 - 新增 .env 环境变量配置文件 - 添加开发和生产环境的环境变量配置 - 配置 ESLint 忽略规则文件 - 设置代码检查配置文件 .eslintrc.js - 添加 Git 忽略文件规则 - 创建 Prettier 格式化忽略规则 - 添加隐私政策和服务协议HTML文件 - 实现访问密钥编辑组件基础结构
43 lines
908 B
TypeScript
43 lines
908 B
TypeScript
// 获取商户ID
|
|
export const getMerchantId = () => {
|
|
const merchantId = localStorage.getItem('MerchantId');
|
|
if (merchantId) {
|
|
return Number(merchantId);
|
|
}
|
|
return undefined;
|
|
};
|
|
|
|
// 获取商户名称
|
|
export const getMerchantName = () => {
|
|
const MerchantName = localStorage.getItem('MerchantName');
|
|
if (MerchantName) {
|
|
return MerchantName;
|
|
}
|
|
return undefined;
|
|
};
|
|
|
|
// 获取商户Logo
|
|
export const getMerchantAvatar = () => {
|
|
const MerchantLogo = localStorage.getItem('MerchantLogo');
|
|
if (MerchantLogo) {
|
|
return MerchantLogo;
|
|
}
|
|
return undefined;
|
|
};
|
|
|
|
export const getRoleIdByMerchant = () => {
|
|
const id = localStorage.getItem('RoleIdByMerchant');
|
|
if (id) {
|
|
return Number(id);
|
|
}
|
|
return undefined;
|
|
};
|
|
|
|
export const getRoleNameByMerchant = () => {
|
|
const name = localStorage.getItem('RoleNameByMerchant');
|
|
if (name) {
|
|
return name;
|
|
}
|
|
return undefined;
|
|
};
|