提交 4bc35ef1 authored 作者: vipcxj's avatar vipcxj

fix: 修复storybook的登录错误

上级 b83a5d91
...@@ -13,13 +13,14 @@ import TableInput from '../src/components/table/input-table'; ...@@ -13,13 +13,14 @@ import TableInput from '../src/components/table/input-table';
import { makeCancelable } from '../src/utils/promise'; import { makeCancelable } from '../src/utils/promise';
import { login } from '../src/services/login'; import { login } from '../src/services/login';
import { switchDomain } from '../src/services/domain'; import { switchDomain } from '../src/services/domain';
import { setToken, setUser } from '../src/utils/auth'; import { setToken } from '../src/utils/auth';
const loginIt = async (userName, password, domainPath) => { const loginIt = async (userName, password, domainPath) => {
const result = await login({ userName, password }); const type = 'userName';
const { tokenId, userId } = result; const authType = 'password';
const result = await login({ type, authType, userName, password });
const { tokenId } = result;
await setToken(tokenId); await setToken(tokenId);
await setUser(userId, userName);
await switchDomain(domainPath); await switchDomain(domainPath);
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论