| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- import service from '@/services'
- import http from '@/services/http'
- import { RequestConfig } from '@/services/http/types'
- import { useGlobalStore, useLoginStore } from '@/stores'
- const globalStore = useGlobalStore()
- const loginStore = useLoginStore()
- /**
- * 账户登录
- */
- export function wsLogin(data: Proto.LoginReq) {
- return http.mqRequest<Proto.LoginRsp>({
- data,
- requestCode: 'LoginReq',
- responseCode: 'LoginRsp'
- })
- }
- /**
- * 账户登录
- */
- export function httpLogin(config: RequestConfig<Model.LoginReq> = {}) {
- return http.goRequest<Model.LoginRsp>({
- method: 'post',
- url: '/Account/Login',
- data: config.data,
- })
- }
- /**
- * 用户登出
- */
- export function logout(config: RequestConfig = {}) {
- return http.goRequest<Model.LoginRsp>({
- url: '/Account/Loginout',
- params: config.data,
- })
- }
- /**
- * Token校验
- */
- export function tokenCheck() {
- if (globalStore.getSystemInfo('tradeChannel') === 'ws') {
- return http.mqRequest<Proto.TokenCheckRsp>({
- data: <Proto.TokenCheckReq>{
- LoginID: loginStore.loginId,
- Token: loginStore.token
- },
- requestCode: 'TokenCheckReq',
- responseCode: 'TokenCheckRsp'
- })
- }
- return http.goRequest({
- url: '/Account/TokenCheck'
- })
- }
- /**
- * 查询账户菜单
- */
- export function queryAccountMenu(config: RequestConfig = {}) {
- return http.request<Model.UserRoutes[]>({
- url: './config/router.json',
- params: config.data,
- })
- }
- /**
- * 查询登录ID
- */
- export function queryLoginId(config: RequestConfig<{ username: string }> = {}) {
- return http.commonRequest<string>({
- url: '/User/GetLoginID',
- params: config.data,
- }, 'GetLoginID')
- }
- /**
- * 查询登录账户配置信息
- */
- export function queryLoginData(config: RequestConfig<Model.LoginQueryReq> = {}) {
- return http.commonRequest<Model.LoginQueryRsp>({
- url: '/User/LoginQuery',
- params: config.data,
- }, 'LoginQuery')
- }
- /**
- * 获取用户账号信息
- */
- export function queryUserAccount(config: RequestConfig<{ userID: number }> = {}) {
- return http.commonRequest<Model.UserAccount>({
- url: '/User/GetUserAccount',
- params: {
- userID: loginStore.userId,
- ...config.data
- },
- }, 'GetUserAccount')
- }
- /**
- * 查询资金账户信息
- */
- export function queryTaAccounts(config: RequestConfig<Model.TaAccountsReq> = {}) {
- return http.commonRequest<Model.TaAccountsRsp[]>({
- url: '/TaAccount/GetTaAccounts',
- params: config.data,
- }, 'GetTaAccounts')
- }
- /**
- * 查询账户角色
- */
- export function queryAccountRole(config: RequestConfig = {}) {
- return http.commonRequest<Model.UserRole[]>({
- url: '/account/role',
- params: config.data,
- })
- }
- /**
- * 查询实名认证信息
- */
- export function queryWrDraftUserInfo(config: RequestConfig<Model.WrDraftUserInfoReq> = {}) {
- return http.commonRequest<Model.UserInfo[]>({
- url: '/WrTrade2/QueryWrDraftUserInfo',
- params: config.data,
- })
- }
- /**
- * 实名认证请求
- */
- export function requestAddAuth(config: RequestConfig<Model.AddAuthReq> = {}) {
- return http.request<Model.AddAuthRsp>({
- method: 'post',
- url: service.getConfig('openApiUrl') + '/onlineopen/userInfo/addAuth',
- data: config.data,
- })
- }
- /**
- * 投资者销户申请
- */
- export function investorDel(config: RequestConfig<Proto.InvestorDelReq>) {
- return http.mqRequest<Proto.InvestorDelRsp>({
- data: config.data,
- requestCode: 'InvestorDelReq',
- responseCode: 'InvestorDelRsp',
- })
- }
- /**
- * 修改密码
- */
- export function modifyPassword(config: RequestConfig<Proto.ModifyPwdReq>) {
- return http.mqRequest<Proto.ModifyPwdRsp>({
- data: config.data,
- requestCode: 'ModifyPwdReq',
- responseCode: 'ModifyPwdRsp',
- })
- }
- /**
- * 实名认证添加用户
- */
- export function requestAddUser(config: RequestConfig<Model.AddUserReq> = {}) {
- return http.goRequest<Model.AddUserRsp>({
- method: 'post',
- url: '/Account/AddUser',
- data: config.data,
- })
- }
- /**
- * 查询用户电子签记录表
- */
- export function queryUserESignRecord(config: RequestConfig<Model.UserESignRecordReq> = {}) {
- return http.goRequest<Model.UserESignRecordRsq[]>({
- method: 'get',
- url: '/Account/QueryUserESignRecord',
- params: config.data,
- })
- }
- /**
- * 上传待签署文件和添加签署方
- */
- export function requestCreateContractAndAddSigner(config: RequestConfig<Model.ContractAndAddSignerReq> = {}) {
- return http.goRequest<Model.ContractAndAddSignerRsq>({
- method: 'post',
- url: '/Account/CreateContractAndAddSigner',
- data: config.data,
- })
- }
- /**
- * 提交实名认证
- */
- export function requestSignCompleted(config: RequestConfig<Model.ContractAndAddSignerReq> = {}) {
- return http.goRequest<Model.ContractAndAddSignerRsq>({
- method: 'post',
- url: '/Account/SignCompleted',
- data: config.data,
- })
- }
- /**
- * 个人意愿核身认证
- */
- export function requestWillFace(config: RequestConfig<Model.WillFaceReq> = {}) {
- return http.goRequest<Model.WillFaceRsq>({
- method: 'post',
- url: '/Account/WillFace',
- data: config.data,
- })
- }
- /**
- * 证件号重复校验
- */
- export function requestCheckCardNum(config: RequestConfig<Model.CheckCardNumReq> = {}) {
- return http.request<Model.CheckCardNumRsp>({
- method: 'get',
- url: service.getConfig('openApiUrl') + '/onlineopen/userInfo/checkCardNum',
- params: {
- userid: loginStore.userId,
- ...config.data
- },
- })
- }
- /**
- * 查询用户电子签记录表
- */
- export function queryTencentUsereSignRecords(config: RequestConfig<Model.TencentUsereSignRecordsReq> = {}) {
- return http.commonRequest<Model.TencentUsereSignRecordsRsq[]>({
- method: 'get',
- url: '/Tencent/QueryUsereSignRecords',
- params: config.data,
- }, 'QueryUsereSignRecords')
- }
- /**
- * 通过合同名和模板 id 直接发起签署流程
- */
- export function requestCreateFlowByTemplateDirectly(config: RequestConfig<Model.CreateFlowByTemplateDirectlyReq> = {}) {
- return http.commonRequest<Model.CreateFlowByTemplateDirectlyRsq>({
- method: 'post',
- url: '/Tencent/CreateFlowByTemplateDirectly',
- data: config.data,
- }, 'CreateFlowByTemplateDirectly')
- }
- /**
- * 按用户 ID 和机构 ID 创建腾讯电子签业务信息
- */
- export function requestInitTencentESS(config: RequestConfig<Model.InitTencentESSReq> = {}) {
- return http.commonRequest<Model.InitTencentESSRsp>({
- method: 'post',
- url: '/Tencent/InitTencentESS',
- data: config.data,
- })
- }
|