parent
5461b2241b
commit
47c51fb5fa
@ -0,0 +1,11 @@ |
||||
import { RequestHandler, RequestInterface } from '@/api/HttpClient' |
||||
|
||||
export class TokenRequestHandler extends RequestHandler { |
||||
handle = (request: RequestInterface): void => { |
||||
request.headers = request.headers || {} |
||||
request.headers['x-token'] = 'GxwGRM' |
||||
console.log(request, 'DeviceIdHandler') |
||||
} |
||||
} |
||||
|
||||
export default new TokenRequestHandler() |
@ -1,11 +1,18 @@ |
||||
import { HttpClient as BaseClient } from '../../api/HttpClient' |
||||
import MocksSchema, { MockConfigurationsRequest } from '../../api/Main/Schemas/MocksSchema' |
||||
import { SchemaInterface } from '@/api/SchemaInterface' |
||||
import { TokenRequestHandler } from '@/api/Handlers/TokenRequestHandler' |
||||
import AddMockSchema, { AddMockConfigurationsRequest } from '@/api/Main/Schemas/AddMockSchema' |
||||
|
||||
export class HttpClient extends BaseClient { |
||||
mockConfigurations (data: MockConfigurationsRequest): any { |
||||
return this.send(MocksSchema as SchemaInterface, data) |
||||
} |
||||
|
||||
addMockConfigurations (data: AddMockConfigurationsRequest): any { |
||||
return this.send(AddMockSchema as SchemaInterface, data) |
||||
} |
||||
} |
||||
|
||||
export default new HttpClient('http://placetgroup.sipachev.sv') |
||||
.addHandler(new TokenRequestHandler()) |
||||
|
@ -0,0 +1,17 @@ |
||||
export class MockConfiguration { |
||||
personalCode!: string |
||||
code!: string |
||||
value!: string |
||||
active!: string |
||||
} |
||||
|
||||
export class AddMockConfigurationsRequest { |
||||
items!: MockConfiguration[] |
||||
} |
||||
|
||||
export default { |
||||
code: 'api_plugin_add_configurations', |
||||
method: 'POST', |
||||
url: '/plugin/mock-configurations', |
||||
prefix: 'mockConfigurations' |
||||
} |
@ -1,9 +1,9 @@ |
||||
export class MockConfigurationsRequest { |
||||
personalId!: string |
||||
personalCode!: string |
||||
} |
||||
|
||||
export default { |
||||
code: 'api_plugin_get_configurations', |
||||
method: 'POST', |
||||
method: 'GET', |
||||
url: '/plugin/mock-configurations' |
||||
} |
||||
|
@ -1,4 +1,4 @@ |
||||
export class Registers { |
||||
xteeMta = '' |
||||
xteePension = '' |
||||
xtee_mta = '' |
||||
xtee_pension = '' |
||||
} |
||||
|
@ -1,10 +1,10 @@ |
||||
<div> |
||||
<label> |
||||
Personal id |
||||
<input type="text" v-model="personalId"/> |
||||
<input type="text" v-model="personalCode"/> |
||||
</label> |
||||
<div v-if="personalId"> |
||||
<div v-if="personalCode"> |
||||
<hr /> |
||||
<Mocks :personalId="personalId"></Mocks> |
||||
<Mocks :personalId="personalCode"></Mocks> |
||||
</div> |
||||
</div> |
||||
|
@ -1,4 +1,4 @@ |
||||
import { FlowEnum } from '@/stubs/FlowEnum' |
||||
|
||||
export const useStub = true |
||||
export const useStub = false |
||||
export const flow = FlowEnum.base |
||||
|
Loading…
Reference in new issue