|
@@ -9,6 +9,7 @@ export class EsDictService {
|
|
|
baseUrl: object;
|
|
|
@InjectClient(HttpServiceFactory, 'default')
|
|
|
serviceAxios: HttpService;
|
|
|
+
|
|
|
async getDictContent() {
|
|
|
const reqConfig: any = {
|
|
|
url: `${this.baseUrl}/cxyy/es/dict/remote`,
|
|
@@ -23,6 +24,22 @@ export class EsDictService {
|
|
|
console.log(error);
|
|
|
}
|
|
|
}
|
|
|
+ async getStopDictContent() {
|
|
|
+ const reqConfig: any = {
|
|
|
+ url: `${this.baseUrl}/cxyy/es/dict/stop/remote`,
|
|
|
+ method: 'Get',
|
|
|
+ };
|
|
|
+ try {
|
|
|
+ const res = await this.serviceAxios.request(reqConfig);
|
|
|
+ if (res.status !== 200) throw new ServiceError(ErrorCode.REQUSET_ERROR);
|
|
|
+ const data = get(res, 'data.data');
|
|
|
+ return data;
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
randomStr(len = 6) {
|
|
|
return Math.random().toString(36).slice(-len);
|
|
|
}
|