huangbin 4 vuotta sitten
vanhempi
commit
4c4bf37be5

+ 9 - 4
src/services/bus/user.ts

@@ -1,9 +1,9 @@
 import APP from '@/services';
-import { Arearole } from '../go/useInfo/interface';
+import { Arearole, Ermcp3RootUserAccount } from '../go/useInfo/interface';
 
 /**
  * 获取用户账户类型
- * @returns 
+ * @returns
  */
 export function getUserAccountType() {
     return APP.get('userAccount').usertype
@@ -18,14 +18,14 @@ export function getUserInfo() {
 
 /**
  * 获取用户名
- * @returns 
+ * @returns
  */
 export function getUserName() {
     return getUserInfo().customername
 }
 
 /**
- * 获取用户id 
+ * 获取用户id
  * 登录中也写了一个 获取用户id的方法,那个方法是在登录信息里面获取用户id,这个方法是在go服务修改登录请求方法,返回用户信息,后期有时间进行优化
  */
 export function getUsrId() {
@@ -55,4 +55,9 @@ export function getAoletype_string(): string {
     return APP.get('areaRoles').reduce((acc: string, cur: Arearole) => {
         return acc ? `${acc},${cur.roletype}` : `${cur.roletype}`
     }, '')
+}
+
+export function getRootUserInfo(): Ermcp3RootUserAccount | undefined {
+    const temp = APP.get('RootUser');
+    return temp.length ? temp[0] : undefined
 }

+ 1 - 0
src/services/dataCenter/index.ts

@@ -27,6 +27,7 @@ const needClearSourceData: NeedClearSourceDataType = {
     accountList: [],
     selectedAccount: new SelectedAccountModel(),
     quoteDayInfo: [],
+    RootUser: [],
 };
 
 /**

+ 1 - 0
src/services/dataCenter/interface.ts

@@ -41,6 +41,7 @@ export interface NeedClearSourceDataType {
     accountList: AccountListItem[]; // 资金账户列表
     selectedAccount: AccountListItem; // 当前选中的资金账号
     quoteDayInfo: advert.QueryQuoteDayRsp[]; // 行情盘面信息
+    RootUser: useInfo.Ermcp3RootUserAccount[],
 }
 
 export { advert };

+ 3 - 4
src/services/go/useInfo/index.ts

@@ -3,7 +3,6 @@ import { getLongTypeLoginID } from '@/services/bus/login';
 import { getUsrId } from '@/services/bus/user';
 import { commonSearch_go } from '../index';
 import * as type from './interface';
-import { Ermcp3RootUserAccount } from "./interface";
 
 /**
  * 获取登录ID
@@ -69,11 +68,11 @@ export function QueryUserInfo(userID: number, isDecrypt?: boolean): Promise<type
  * 查询顶级用户信息
  * /Ermcp3/QueryRootUserAccount
  */
-export function QueryRootUserAccount(): Promise<Ermcp3RootUserAccount> {
+export function QueryRootUserAccount(): Promise<string> {
     const userid = getUsrId()
     return commonSearch_go('/Ermcp3/QueryRootUserAccount', { userid }).then(res => {
-        console.log('查询顶级用户信息', res)
-        return res
+        APP.set('RootUser', res);
+        return 'ok'
     }).catch((err) => {
         throw new Error(`查询顶级用户信息: ${err}`);
     });