瀏覽代碼

网关登陆增加字段

main
郑州 3 年之前
父節點
當前提交
391024b9c7
共有 2 個檔案被更改,包括 15 行新增8 行删除
  1. +2
    -2
      src/services/system.ts
  2. +13
    -6
      src/services/user.ts

+ 2
- 2
src/services/system.ts 查看文件

@@ -45,10 +45,10 @@ const system = {
}, },
/* 发往网关的请求 */ /* 发往网关的请求 */
// 登陆 // 登陆
login: async (userId: string, userPhone: string) => {
login: async (userId: string, userPhone: string, api: string) => {
const res = await fetchLocalApi<null>( const res = await fetchLocalApi<null>(
'login', 'login',
{ userId, userPhone },
{ userId, userPhone, api },
{ silent: true }, { silent: true },
); );
sendSocketMessage(`login:${userPhone}`); sendSocketMessage(`login:${userPhone}`);


+ 13
- 6
src/services/user.ts 查看文件

@@ -34,16 +34,23 @@ export async function login(account: string, password: string) {
return errorReponse('该账号没有访问权限'); return errorReponse('该账号没有访问权限');
} }


const systemLoginRes = await system.login(res.data.id, res.data.phone);
const companyInfoRes = await fetchApi(
'company/queryFrontDeskCompanyById',
{ id: userData.companyId },
{ silent: true },
);
if (!isReqSuccess(companyInfoRes)) {
return companyInfoRes;
}
const systemLoginRes = await system.login(
res.data.id,
res.data.phone,
companyInfoRes.data?.company?.IpfsApi || '',
);
if (!isReqSuccess(systemLoginRes)) { if (!isReqSuccess(systemLoginRes)) {
return errorReponse('本地网管通讯失败'); return errorReponse('本地网管通讯失败');
} }


// const companyInfoRes = await fetchApi('company/queryFrontDeskCompanyById', { id: userData.companyId }, { silent: true });
// if (!isReqSuccess(companyInfoRes)) {
// return companyInfoRes;
// }

// const { data: { company: { SoftwareVersion } = {} } = {} } = companyInfoRes; // const { data: { company: { SoftwareVersion } = {} } = {} } = companyInfoRes;


// 角色判断 // 角色判断


Loading…
取消
儲存