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

321

parent 7f77054c
...@@ -4,12 +4,17 @@ import axios, { AxiosInstance } from "axios" ...@@ -4,12 +4,17 @@ import axios, { AxiosInstance } from "axios"
import router from '@/router' import router from '@/router'
import { Toast } from 'vant' import { Toast } from 'vant'
import { generateToken } from "@/util/Sign";
const Account = {
entId: '166910771849072640',
staffId: '1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR'
}
interface RouterConfig{ interface RouterConfig{
path: string path: string
method?: string method?: string
crediential?: boolean crediential?: boolean
dataType?: string
headers?:string[][] headers?:string[][]
} }
export default class BaseService { export default class BaseService {
...@@ -32,7 +37,7 @@ export default class BaseService { ...@@ -32,7 +37,7 @@ export default class BaseService {
let token; let token;
let headerItems:{[key:string]:string|number} ={} let headerItems:{[key:string]:string|number} ={}
if(!routerConfig.method) routerConfig.method = 'post' if(!routerConfig.method) routerConfig.method = 'post'
if(routerConfig.crediential) token = 'MOCK' if(routerConfig.crediential) token = "MOCK"
switch(routerConfig.method){ switch(routerConfig.method){
case 'post': case 'post':
routerConfig.crediential&&Object.assign(headerItems,{'FZM-SIGNATURE':token}) routerConfig.crediential&&Object.assign(headerItems,{'FZM-SIGNATURE':token})
......
import Department from './moudles/Department'
import Enterprise from './moudles/Enterprise' import Enterprise from './moudles/Enterprise'
import Staff from './moudles/Staff' import Staff from './moudles/Staff'
export const service = { export const service = {
staff: new Staff(), staff: new Staff(),
enterprise: new Enterprise(), 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 BaseService from '../base'
import { AcceptJoinDTO } from './Enterprise.dto' import { AcceptJoinDTO } from './service.dto'
export default class Enterprise extends BaseService { export default class Enterprise extends BaseService {
router= { 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'}, create:{ path:'/v1/enterprise/create'},
delete:{ path:'/v1/enterprise/delete'}, delete:{ path:'/v1/enterprise/delete'},
info:{ path:'/v1/enterprise/info'}, info:{ path:'/v1/enterprise/info'},
......
...@@ -10,4 +10,11 @@ export interface AcceptJoinDTO{ ...@@ -10,4 +10,11 @@ export interface AcceptJoinDTO{
"phone": string, "phone": string,
"position": string "position": string
} }
\ No newline at end of file
export interface GetSub{
"entId": string,
"hasStaff"?: boolean,
"isDirect"?: boolean,
"parentId": string
}
...@@ -28,9 +28,9 @@ export interface Account { ...@@ -28,9 +28,9 @@ export interface Account {
mnemonic?: string mnemonic?: string
address: string address: string
privateKey: Uint8Array privateKey: Uint8Array
privateKeyHex: string privateKeyHex?: string
publicKey: Uint8Array publicKey: Uint8Array
publicKeyHex: string publicKeyHex?: string
} }
......
...@@ -61,6 +61,14 @@ export default Vue.extend({ ...@@ -61,6 +61,14 @@ export default Vue.extend({
// console.log(Mock, 'mock') // console.log(Mock, 'mock')
this.showRadio = this.$route.query.transfer === '1' this.showRadio = this.$route.query.transfer === '1'
}, },
mounted(){
let res = this.$service.department.getSub({
entId:'166910771849072640',
parentId:'166910771849072641'
})
console.log(res);
},
data() { data() {
return { return {
title: '导航', 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