From 5ca2e091de0303c320f62e9bb6888cc00ea724a1 Mon Sep 17 00:00:00 2001 From: yuan_yi <1650192445@qq.com> Date: Wed, 27 Apr 2022 14:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/api/app/lib/controllers/auth/index.js | 127 +---- code/api/app/lib/models/user.js | 157 +++--- code/api/app/lib/routes/auth/index.js | 16 - .../0.0.1/1_accord_user/.vscode/launch.json | 17 + doc/script/0.0.1/1_accord_user/index.js | 64 +++ .../0.0.1/1_accord_user/package-lock.json | 529 ++++++++++++++++++ doc/script/0.0.1/1_accord_user/package.json | 16 + doc/script/0.0.1/1_accord_user/yarn.lock | 194 +++++++ 8 files changed, 915 insertions(+), 205 deletions(-) create mode 100644 doc/script/0.0.1/1_accord_user/.vscode/launch.json create mode 100644 doc/script/0.0.1/1_accord_user/index.js create mode 100644 doc/script/0.0.1/1_accord_user/package-lock.json create mode 100644 doc/script/0.0.1/1_accord_user/package.json create mode 100644 doc/script/0.0.1/1_accord_user/yarn.lock diff --git a/code/api/app/lib/controllers/auth/index.js b/code/api/app/lib/controllers/auth/index.js index 00040ce..2baff92 100644 --- a/code/api/app/lib/controllers/auth/index.js +++ b/code/api/app/lib/controllers/auth/index.js @@ -4,7 +4,7 @@ const MD5 = require('crypto-js/md5'); const moment = require('moment'); const uuid = require('uuid'); -async function login(ctx, next) { +async function login (ctx, next) { const transaction = await ctx.fs.dc.orm.transaction(); try { const models = ctx.fs.dc.models; @@ -12,16 +12,12 @@ async function login(ctx, next) { let password = Hex.stringify(MD5(params.password)); const userRes = await models.User.findOne({ + attributes: { exclude: ['password'] }, where: { username: params.username, password: password, delete: false, }, - attributes: { exclude: ['password'] }, - include: [{ - attributes: ["resourceId"], - model: models.UserResource - }] }); if (!userRes) { @@ -35,11 +31,13 @@ async function login(ctx, next) { } else { const token = uuid.v4(); - let userRslt = Object.assign(userRes.dataValues, { - authorized: true, - token: token, - userResources: userRes.userResources.map(r => r.resourceId), - }); + let userRslt = Object.assign( + userRes.dataValues, + { + authorized: true, + token: token, + } + ); await models.UserToken.create({ token: token, @@ -61,85 +59,9 @@ async function login(ctx, next) { } } -/** - * 微信小程序登录 - * @@requires.body {phone-手机号, password-密码} ctx - */ -async function wxLogin(ctx, next) { - const transaction = await ctx.fs.dc.orm.transaction(); +async function logout (ctx) { try { - const models = ctx.fs.dc.models; - const params = ctx.request.body; - let password = Hex.stringify(MD5(params.password)); - const userRes = await models.User.findOne({ - where: { - phone: params.phone, - password: password, - delete: false, - }, - attributes: { exclude: ['password'] } - }); - if (!userRes) { - ctx.status = 400; - ctx.body = { message: "手机号或密码错误" } - } else if (!userRes.enable) { - ctx.status = 400; - ctx.body = { message: "该用户已被禁用" } - } else { - const token = uuid.v4(); - //获取用户关注区域信息 - const departmentRes = await models.Department.findOne({ where: { id: userRes.departmentId } }); - let attentionRegion = departmentRes; - while (attentionRegion.dependence && attentionRegion.type != 1) { - const departmentParent = await models.Department.findOne({ where: { id: attentionRegion.dependence } }); - attentionRegion = { - ...departmentParent.dataValues, - nextRegin: attentionRegion - } - } - //获取用户权限信息 - const resourceRes = await models.UserResource.findAll({ - where: { - userId: userRes.id - }, - include: [{ - model: models.Resource, - attributes: ['code', 'name'], - }], - attributes: [] - }); - let userRslt = Object.assign({ - authorized: true, - token: token, - ...userRes.dataValues - }); - await models.UserToken.create({ - token: token, - userInfo: userRslt, - expired: moment().add(30, 'day').format('YYYY-MM-DD HH:mm:ss') - }, { transaction: transaction }); - ctx.status = 200; - ctx.body = Object.assign({ - ...userRslt, - userRegionType: departmentRes.type,//1-市级,2-区县级,3-乡镇级,4-村级 - attentionRegion: attentionRegion, - resources: resourceRes.map(r => r.resource) - }); - } - await transaction.commit(); - } catch (error) { - await transaction.rollback(); - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "登录失败" - } - } -} - -async function logout(ctx) { - try { - const { token, code } = ctx.request.body; + const { token } = ctx.request.body; const models = ctx.fs.dc.models; await models.UserToken.destroy({ @@ -153,37 +75,12 @@ async function logout(ctx) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = { - "message": "登出失败" - } - } -} - -/** - * 微信小程序登出 - * @request.body {token-用户登录Token} ctx - */ -async function wxLogout(ctx) { - try { - const { token } = ctx.request.body; - const models = ctx.fs.dc.models; - await models.UserToken.destroy({ - where: { - token: token, - }, - }); - ctx.status = 204; - } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); - ctx.status = 400; - ctx.body = { - "message": "登出失败" + "message": "退出失败" } } } module.exports = { login, - wxLogin, logout, - wxLogout }; \ No newline at end of file diff --git a/code/api/app/lib/models/user.js b/code/api/app/lib/models/user.js index ee1a795..d2945b2 100644 --- a/code/api/app/lib/models/user.js +++ b/code/api/app/lib/models/user.js @@ -2,78 +2,87 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const User = sequelize.define("user", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "user_id_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false - }, - namePresent: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name_present", - autoIncrement: false - }, - password: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "password", - autoIncrement: false - }, - phone: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "phone", - autoIncrement: false - }, - email: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "email", - autoIncrement: false - }, - enabled: { - type: DataTypes.BOOLEAN, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "enabled", - autoIncrement: false - } - }, { - tableName: "user", - comment: "", - indexes: [] - }); - dc.models.User = User; - return User; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const User = sequelize.define("user", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "user_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "name", + autoIncrement: false + }, + namePresent: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "name_present", + autoIncrement: false + }, + password: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "password", + autoIncrement: false + }, + phone: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "phone", + autoIncrement: false + }, + email: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "email", + autoIncrement: false + }, + enabled: { + type: DataTypes.BOOLEAN, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "enabled", + autoIncrement: false + }, + delete: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "delete", + autoIncrement: false + } + }, { + tableName: "user", + comment: "", + indexes: [] + }); + dc.models.User = User; + return User; }; \ No newline at end of file diff --git a/code/api/app/lib/routes/auth/index.js b/code/api/app/lib/routes/auth/index.js index b0de650..0b29e28 100644 --- a/code/api/app/lib/routes/auth/index.js +++ b/code/api/app/lib/routes/auth/index.js @@ -11,22 +11,6 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['POST/login'] = { content: '登录', visible: true }; router.post('/login', auth.login); - /** - * @api {POST} wxLogin 微信小程序登录.(使用手机号、密码登录) - * @apiVersion 1.0.0 - * @apiGroup Auth - */ - app.fs.api.logAttr['POST/wxLogin'] = { content: '微信小程序登录', visible: true }; - router.post('/wxLogin', auth.wxLogin); - app.fs.api.logAttr['PUT/logout'] = { content: '登出', visible: false }; router.put('/logout', auth.logout); - - /** - * @api {PUT} wxLogout 微信小程序登出 - * @apiVersion 1.0.0 - * @apiGroup Auth - */ - app.fs.api.logAttr['PUT/wxLogout'] = { content: '登出', visible: false }; - router.put('/wxLogout', auth.wxLogout); }; diff --git a/doc/script/0.0.1/1_accord_user/.vscode/launch.json b/doc/script/0.0.1/1_accord_user/.vscode/launch.json new file mode 100644 index 0000000..3a3fcba --- /dev/null +++ b/doc/script/0.0.1/1_accord_user/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "启动程序", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}\\index.js" + } + ] +} \ No newline at end of file diff --git a/doc/script/0.0.1/1_accord_user/index.js b/doc/script/0.0.1/1_accord_user/index.js new file mode 100644 index 0000000..e091705 --- /dev/null +++ b/doc/script/0.0.1/1_accord_user/index.js @@ -0,0 +1,64 @@ +try { + const { Pool, Client } = require('pg') + const XLSX = require('xlsx') + const path = require('path') + + // 连接IOT AUTH数据库 + const authPool = new Pool({ + user: 'postgres', + host: '10.8.30.32', + database: 'iot_auth', + password: '123', + port: 5432, + }) + + // 链接安心云数据库 + const anxinPool = new Pool({ + user: 'FashionAdmin', + host: '10.8.30.156', + database: 'Anxinyun0726', + password: '123456', + port: 5432, + }) + const fun = async () => { + // note: we don't try/catch this because if connecting throws an exception + // we don't need to dispose of the client (it will be undefined) + const anxinClient = await anxinPool.connect() + const authClient = await authPool.connect() + try { + await authClient.query('BEGIN') + + let axUserRes = await anxinClient.query(`SELECT t_user.id, t_user.name, t_user.name_present, t_user.password, t_user.phone, t_user.email, t_user.enabled FROM t_user INNER JOIN t_organization ON t_user.org = t_organization.id WHERE t_organization.org_type=$1`, ['1001']); + let axUserRows = axUserRes.rows + console.log(axUserRows.length); + if (axUserRows.length) { + for (let axu of axUserRows) { + let existAuthRes = await authClient.query(`SELECT * FROM public.user WHERE id=$1`, [axu.id]) + console.log(axu.name_present); + if (existAuthRes.rows.length) { + await authClient.query(`UPDATE public.user SET name=$1, name_present=$2, password=$3, phone=$4, email=$5, enabled=$6 WHERE id=$7`, + [axu.name, axu.name_present, axu.password, axu.phone, axu.email, axu.enabled, axu.id]) + } else { + await authClient.query(`INSERT INTO public.user (id, name, name_present, password, phone, email, enabled) VALUES ($1, $2, $3, $4, $5, $6, $7)`, + [axu.id, axu.name, axu.name_present, axu.password, axu.phone, axu.email, axu.enabled]) + } + } + } else { + console.log('安心云未查询到有效数据'); + } + + await authClient.query('COMMIT') + console.log('执行完毕~') + } catch (e) { + await authClient.query('ROLLBACK') + console.log('执行错误~') + throw e + } finally { + authClient.release(); + } + } + + fun() +} catch (error) { + console.error(error) +} diff --git a/doc/script/0.0.1/1_accord_user/package-lock.json b/doc/script/0.0.1/1_accord_user/package-lock.json new file mode 100644 index 0000000..2793372 --- /dev/null +++ b/doc/script/0.0.1/1_accord_user/package-lock.json @@ -0,0 +1,529 @@ +{ + "name": "appkey-generator", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/geojson": { + "version": "1.0.6", + "resolved": "http://10.8.30.22:7000/@types%2fgeojson/-/geojson-1.0.6.tgz", + "integrity": "sha1-PgKXJyjGkkjCrwjWCkjLuGgP/98=" + }, + "@types/node": { + "version": "8.0.53", + "resolved": "http://10.8.30.22:7000/@types%2fnode/-/node-8.0.53.tgz", + "integrity": "sha1-OWs1r4JvpmqtRyyMt7jV4nf05tg=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "http://10.8.30.22:7000/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "bluebird": { + "version": "3.5.1", + "resolved": "http://10.8.30.22:7000/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha1-2VUfnemPH82h5oPRfukaBgLuLrk=" + }, + "buffer-writer": { + "version": "2.0.0", + "resolved": "http://10.8.30.22:7000/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha1-zn64Gjj3gp2wnIc/L7t5LAyY7AQ=" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "http://10.8.30.22:7000/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha1-sdTonmiBGcPJqQOtMKuy9qkZvjw=", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "cls-bluebird": { + "version": "2.0.1", + "resolved": "http://10.8.30.22:7000/cls-bluebird/-/cls-bluebird-2.0.1.tgz", + "integrity": "sha1-wlmkgK4CwOUGE0MHuxPbMERu4uc=", + "requires": { + "is-bluebird": "^1.0.2", + "shimmer": "^1.1.0" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "http://10.8.30.22:7000/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "http://10.8.30.22:7000/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha1-FuQHD7qK4ptnnyIVhT7hgasuq8A=" + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "http://10.8.30.22:7000/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha1-3YojVTB1L5iPmghE8/xYnjERElw=" + }, + "crypto-js": { + "version": "3.3.0", + "resolved": "http://10.8.30.22:7000/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha1-hG3RzOL2iqz6FWyFePkmpgm3l2s=" + }, + "debug": { + "version": "3.1.0", + "resolved": "http://10.8.30.22:7000/debug/-/debug-3.1.0.tgz", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "requires": { + "ms": "2.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "http://10.8.30.22:7000/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "depd": { + "version": "1.1.1", + "resolved": "http://10.8.30.22:7000/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "dottie": { + "version": "2.0.0", + "resolved": "http://10.8.30.22:7000/dottie/-/dottie-2.0.0.tgz", + "integrity": "sha1-2hkZgci41xPKARXViYzzl8Lw3dA=" + }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "http://10.8.30.22:7000/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha1-EkqohYmSYfaK7bQqfAgN6dpgh0M=" + }, + "form-data": { + "version": "3.0.1", + "resolved": "http://10.8.30.22:7000/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha1-69U3kbeDVqma+aMA1CgsTV65dV8=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.2.2", + "resolved": "http://10.8.30.22:7000/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha1-v2muopcpgmdfAIZTQrmCmG9rjdk=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "http://10.8.30.22:7000/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" + }, + "generic-pool": { + "version": "3.2.0", + "resolved": "http://10.8.30.22:7000/generic-pool/-/generic-pool-3.2.0.tgz", + "integrity": "sha1-wdSF7L1vGMBRPUdB0JimcV6u7Kg=" + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "http://10.8.30.22:7000/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha1-FfWfN2+FXERpY5SPDSTNNje0q8Y=", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "has": { + "version": "1.0.3", + "resolved": "http://10.8.30.22:7000/has/-/has-1.0.3.tgz", + "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "http://10.8.30.22:7000/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha1-Fl0wcMADCXUqEjakeTMeOsVvFCM=" + }, + "inflection": { + "version": "1.12.0", + "resolved": "http://10.8.30.22:7000/inflection/-/inflection-1.12.0.tgz", + "integrity": "sha1-ogCTVlbW9fa8TcdQLhrstwMihBY=" + }, + "inherits": { + "version": "2.0.4", + "resolved": "http://10.8.30.22:7000/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=" + }, + "is-bluebird": { + "version": "1.0.2", + "resolved": "http://10.8.30.22:7000/is-bluebird/-/is-bluebird-1.0.2.tgz", + "integrity": "sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI=" + }, + "lodash": { + "version": "4.17.4", + "resolved": "http://10.8.30.22:7000/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "http://10.8.30.22:7000/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", + "requires": { + "yallist": "^4.0.0" + } + }, + "methods": { + "version": "1.1.2", + "resolved": "http://10.8.30.22:7000/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "2.5.2", + "resolved": "http://10.8.30.22:7000/mime/-/mime-2.5.2.tgz", + "integrity": "sha1-bj3GzCuVEGQ4MOXxnVy3U9pe6r4=" + }, + "mime-db": { + "version": "1.47.0", + "resolved": "http://10.8.30.22:7000/mime-db/-/mime-db-1.47.0.tgz", + "integrity": "sha1-jLMT5Zll08Bc+/iYkVomevRqM1w=" + }, + "mime-types": { + "version": "2.1.30", + "resolved": "http://10.8.30.22:7000/mime-types/-/mime-types-2.1.30.tgz", + "integrity": "sha1-bnvotMR5gl+F7WMmaV23P5MF1i0=", + "requires": { + "mime-db": "1.47.0" + } + }, + "moment": { + "version": "2.19.2", + "resolved": "http://10.8.30.22:7000/moment/-/moment-2.19.2.tgz", + "integrity": "sha1-in93TJWmRVC0x+vUlmg5CPlBnb4=" + }, + "moment-timezone": { + "version": "0.5.14", + "resolved": "http://10.8.30.22:7000/moment-timezone/-/moment-timezone-0.5.14.tgz", + "integrity": "sha1-TrOP+VOLgBCLpGekWPPtQmjM/LE=", + "requires": { + "moment": ">= 2.9.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "http://10.8.30.22:7000/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "http://10.8.30.22:7000/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha1-yQUh104RJ7ZyZt7TOUrWEWmGUzo=" + }, + "packet-reader": { + "version": "1.0.0", + "resolved": "http://10.8.30.22:7000/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha1-kjjlSA3tq6z+H+PydxBj8WQVfXQ=" + }, + "pg": { + "version": "7.18.2", + "resolved": "http://10.8.30.22:7000/pg/-/pg-7.18.2.tgz", + "integrity": "sha1-TiGfBaAK/022qrG6AvKP+kUTsLs=", + "requires": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "0.1.3", + "pg-packet-stream": "^1.1.0", + "pg-pool": "^2.0.10", + "pg-types": "^2.1.0", + "pgpass": "1.x", + "semver": "4.3.2" + }, + "dependencies": { + "semver": { + "version": "4.3.2", + "resolved": "http://10.8.30.22:7000/semver/-/semver-4.3.2.tgz", + "integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c=" + } + } + }, + "pg-connection-string": { + "version": "0.1.3", + "resolved": "http://10.8.30.22:7000/pg-connection-string/-/pg-connection-string-0.1.3.tgz", + "integrity": "sha1-2hhHsglA5C7hSSvq9l1J2RskXfc=" + }, + "pg-hstore": { + "version": "2.3.2", + "resolved": "http://10.8.30.22:7000/pg-hstore/-/pg-hstore-2.3.2.tgz", + "integrity": "sha1-9+8FPnubiSrphq8vfL6GQy388k8=", + "requires": { + "underscore": "^1.7.0" + } + }, + "pg-int8": { + "version": "1.0.1", + "resolved": "http://10.8.30.22:7000/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha1-lDvUY79bcbQXARX4D478mgwOt4w=" + }, + "pg-packet-stream": { + "version": "1.1.0", + "resolved": "http://10.8.30.22:7000/pg-packet-stream/-/pg-packet-stream-1.1.0.tgz", + "integrity": "sha1-5Fw65ni5AaKHOvHhe5LXh5Yu+RQ=" + }, + "pg-pool": { + "version": "2.0.10", + "resolved": "http://10.8.30.22:7000/pg-pool/-/pg-pool-2.0.10.tgz", + "integrity": "sha1-hC7iOwToaCTOnXhkMPg2UILYHEo=" + }, + "pg-types": { + "version": "2.2.0", + "resolved": "http://10.8.30.22:7000/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha1-LQJQ1jZFT3z6O2rgOC/fqAYyVKM=", + "requires": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + } + }, + "pgpass": { + "version": "1.0.2", + "resolved": "http://10.8.30.22:7000/pgpass/-/pgpass-1.0.2.tgz", + "integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=", + "requires": { + "split": "^1.0.0" + } + }, + "postgres-array": { + "version": "2.0.0", + "resolved": "http://10.8.30.22:7000/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha1-SPj84FT7xpZxmZMpuINLdyZS2C4=" + }, + "postgres-bytea": { + "version": "1.0.0", + "resolved": "http://10.8.30.22:7000/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=" + }, + "postgres-date": { + "version": "1.0.6", + "resolved": "http://10.8.30.22:7000/postgres-date/-/postgres-date-1.0.6.tgz", + "integrity": "sha1-SSXoCFswwroaBqyRuaNHOVSizi0=" + }, + "postgres-interval": { + "version": "1.2.0", + "resolved": "http://10.8.30.22:7000/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha1-tGDILLFYdQd4iBmgaqD//bNURpU=", + "requires": { + "xtend": "^4.0.0" + } + }, + "qs": { + "version": "6.10.1", + "resolved": "http://10.8.30.22:7000/qs/-/qs-6.10.1.tgz", + "integrity": "sha1-STFIL6jWR6Wqt5nFJx0hM7mB+2o=", + "requires": { + "side-channel": "^1.0.4" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "http://10.8.30.22:7000/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "retry-as-promised": { + "version": "2.3.2", + "resolved": "http://10.8.30.22:7000/retry-as-promised/-/retry-as-promised-2.3.2.tgz", + "integrity": "sha1-zZdO5P2bX+A8vzGHHuSCIcB3N7c=", + "requires": { + "bluebird": "^3.4.6", + "debug": "^2.6.9" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "http://10.8.30.22:7000/debug/-/debug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "http://10.8.30.22:7000/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=" + }, + "semver": { + "version": "5.4.1", + "resolved": "http://10.8.30.22:7000/semver/-/semver-5.4.1.tgz", + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" + }, + "sequelize": { + "version": "4.22.12", + "resolved": "http://10.8.30.22:7000/sequelize/-/sequelize-4.22.12.tgz", + "integrity": "sha1-j4/l45GiqGeNLAO5c1ZOpkV4EKI=", + "requires": { + "bluebird": "^3.4.6", + "cls-bluebird": "^2.0.1", + "debug": "^3.0.0", + "depd": "^1.1.0", + "dottie": "^2.0.0", + "generic-pool": "^3.1.8", + "inflection": "1.12.0", + "lodash": "^4.17.1", + "moment": "^2.13.0", + "moment-timezone": "^0.5.4", + "retry-as-promised": "^2.3.1", + "semver": "^5.0.1", + "terraformer-wkt-parser": "^1.1.2", + "toposort-class": "^1.0.1", + "uuid": "^3.0.0", + "validator": "^9.1.0", + "wkx": "^0.4.1" + } + }, + "shimmer": { + "version": "1.2.0", + "resolved": "http://10.8.30.22:7000/shimmer/-/shimmer-1.2.0.tgz", + "integrity": "sha1-+Wb3VVeJdj502IQRk2haXnhzZmU=" + }, + "side-channel": { + "version": "1.0.4", + "resolved": "http://10.8.30.22:7000/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha1-785cj9wQTudRslxY1CkAEfpeos8=", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "split": { + "version": "1.0.1", + "resolved": "http://10.8.30.22:7000/split/-/split-1.0.1.tgz", + "integrity": "sha1-YFvZvjA6pZ+zX5Ip++oN3snqB9k=", + "requires": { + "through": "2" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "http://10.8.30.22:7000/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "superagent": { + "version": "6.1.0", + "resolved": "http://10.8.30.22:7000/superagent/-/superagent-6.1.0.tgz", + "integrity": "sha1-CfCIB7xBEI7xZM+0vik869SA9KY=", + "requires": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.2", + "debug": "^4.1.1", + "fast-safe-stringify": "^2.0.7", + "form-data": "^3.0.0", + "formidable": "^1.2.2", + "methods": "^1.1.2", + "mime": "^2.4.6", + "qs": "^6.9.4", + "readable-stream": "^3.6.0", + "semver": "^7.3.2" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "http://10.8.30.22:7000/debug/-/debug-4.3.1.tgz", + "integrity": "sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "http://10.8.30.22:7000/ms/-/ms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" + }, + "semver": { + "version": "7.3.5", + "resolved": "http://10.8.30.22:7000/semver/-/semver-7.3.5.tgz", + "integrity": "sha1-C2Ich5NI2JmOSw5L6Us/EuYBjvc=", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "terraformer": { + "version": "1.0.8", + "resolved": "http://10.8.30.22:7000/terraformer/-/terraformer-1.0.8.tgz", + "integrity": "sha1-UeCtiXRvzyFh3G9lqnDkI3fItZM=", + "requires": { + "@types/geojson": "^1.0.0" + } + }, + "terraformer-wkt-parser": { + "version": "1.1.2", + "resolved": "http://10.8.30.22:7000/terraformer-wkt-parser/-/terraformer-wkt-parser-1.1.2.tgz", + "integrity": "sha1-M2oMj8gglKWv+DKI9prt7NNpvww=", + "requires": { + "terraformer": "~1.0.5" + } + }, + "through": { + "version": "2.3.8", + "resolved": "http://10.8.30.22:7000/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "toposort-class": { + "version": "1.0.1", + "resolved": "http://10.8.30.22:7000/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg=" + }, + "underscore": { + "version": "1.8.3", + "resolved": "http://10.8.30.22:7000/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "http://10.8.30.22:7000/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.1.0", + "resolved": "http://10.8.30.22:7000/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha1-PdPT55Crwk17DToDT/q6vijrvAQ=" + }, + "validator": { + "version": "9.1.1", + "resolved": "http://10.8.30.22:7000/validator/-/validator-9.1.1.tgz", + "integrity": "sha1-O90QZcvSj52WrIBt7gEDDTL9l+8=" + }, + "wkx": { + "version": "0.4.2", + "resolved": "http://10.8.30.22:7000/wkx/-/wkx-0.4.2.tgz", + "integrity": "sha1-d201pjSlwi5lbkdEvetU+D/Szo0=", + "requires": { + "@types/node": "*" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "http://10.8.30.22:7000/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q=" + }, + "yallist": { + "version": "4.0.0", + "resolved": "http://10.8.30.22:7000/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=" + } + } +} diff --git a/doc/script/0.0.1/1_accord_user/package.json b/doc/script/0.0.1/1_accord_user/package.json new file mode 100644 index 0000000..0f66f5f --- /dev/null +++ b/doc/script/0.0.1/1_accord_user/package.json @@ -0,0 +1,16 @@ +{ + "name": "appkey-generator", + "version": "1.0.0", + "description": "tool", + "main": "index.js", + "scripts": { + "test": "mocha", + "start": "set NODE_ENV=development&&node index" + }, + "author": "liu", + "license": "ISC", + "dependencies": { + "pg": "^7.18.2", + "xlsx": "^0.17.1" + } +} diff --git a/doc/script/0.0.1/1_accord_user/yarn.lock b/doc/script/0.0.1/1_accord_user/yarn.lock new file mode 100644 index 0000000..73c1da7 --- /dev/null +++ b/doc/script/0.0.1/1_accord_user/yarn.lock @@ -0,0 +1,194 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +adler-32@~1.2.0: + version "1.2.0" + resolved "http://10.8.30.22:7000/adler-32/-/adler-32-1.2.0.tgz#6a3e6bf0a63900ba15652808cb15c6813d1a5f25" + integrity sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU= + dependencies: + exit-on-epipe "~1.0.1" + printj "~1.1.0" + +adler-32@~1.3.0: + version "1.3.0" + resolved "http://10.8.30.22:7000/adler-32/-/adler-32-1.3.0.tgz#3cad1b71cdfa69f6c8a91f3e3615d31a4fdedc72" + integrity sha1-PK0bcc36afbIqR8+NhXTGk/e3HI= + dependencies: + printj "~1.2.2" + +buffer-writer@2.0.0: + version "2.0.0" + resolved "http://10.8.30.22:7000/buffer-writer/-/buffer-writer-2.0.0.tgz#ce7eb81a38f7829db09c873f2fbb792c0c98ec04" + integrity sha1-zn64Gjj3gp2wnIc/L7t5LAyY7AQ= + +cfb@^1.1.4: + version "1.2.1" + resolved "http://10.8.30.22:7000/cfb/-/cfb-1.2.1.tgz#209429e4c68efd30641f6fc74b2d6028bd202402" + integrity sha512-wT2ScPAFGSVy7CY+aauMezZBnNrfnaLSrxHUHdea+Td/86vrk6ZquggV+ssBR88zNs0OnBkL2+lf9q0K+zVGzQ== + dependencies: + adler-32 "~1.3.0" + crc-32 "~1.2.0" + printj "~1.3.0" + +codepage@~1.15.0: + version "1.15.0" + resolved "http://10.8.30.22:7000/codepage/-/codepage-1.15.0.tgz#2e00519024b39424ec66eeb3ec07227e692618ab" + integrity sha1-LgBRkCSzlCTsZu6z7AcifmkmGKs= + +crc-32@~1.2.0: + version "1.2.1" + resolved "http://10.8.30.22:7000/crc-32/-/crc-32-1.2.1.tgz#436d2bcaad27bcb6bd073a2587139d3024a16460" + integrity sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w== + dependencies: + exit-on-epipe "~1.0.1" + printj "~1.3.1" + +exit-on-epipe@~1.0.1: + version "1.0.1" + resolved "http://10.8.30.22:7000/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" + integrity sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI= + +frac@~1.1.2: + version "1.1.2" + resolved "http://10.8.30.22:7000/frac/-/frac-1.1.2.tgz#3d74f7f6478c88a1b5020306d747dc6313c74d0b" + integrity sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA== + +packet-reader@1.0.0: + version "1.0.0" + resolved "http://10.8.30.22:7000/packet-reader/-/packet-reader-1.0.0.tgz#9238e5480dedabacfe1fe3f2771063f164157d74" + integrity sha1-kjjlSA3tq6z+H+PydxBj8WQVfXQ= + +pg-connection-string@0.1.3: + version "0.1.3" + resolved "http://10.8.30.22:7000/pg-connection-string/-/pg-connection-string-0.1.3.tgz#da1847b20940e42ee1492beaf65d49d91b245df7" + integrity sha1-2hhHsglA5C7hSSvq9l1J2RskXfc= + +pg-int8@1.0.1: + version "1.0.1" + resolved "http://10.8.30.22:7000/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" + integrity sha1-lDvUY79bcbQXARX4D478mgwOt4w= + +pg-packet-stream@^1.1.0: + version "1.1.0" + resolved "http://10.8.30.22:7000/pg-packet-stream/-/pg-packet-stream-1.1.0.tgz#e45c3ae678b901a2873af1e17b92d787962ef914" + integrity sha1-5Fw65ni5AaKHOvHhe5LXh5Yu+RQ= + +pg-pool@^2.0.10: + version "2.0.10" + resolved "http://10.8.30.22:7000/pg-pool/-/pg-pool-2.0.10.tgz#842ee23b04e86824ce9d786430f8365082d81c4a" + integrity sha1-hC7iOwToaCTOnXhkMPg2UILYHEo= + +pg-types@^2.1.0: + version "2.2.0" + resolved "http://10.8.30.22:7000/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" + integrity sha1-LQJQ1jZFT3z6O2rgOC/fqAYyVKM= + dependencies: + pg-int8 "1.0.1" + postgres-array "~2.0.0" + postgres-bytea "~1.0.0" + postgres-date "~1.0.4" + postgres-interval "^1.1.0" + +pg@^7.18.2: + version "7.18.2" + resolved "http://10.8.30.22:7000/pg/-/pg-7.18.2.tgz#4e219f05a00aff4db6aab1ba02f28ffa4513b0bb" + integrity sha1-TiGfBaAK/022qrG6AvKP+kUTsLs= + dependencies: + buffer-writer "2.0.0" + packet-reader "1.0.0" + pg-connection-string "0.1.3" + pg-packet-stream "^1.1.0" + pg-pool "^2.0.10" + pg-types "^2.1.0" + pgpass "1.x" + semver "4.3.2" + +pgpass@1.x: + version "1.0.5" + resolved "http://10.8.30.22:7000/pgpass/-/pgpass-1.0.5.tgz#9b873e4a564bb10fa7a7dbd55312728d422a223d" + integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug== + dependencies: + split2 "^4.1.0" + +postgres-array@~2.0.0: + version "2.0.0" + resolved "http://10.8.30.22:7000/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" + integrity sha1-SPj84FT7xpZxmZMpuINLdyZS2C4= + +postgres-bytea@~1.0.0: + version "1.0.0" + resolved "http://10.8.30.22:7000/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" + integrity sha1-AntTPAqokOJtFy1Hz5zOzFIazTU= + +postgres-date@~1.0.4: + version "1.0.7" + resolved "http://10.8.30.22:7000/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" + integrity sha1-UbwIYAYAXlBhxZHO5yfyUxv2Qag= + +postgres-interval@^1.1.0: + version "1.2.0" + resolved "http://10.8.30.22:7000/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" + integrity sha1-tGDILLFYdQd4iBmgaqD//bNURpU= + dependencies: + xtend "^4.0.0" + +printj@~1.1.0: + version "1.1.2" + resolved "http://10.8.30.22:7000/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" + integrity sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI= + +printj@~1.2.2: + version "1.2.3" + resolved "http://10.8.30.22:7000/printj/-/printj-1.2.3.tgz#2cfb2b192a1e5385dbbe5b46658ac34aa828508a" + integrity sha1-LPsrGSoeU4XbvltGZYrDSqgoUIo= + +printj@~1.3.0, printj@~1.3.1: + version "1.3.1" + resolved "http://10.8.30.22:7000/printj/-/printj-1.3.1.tgz#9af6b1d55647a1587ac44f4c1654a4b95b8e12cb" + integrity sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg== + +semver@4.3.2: + version "4.3.2" + resolved "http://10.8.30.22:7000/semver/-/semver-4.3.2.tgz#c7a07158a80bedd052355b770d82d6640f803be7" + integrity sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c= + +split2@^4.1.0: + version "4.1.0" + resolved "http://10.8.30.22:7000/split2/-/split2-4.1.0.tgz#101907a24370f85bb782f08adaabe4e281ecf809" + integrity sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ== + +ssf@~0.11.2: + version "0.11.2" + resolved "http://10.8.30.22:7000/ssf/-/ssf-0.11.2.tgz#0b99698b237548d088fc43cdf2b70c1a7512c06c" + integrity sha1-C5lpiyN1SNCI/EPN8rcMGnUSwGw= + dependencies: + frac "~1.1.2" + +wmf@~1.0.1: + version "1.0.2" + resolved "http://10.8.30.22:7000/wmf/-/wmf-1.0.2.tgz#7d19d621071a08c2bdc6b7e688a9c435298cc2da" + integrity sha1-fRnWIQcaCMK9xrfmiKnENSmMwto= + +word@~0.3.0: + version "0.3.0" + resolved "http://10.8.30.22:7000/word/-/word-0.3.0.tgz#8542157e4f8e849f4a363a288992d47612db9961" + integrity sha1-hUIVfk+OhJ9KNjooiZLUdhLbmWE= + +xlsx@^0.17.1: + version "0.17.5" + resolved "http://10.8.30.22:7000/xlsx/-/xlsx-0.17.5.tgz#78b788fcfc0773d126cdcd7ea069cb7527c1ce81" + integrity sha512-lXNU0TuYsvElzvtI6O7WIVb9Zar1XYw7Xb3VAx2wn8N/n0whBYrCnHMxtFyIiUU1Wjf09WzmLALDfBO5PqTb1g== + dependencies: + adler-32 "~1.2.0" + cfb "^1.1.4" + codepage "~1.15.0" + crc-32 "~1.2.0" + ssf "~0.11.2" + wmf "~1.0.1" + word "~0.3.0" + +xtend@^4.0.0: + version "4.0.2" + resolved "http://10.8.30.22:7000/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q=