|
@@ -2,6 +2,18 @@ import request from '/@/api/http/request';
|
|
|
import { getWorkspaceId } from '/@/utils/index';
|
|
import { getWorkspaceId } from '/@/utils/index';
|
|
|
|
|
|
|
|
// Api参数类型
|
|
// Api参数类型
|
|
|
|
|
+export type CreateDeviceFeedbackApiParams = {
|
|
|
|
|
+ logsInfo: string,
|
|
|
|
|
+ happenTime: number,
|
|
|
|
|
+ contactNumber?: string,
|
|
|
|
|
+ contactEmail?: string,
|
|
|
|
|
+ ossIds?: string,
|
|
|
|
|
+ list?: {
|
|
|
|
|
+ list: any[],
|
|
|
|
|
+ module: string,
|
|
|
|
|
+ }[],
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
export type SignLoginApiParams = {
|
|
export type SignLoginApiParams = {
|
|
|
username: string,
|
|
username: string,
|
|
|
client_id: string,
|
|
client_id: string,
|
|
@@ -77,6 +89,7 @@ export type FetchPilotPasswordApiParams = {
|
|
|
|
|
|
|
|
// Api函数类型
|
|
// Api函数类型
|
|
|
export type FetchDeviceLogListApi = (sn: string, params: { domain_list: number }) => Promise<any>;
|
|
export type FetchDeviceLogListApi = (sn: string, params: { domain_list: number }) => Promise<any>;
|
|
|
|
|
+export type CreateDeviceFeedbackApi = (sn: string, data: CreateDeviceFeedbackApiParams) => Promise<any>;
|
|
|
export type SignLoginApi = (data: SignLoginApiParams) => Promise<any>;
|
|
export type SignLoginApi = (data: SignLoginApiParams) => Promise<any>;
|
|
|
export type FetchDeviceModelApi = (params?: { flg: boolean }) => Promise<any>;
|
|
export type FetchDeviceModelApi = (params?: { flg: boolean }) => Promise<any>;
|
|
|
export type FetchDeviceStatusApi = (params: { snList: string }) => Promise<any>;
|
|
export type FetchDeviceStatusApi = (params: { snList: string }) => Promise<any>;
|
|
@@ -108,6 +121,12 @@ const fetchDeviceLogListApi: FetchDeviceLogListApi = async (sn, params) => {
|
|
|
return res.data;
|
|
return res.data;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 创建设备异常反馈
|
|
|
|
|
+const createDeviceFeedbackApi: CreateDeviceFeedbackApi = async (sn, data) => {
|
|
|
|
|
+ const res = await request.post(`/manage/api/v1/workspaces/${getWorkspaceId()}/devices/${sn}/createLogs`, data);
|
|
|
|
|
+ return res.data;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 密钥登录
|
|
// 密钥登录
|
|
|
const signLoginApi: SignLoginApi = async (data) => {
|
|
const signLoginApi: SignLoginApi = async (data) => {
|
|
|
const res = await request.post('/manage/api/v1/signLogin', data);
|
|
const res = await request.post('/manage/api/v1/signLogin', data);
|
|
@@ -243,6 +262,7 @@ const fetchPilotPasswordApi: FetchPilotPasswordApi = async (params) => {
|
|
|
|
|
|
|
|
export const apis = {
|
|
export const apis = {
|
|
|
fetchDeviceLogList: fetchDeviceLogListApi,
|
|
fetchDeviceLogList: fetchDeviceLogListApi,
|
|
|
|
|
+ createDeviceFeedback: createDeviceFeedbackApi,
|
|
|
signLogin: signLoginApi,
|
|
signLogin: signLoginApi,
|
|
|
fetchDeviceModel: fetchDeviceModelApi,
|
|
fetchDeviceModel: fetchDeviceModelApi,
|
|
|
fetchDeviceStatus: fetchDeviceStatusApi,
|
|
fetchDeviceStatus: fetchDeviceStatusApi,
|