| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import APP from '@/services';
- import { getLongTypeLoginID } from '@/services/bus/login';
- import { commonSearch_go } from '../index';
- import * as type from './interface';
- /**
- * 获取登录ID
- * @param username 可传入“登录账号”、“登录代码”和“手机号码”
- * @returns
- */
- export function GetLoginID(username: string): Promise<string> {
- return commonSearch_go('/User/GetLoginID', { username })
- }
- /**
- * 获取用户账号信息
- * @param username 用户ID
- * @returns
- */
- export function GetUserAccount(userID: number): Promise<type.GetUserAccount> {
- return commonSearch_go('/User/GetUserAccount', { userID })
- }
- /**
- * 账户登录后信息查询
- * @param loginID 登录账号
- * @returns
- */
- export function LoginQuery(): Promise<type.LoginQueryRsp> {
- const id = getLongTypeLoginID();
- return commonSearch_go('/User/LoginQuery', { loginID: Number(id) }).then(res => {
- const { externalExchanges,
- goodsgroups,
- loginAccount,
- markets,
- systemParams,
- userAccount,
- userInfo,
- username } = res;
- externalExchanges && APP.set('externalexchange', externalExchanges);
- goodsgroups && APP.set('goodsgroups', goodsgroups);
- loginAccount && APP.set('loginAccount', loginAccount);
- markets && APP.set('markets', markets);
- systemParams && APP.set('systemParams', systemParams);
- userAccount && APP.set('userAccount', userAccount);
- userInfo && APP.set('userInfo', userInfo);
- username && APP.set('username', username);
- console.log('LoginQuery', res);
- return res
- })
- }
- /**
- * 获取用户信息
- * @param loginID 登录账号
- * @returns
- */
- export function QueryUserInfo(userID: number, isDecrypt?: boolean): Promise<type.Userinfo> {
- const param = isDecrypt ? { isDecrypt, userID } : { userID }
- return commonSearch_go('/User/QueryUserInfo', param)
- }
|