Commit 545e13c4 authored by 何虹's avatar 何虹 💬

优化bug

parent 00f788a9
...@@ -5,10 +5,11 @@ class RestFul { ...@@ -5,10 +5,11 @@ class RestFul {
this.moduleName = 'RestFulModule' this.moduleName = 'RestFulModule'
// 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY // 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY
const typeof_isService = typeof isService const typeof_isService = typeof isService
this.MODULE_API = TOOL_API
if (typeof_isService === 'boolean') { if (typeof_isService === 'boolean') {
this.MODULEAPI = isService ? SERVICE_API : TOOL_API this.MODULE_API = isService ? SERVICE_API : TOOL_API
} else if (typeof_isService === 'string' && isService) { } else if (typeof_isService === 'string' && isService) {
this.MODULEAPI = isService this.MODULE_API = isService
} }
} }
// 处理传入的data 如果有appCode dbName // 处理传入的data 如果有appCode dbName
...@@ -30,7 +31,7 @@ class RestFul { ...@@ -30,7 +31,7 @@ class RestFul {
query (data) { query (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, group, parms, bodyData, isQueryMaster } = data const { tableName, appCode, group, parms, bodyData, isQueryMaster } = data
let url = `${MODULEAPI}${appCode}/${tableName}/` let url = `${this.MODULE_API}${appCode}/${tableName}/`
if (group) { // 非标准保存 if (group) { // 非标准保存
url = `${url}${group}/` url = `${url}${group}/`
} }
...@@ -44,7 +45,7 @@ class RestFul { ...@@ -44,7 +45,7 @@ class RestFul {
save (data) { save (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, bodyData, group, parms } = data const { tableName, appCode, bodyData, group, parms } = data
let url = `${MODULEAPI}${appCode}/${tableName}/` let url = `${this.MODULE_API}${appCode}/${tableName}/`
if (group) { // 非标准保存 if (group) { // 非标准保存
url = `${url}${group}/` url = `${url}${group}/`
} }
...@@ -53,7 +54,7 @@ class RestFul { ...@@ -53,7 +54,7 @@ class RestFul {
queryOne (data) { queryOne (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, id, appCode, parms, group, bodyData, isQueryMaster } = data const { tableName, id, appCode, parms, group, bodyData, isQueryMaster } = data
let url_ = `${MODULEAPI}${appCode}/${tableName}/${id}/` let url_ = `${this.MODULE_API}${appCode}/${tableName}/${id}/`
if (group) { if (group) {
url_ = `${url_}${group}/` url_ = `${url_}${group}/`
} }
...@@ -67,7 +68,7 @@ class RestFul { ...@@ -67,7 +68,7 @@ class RestFul {
put (data) { put (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, bodyData, group, parms, isQueryMaster } = data const { tableName, appCode, bodyData, group, parms, isQueryMaster } = data
let url = `${MODULEAPI}${appCode}/${tableName}/` let url = `${this.MODULE_API}${appCode}/${tableName}/`
if (group) { // 非标准保存 if (group) { // 非标准保存
url = `${url}${group}/` url = `${url}${group}/`
} }
...@@ -77,7 +78,7 @@ class RestFul { ...@@ -77,7 +78,7 @@ class RestFul {
queryList (data) { queryList (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, parms, group, bodyData, isQueryMaster } = data const { tableName, appCode, parms, group, bodyData, isQueryMaster } = data
let url_ = `${MODULEAPI}${appCode}/${tableName}/` let url_ = `${this.MODULE_API}${appCode}/${tableName}/`
if (group) { if (group) {
url_ = `${url_}${group}/` url_ = `${url_}${group}/`
} }
...@@ -92,7 +93,7 @@ class RestFul { ...@@ -92,7 +93,7 @@ class RestFul {
deleteList (data) { deleteList (data) {
this.packParamHandle(data) this.packParamHandle(data)
const { tableName, appCode, bodyData, parms } = data const { tableName, appCode, bodyData, parms } = data
const url_ = `${MODULEAPI}${appCode}/${tableName}/` const url_ = `${this.MODULE_API}${appCode}/${tableName}/`
return this.requestClient.delete(url_, bodyData, parms) return this.requestClient.delete(url_, bodyData, parms)
} }
} }
......
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