{"title":"添加","inframe":false,"hidden":false,"roles":{},"pageLink":"","children":[{"configs":{"serverScript":"var userRoleRows, id = SysUtil.getId(),\n  data = app.get();\nif (data.PASSWORD.equals('******'))\n  Wb.error('无效的密码。');\napp.run('select 1 from WB_USER where USER_NAME={?USER_NAME?}', {\n  errorText: '用户名称 \"' + data.USER_NAME + '\" 已经存在。'\n});\nuserRoleRows = Wb.decode(data.roleGrid);\napp.set({\n  USER_ID: id,\n  PASSWORD: Encrypter.getMD5(data.PASSWORD),\n  CREATE_DATE: new JavaDate(),\n  LOGIN_TIMES: 0\n});\napp.update({\n  tableName: 'WB_USER',\n  mode: 'insert'\n}); //updater默认启用事务\nWb.each(userRoleRows, function(rec) {\n  rec.USER_ID = id;\n});\nrequest.setAttribute('create', Wb.encode(userRoleRows));\napp.update({\n  tableName: 'WB_USER_ROLE'\n});\napp.send({\n  USER_ID: id\n});","itemId":"module"},"children":[],"type":"module","expanded":true}],"iconCls":""}