| | |
| | | apiCount: { |
| | | agv_state: 0, |
| | | laser_data: 0, |
| | | current_teaching:0 |
| | | current_teaching: 0 |
| | | }, |
| | | |
| | | parseJson(str) { |
| | | try { |
| | | const obj = JSON.parse(str) |
| | | return obj |
| | | } catch (ex) { |
| | | return undefined |
| | | } |
| | | }, |
| | | addLog(item) { |
| | | if (!getApp().globalData.withLog) { |
| | | return |
| | | } |
| | | if (item.statusCode == 200) { |
| | | const ret = JSON.parse(item.data) |
| | | if (ret.code == 0) { |
| | | const ret = this.parseJson(item.data) |
| | | if (ret?.code === 0) { |
| | | if (item.url.indexOf("get_agv_state") > 0) { |
| | | |
| | | if (this.apiCount.agv_state % 20 != 0) { |
| | |
| | | this.apiCount.agv_state = 1; |
| | | } |
| | | if (item.url.indexOf("get_current_teaching_data") > 0) { |
| | | |
| | | |
| | | if (this.apiCount.current_teaching % 20 != 0) { |
| | | this.apiCount.current_teaching++; |
| | | return |
| | | } |
| | | this.apiCount.current_teaching = 1; |
| | | } |
| | | |
| | | |
| | | // if (item.url.indexOf("laser_data") > 0) { |
| | | |
| | | // if (ret.data?.base_map?.image_base64) { |
| | |
| | | } |
| | | const list = session.getValue("request_log") || [] |
| | | |
| | | |
| | | list.unshift(item) |
| | | |
| | | if (list.length > 512) { |
| | |
| | | options.method = options.method || this.common.method; |
| | | options.dataType = options.dataType || this.common.dataType; |
| | | |
| | | if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf("laser_data") < 0 |
| | | && options.url.indexOf("taskGroupStatus") < 0 &&options.url.indexOf("get_current_teaching_data") < 0) { |
| | | if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf("laser_data") < 0 && |
| | | options.url.indexOf("taskGroupStatus") < 0 && options.url.indexOf("get_current_teaching_data") < 0) { |
| | | console.log("url", options.url, options.data) |
| | | } |
| | | return new Promise((resolve, reject) => { |
| | |
| | | method: options.method, |
| | | dataType: options.dataType, |
| | | success: (result) => { |
| | | if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf("laser_data") < 0 |
| | | && options.url.indexOf("taskGroupStatus") < 0 &&options.url.indexOf("get_current_teaching_data") < 0) { // |
| | | if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf( |
| | | "laser_data") < 0 && |
| | | options.url.indexOf("taskGroupStatus") < 0 && options.url.indexOf( |
| | | "get_current_teaching_data") < 0) { // |
| | | console.log("result", result) |
| | | } |
| | | |