Commit 75dc9b12 authored by hanfeng zhang's avatar hanfeng zhang

321

parent 7f77054c
......@@ -4,12 +4,17 @@ import axios, { AxiosInstance } from "axios"
import router from '@/router'
import { Toast } from 'vant'
import { generateToken } from "@/util/Sign";
const Account = {
entId: '166910771849072640',
staffId: '1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR'
}
interface RouterConfig{
path: string
method?: string
crediential?: boolean
dataType?: string
headers?:string[][]
}
export default class BaseService {
......@@ -32,7 +37,7 @@ export default class BaseService {
let token;
let headerItems:{[key:string]:string|number} ={}
if(!routerConfig.method) routerConfig.method = 'post'
if(routerConfig.crediential) token = 'MOCK'
if(routerConfig.crediential) token = "MOCK"
switch(routerConfig.method){
case 'post':
routerConfig.crediential&&Object.assign(headerItems,{'FZM-SIGNATURE':token})
......
import Department from './moudles/Department'
import Enterprise from './moudles/Enterprise'
import Staff from './moudles/Staff'
export const service = {
staff: new Staff(),
enterprise: new Enterprise(),
department: new Department(),
}
......
import BaseService from '../base'
import { AcceptJoinDTO, GetSub } from './service.dto'
export default class Enterprise extends BaseService {
router= {
getsub:{ path:'/v1/department/get-sub-dep',crediential:true}
}
constructor(){
super()
}
/**
* @param {AcceptJoinDTO} data {AcceptJoinDTO}
* @returns
*/
async getSub(data:GetSub){
return await this.useService(this.router.getsub,data)
}
}
import BaseService from '../base'
import { AcceptJoinDTO } from './Enterprise.dto'
import { AcceptJoinDTO } from './service.dto'
export default class Enterprise extends BaseService {
router= {
accept:{ path:'/v1/enterprise/accept-join',headers:[['df','1'],['sdfsdfl','dsfsd']]},
accept:{ path:'/v1/enterprise/accept-join',headers:[['df','1']]},
create:{ path:'/v1/enterprise/create'},
delete:{ path:'/v1/enterprise/delete'},
info:{ path:'/v1/enterprise/info'},
......
......@@ -11,3 +11,10 @@ export interface AcceptJoinDTO{
"position": string
}
export interface GetSub{
"entId": string,
"hasStaff"?: boolean,
"isDirect"?: boolean,
"parentId": string
}
......@@ -28,9 +28,9 @@ export interface Account {
mnemonic?: string
address: string
privateKey: Uint8Array
privateKeyHex: string
privateKeyHex?: string
publicKey: Uint8Array
publicKeyHex: string
publicKeyHex?: string
}
......
......@@ -61,6 +61,14 @@ export default Vue.extend({
// console.log(Mock, 'mock')
this.showRadio = this.$route.query.transfer === '1'
},
mounted(){
let res = this.$service.department.getSub({
entId:'166910771849072640',
parentId:'166910771849072641'
})
console.log(res);
},
data() {
return {
title: '导航',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment