完成商城下单功能

This commit is contained in:
gxwebsoft
2024-05-27 01:24:02 +08:00
parent dea6ae1c23
commit 4bae8599e1
26 changed files with 803 additions and 129 deletions
+1 -25
View File
@@ -326,35 +326,11 @@ export const decrypt = (encrypt) => {
// 获取商户ID
export const getMerchantId = () => {
// 读取商户账号
const merchantId = localStorage.getItem('MerchantId');
const userId = localStorage.getItem('UserId');
if (Number(userId) == 3731) {
return undefined;
}
if (merchantId) {
return Number(merchantId);
}
// const tenantStore = useTenantStore();
// console.log(tenantStore);
// tenantStore.setMerchant({
// merchantId: merchantAccount.merchantId,
// merchantName: merchantAccount.merchantName
// });
// const phone = String(localStorage.getItem('Phone'));
// listMerchantAccount({ phone }).then((list) => {
// if (list.length == 0) {
// return;
// }
// const merchantAccount = list[0];
// const tenantStore = useTenantStore();
// tenantStore.setMerchant({
// merchantId: merchantAccount.merchantId,
// merchantName: merchantAccount.merchantName
// });
// localStorage.setItem('MerchantId', merchantAccount.merchantId + '');
// });
// return Number(merchantId);
return undefined;
};
// 获取当前登录用户ID
+6 -6
View File
@@ -1,17 +1,17 @@
// 获取商户ID
export const getMerchantId = () => {
const MerchantId = localStorage.getItem('MerchantId');
if (MerchantId != 'null') {
return MerchantId;
const merchantId = localStorage.getItem('MerchantId');
if (merchantId) {
return Number(merchantId);
}
return null;
return undefined;
};
// 获取商户名称
export const getMerchantName = () => {
const MerchantName = localStorage.getItem('MerchantName');
if (MerchantName != 'null') {
if (MerchantName) {
return MerchantName;
}
return null;
return undefined;
};