q-koa 13.2.5 → 13.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/app.js
CHANGED
|
@@ -2188,7 +2188,7 @@ APP.getConfig = (app) => ({
|
|
|
2188
2188
|
} else {
|
|
2189
2189
|
app.cache.set(target, null)
|
|
2190
2190
|
|
|
2191
|
-
if (app.appConfig.appName) {
|
|
2191
|
+
if (app.appConfig.appName && app.appConfig.productionHost) {
|
|
2192
2192
|
const ipHost = (
|
|
2193
2193
|
Array.isArray(app.appConfig.productionHost)
|
|
2194
2194
|
? app.appConfig.productionHost
|
|
@@ -114,7 +114,7 @@ exports.loadModel = async ({ app, appName }) => {
|
|
|
114
114
|
list: attributes.map((attr, index) => {
|
|
115
115
|
const name = attr.match(/exports.(.*)=/)[1].trim()
|
|
116
116
|
let defaultValue = ''
|
|
117
|
-
if (model[name] && model[name]
|
|
117
|
+
if (model[name] && 'defaultValue' in model[name]) {
|
|
118
118
|
if (
|
|
119
119
|
typeof model[name].defaultValue === 'boolean' &&
|
|
120
120
|
model[name].defaultValue === true
|
|
@@ -154,7 +154,7 @@ exports.loadModel = async ({ app, appName }) => {
|
|
|
154
154
|
if (
|
|
155
155
|
!model[name].defaultValue &&
|
|
156
156
|
typeof model[name].defaultValue !== 'undefined' &&
|
|
157
|
-
model[name].defaultValue
|
|
157
|
+
model[name].defaultValue !== 0
|
|
158
158
|
) {
|
|
159
159
|
defaultValue = 'null'
|
|
160
160
|
}
|
|
@@ -165,10 +165,7 @@ exports.loadModel = async ({ app, appName }) => {
|
|
|
165
165
|
) {
|
|
166
166
|
defaultValue = 'null'
|
|
167
167
|
}
|
|
168
|
-
} else if (
|
|
169
|
-
model[name] &&
|
|
170
|
-
!model[name].hasOwnProperty('defaultValue')
|
|
171
|
-
) {
|
|
168
|
+
} else if (model[name] && !('defaultValue' in model[name])) {
|
|
172
169
|
defaultValue = "''"
|
|
173
170
|
}
|
|
174
171
|
|
|
@@ -35,6 +35,7 @@ const compareIndex = (tableIndexList, modelIndexList = [], model) => {
|
|
|
35
35
|
isSame: true,
|
|
36
36
|
current: [],
|
|
37
37
|
remote: [],
|
|
38
|
+
indexList: [],
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -64,7 +65,7 @@ const compareIndex = (tableIndexList, modelIndexList = [], model) => {
|
|
|
64
65
|
})
|
|
65
66
|
.map((i) => lodash.pick(i, ['fields', 'name']))
|
|
66
67
|
|
|
67
|
-
return { isSame: flag, remote, current }
|
|
68
|
+
return { isSame: flag, indexList: intersection, remote, current }
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
exports.countAndMaxId = async (ctx, _data) => {
|