Commit ccaf9d52be3f55a01713393128bb04a6f9108b9c
Committed by
小小鲁班
1 parent
fad25b88
chore: migrate strapi from 3.0.0-beta.13 to 3.0.0-beta.17.8
Showing
7 changed files
with
43 additions
and
38 deletions
Too many changes to show.
To preserve performance only 7 of 8 files are displayed.
back-end/h5-api/api/work/controllers/Work.js
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | * @Author: ly525 |
| 3 | 3 | * @Date: 2019-12-04 19:55:24 |
| 4 | 4 | * @LastEditors: ly525 |
| 5 | - * @LastEditTime: 2019-12-14 21:34:57 | |
| 5 | + * @LastEditTime: 2019-12-15 18:56:44 | |
| 6 | 6 | * @FilePath: /luban-h5/back-end/h5-api/api/work/controllers/Work.js |
| 7 | 7 | * @Github: https://github.com/ly525/luban-h5 |
| 8 | 8 | * @Description: |
| ... | ... | @@ -20,13 +20,12 @@ module.exports = { |
| 20 | 20 | // GET /previewOne |
| 21 | 21 | // strapi-hook-ejs: https://github.com/strapi/strapi/tree/master/packages/strapi-hook-ejs |
| 22 | 22 | previewOne: async (ctx) => { |
| 23 | - let work = await strapi.services.work.findOne(ctx.params); | |
| 24 | - work = work.toJSON(); | |
| 23 | + const work = await strapi.services.work.findOne(ctx.params); | |
| 25 | 24 | return ctx.render('engine', { work }); |
| 26 | 25 | }, |
| 27 | 26 | submitForm: async (ctx) => { |
| 28 | 27 | const work = await strapi.services.work.findOne(ctx.params); |
| 29 | - const formData = ctx.request.body.fields; | |
| 28 | + const formData = ctx.request.body; | |
| 30 | 29 | // eslint-disable-next-line no-unused-vars |
| 31 | 30 | const workform = await strapi.services.workform.create({ form: formData, work }); |
| 32 | 31 | |
| ... | ... | @@ -50,8 +49,7 @@ module.exports = { |
| 50 | 49 | return uuidMap2Name; |
| 51 | 50 | } |
| 52 | 51 | |
| 53 | - let work = await strapi.services.work.findOne(ctx.params); | |
| 54 | - work = work.toJSON(); | |
| 52 | + const work = await strapi.services.work.findOne(ctx.params); | |
| 55 | 53 | |
| 56 | 54 | // learn the query from: https://github.com/strapi/foodadvisor/blob/master/api/api/restaurant/controllers/Restaurant.js#L40 |
| 57 | 55 | // eslint-disable-next-line no-undef |
| ... | ... | @@ -65,16 +63,14 @@ module.exports = { |
| 65 | 63 | return ctx.body = { uuidMap2Name, formRecords }; |
| 66 | 64 | }, |
| 67 | 65 | setAsTemplate: async (ctx) => { |
| 68 | - let work = await strapi.services.work.findOne(ctx.params); | |
| 69 | - work = work.toJSON(); | |
| 66 | + const work = await strapi.services.work.findOne(ctx.params); | |
| 70 | 67 | |
| 71 | 68 | // eslint-disable-next-line no-unused-vars |
| 72 | 69 | const templateWork = await strapi.services.work.create(); |
| 73 | 70 | return strapi.services.work.update({id: templateWork.id}, { pages: work.pages, is_template: true, cover_image_url: work.cover_image_url }); |
| 74 | 71 | }, |
| 75 | 72 | useTemplate: async (ctx) => { |
| 76 | - let templateWork = await strapi.services.work.findOne(ctx.params); | |
| 77 | - templateWork = templateWork.toJSON(); | |
| 73 | + const templateWork = await strapi.services.work.findOne(ctx.params); | |
| 78 | 74 | |
| 79 | 75 | // eslint-disable-next-line no-unused-vars |
| 80 | 76 | const work = await strapi.services.work.create(); | ... | ... |
back-end/h5-api/api/work/models/Work.settings.json
back-end/h5-api/api/workform/models/Workform.settings.json
| ... | ... | @@ -7,7 +7,10 @@ |
| 7 | 7 | }, |
| 8 | 8 | "options": { |
| 9 | 9 | "increments": true, |
| 10 | - "timestamps": true, | |
| 10 | + "timestamps": [ | |
| 11 | + "created_at", | |
| 12 | + "updated_at" | |
| 13 | + ], | |
| 11 | 14 | "comment": "" |
| 12 | 15 | }, |
| 13 | 16 | "attributes": { |
| ... | ... | @@ -15,8 +18,7 @@ |
| 15 | 18 | "type": "json" |
| 16 | 19 | }, |
| 17 | 20 | "work": { |
| 18 | - "model": "work", | |
| 19 | - "via": "workforms" | |
| 21 | + "model": "work" | |
| 20 | 22 | } |
| 21 | 23 | } |
| 22 | 24 | } |
| 23 | 25 | \ No newline at end of file | ... | ... |
back-end/h5-api/config/environments/production/database.json
| ... | ... | @@ -4,11 +4,22 @@ |
| 4 | 4 | "default": { |
| 5 | 5 | "connector": "strapi-hook-bookshelf", |
| 6 | 6 | "settings": { |
| 7 | - "client": "sqlite", | |
| 8 | - "filename": ".tmp/data.db" | |
| 7 | + "client": "mysql", | |
| 8 | + "host": "${process.env.DATABASE_HOST || 'localhost'}", | |
| 9 | + "port": "${process.env.DATABASE_PORT || '3306'}", | |
| 10 | + "database": "${process.env.DATABASE_NAME || 'lubanh5'}", | |
| 11 | + "username": "${process.env.DATABASE_USERNAME || ''}", | |
| 12 | + "password": "${process.env.DATABASE_PASSWORD || ''}" | |
| 9 | 13 | }, |
| 10 | 14 | "options": { |
| 11 | - "useNullAsDefault": true | |
| 15 | + "debug": true, | |
| 16 | + "pool": { | |
| 17 | + "min": 0, | |
| 18 | + "max": 10, | |
| 19 | + "idleTimeoutMillis": 30000, | |
| 20 | + "createTimeoutMillis": 30000, | |
| 21 | + "acquireTimeoutMillis": 30000 | |
| 22 | + } | |
| 12 | 23 | } |
| 13 | 24 | } |
| 14 | 25 | } | ... | ... |
back-end/h5-api/config/functions/bootstrap.js
| ... | ... | @@ -6,8 +6,8 @@ |
| 6 | 6 | * |
| 7 | 7 | * This gives you an opportunity to set up your data model, |
| 8 | 8 | * run jobs, or perform some special logic. |
| 9 | + * | |
| 10 | + * See more details here: https://strapi.io/documentation/3.0.0-beta.x/configurations/configurations.html#bootstrap | |
| 9 | 11 | */ |
| 10 | 12 | |
| 11 | -module.exports = cb => { | |
| 12 | - cb(); | |
| 13 | -}; | |
| 13 | +module.exports = () => {}; | ... | ... |
back-end/h5-api/config/hook.json
back-end/h5-api/package.json
| ... | ... | @@ -19,22 +19,22 @@ |
| 19 | 19 | "eslint-plugin-react": "^7.14.0" |
| 20 | 20 | }, |
| 21 | 21 | "dependencies": { |
| 22 | - "knex": "latest", | |
| 23 | 22 | "lodash": "^4.17.5", |
| 24 | 23 | "psd": "^3.2.0", |
| 25 | - "sqlite3": "latest", | |
| 26 | - "strapi": "3.0.0-beta.13", | |
| 27 | - "strapi-admin": "3.0.0-beta.13", | |
| 28 | - "strapi-hook-bookshelf": "3.0.0-beta.13", | |
| 29 | - "strapi-hook-ejs": "3.0.0-alpha.13", | |
| 30 | - "strapi-hook-knex": "3.0.0-beta.13", | |
| 31 | - "strapi-plugin-content-manager": "3.0.0-beta.13", | |
| 32 | - "strapi-plugin-content-type-builder": "3.0.0-beta.13", | |
| 33 | - "strapi-plugin-email": "3.0.0-beta.13", | |
| 34 | - "strapi-plugin-settings-manager": "3.0.0-beta.13", | |
| 35 | - "strapi-plugin-upload": "3.0.0-beta.13", | |
| 36 | - "strapi-plugin-users-permissions": "3.0.0-beta.13", | |
| 37 | - "strapi-utils": "3.0.0-beta.13" | |
| 24 | + "strapi-hook-ejs": "3.0.0-beta.17.8", | |
| 25 | + "strapi": "3.0.0-beta.17.8", | |
| 26 | + "strapi-admin": "3.0.0-beta.17.8", | |
| 27 | + "strapi-utils": "3.0.0-beta.17.8", | |
| 28 | + "strapi-plugin-content-type-builder": "3.0.0-beta.17.8", | |
| 29 | + "strapi-plugin-content-manager": "3.0.0-beta.17.8", | |
| 30 | + "strapi-plugin-users-permissions": "3.0.0-beta.17.8", | |
| 31 | + "strapi-plugin-email": "3.0.0-beta.17.8", | |
| 32 | + "strapi-plugin-upload": "3.0.0-beta.17.8", | |
| 33 | + "strapi-hook-bookshelf": "3.0.0-beta.17.8", | |
| 34 | + "strapi-hook-knex": "3.0.0-beta.17.8", | |
| 35 | + "knex": "latest", | |
| 36 | + "mysql": "latest", | |
| 37 | + "sqlite3": "latest" | |
| 38 | 38 | }, |
| 39 | 39 | "author": { |
| 40 | 40 | "name": "A Strapi developer" | ... | ... |