arterli / CmsWing

一款基于Egg.js(为企业级框架和应用而生)、Sequelize和GraphQL,功能强大的(PC端,手机端和微信公众平台)电子商务平台及CMS建站系统
http://www.cmswing.com
Other
1.35k stars 450 forks source link

注册 用户名太长 没有限制导致报错 #47

Open lazyTai opened 5 years ago

lazyTai commented 5 years ago

注册的时候我使用了 135298234@qq.com的长度字符串报错 也没有提示 后来看了后台logs

m','18819448261',1565861057993,0,1), Time: 5ms
{ Error: ER_DATA_TOO_LONG: Data too long for column 'username' at row 1
    at Query.Sequence._packetToError (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/protocol/sequences/Sequence.js:47:14)
    at Query.ErrorPacket (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/protocol/Protocol.js:291:23)
    at Parser._parsePacket (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/protocol/Parser.js:433:10)
    at Parser.write (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/protocol/Parser.js:43:10)
    at Protocol.write (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/Connection.js:91:28)
    at Socket.<anonymous> (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/Connection.js:525:10)
    at Socket.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at Socket.Readable.push (_stream_readable.js:220:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
    --------------------
    at Protocol._enqueue (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/protocol/Protocol.js:144:48)
    at PoolConnection.query (/Users/macbook/Downloads/CmsWing/node_modules/_mysql@2.17.1@mysql/lib/Connection.js:201:25)
    at Promise (/Users/macbook/Downloads/CmsWing/node_modules/_think-helper@1.1.2@think-helper/index.js:83:10)
    at new Promise (<anonymous>)
    at args (/Users/macbook/Downloads/CmsWing/node_modules/_think-helper@1.1.2@think-helper/index.js:82:12)
    at ThinkMysql.[think-mysql-query] (/Users/macbook/Downloads/CmsWing/node_modules/_think-mysql@1.4.3@think-mysql/index.js:169:12)
    at getConnection.then.connection (/Users/macbook/Downloads/CmsWing/node_modules/_think-mysql@1.4.3@think-mysql/index.js:247:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: 'ER_DATA_TOO_LONG',
arterli commented 5 years ago

数据库字段限制了长度,这个后面修复下