q-koa 11.5.3 → 11.5.5

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.
@@ -41,7 +41,7 @@ exports.initModel = async (ctx) => {
41
41
  return ctx.ERROR('请检查,model为空')
42
42
  }
43
43
  if (app.appConfig.productionHost) {
44
- const { data: productionModel } = await axios
44
+ const { code, data: productionModel } = await axios
45
45
  .post(
46
46
  `${app.appConfig.productionHost}/${appName}/system/getTable`,
47
47
  {
@@ -54,18 +54,20 @@ exports.initModel = async (ctx) => {
54
54
  }
55
55
  )
56
56
  .then((res) => res.data)
57
- const findList = Object.keys(productionModel).filter((key) => {
58
- return (
59
- !['id', 'created_at', 'createdid', 'updated_at'].includes(key) &&
60
- !Object.keys(app.attributes[model]).includes(key)
61
- )
62
- })
63
- if (findList.length > 0) {
64
- return ctx.ERROR(
65
- `${model} 线上字段 ${findList.join(
66
- '/'
67
- )} 不能被删除,请先修改线上model.js`
68
- )
57
+ if (code === 200) {
58
+ const findList = Object.keys(productionModel).filter((key) => {
59
+ return (
60
+ !['id', 'created_at', 'createdid', 'updated_at'].includes(key) &&
61
+ !Object.keys(app.attributes[model]).includes(key)
62
+ )
63
+ })
64
+ if (findList.length > 0) {
65
+ return ctx.ERROR(
66
+ `${model} 线上字段 ${findList.join(
67
+ '/'
68
+ )} 不能被删除,请先修改线上model.js`
69
+ )
70
+ }
69
71
  }
70
72
  }
71
73
  const result = await app.model[model].sync(config)
@@ -214,7 +214,7 @@ exports.qr_code = async ({
214
214
  scene,
215
215
  is_oss = false,
216
216
  config = 'weixin_mp',
217
- width = 200,
217
+ width = 280,
218
218
  }) => {
219
219
  const appConfig = getConfig(app)
220
220
  const { app_id, app_secrect } = await appConfig.getObject(config)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "11.5.3",
3
+ "version": "11.5.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {