Commit 1bee345e by 王昆

gsb

parent 9ed4882e
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("merchantapi", { return db.define("merchantapi", {
secret: DataTypes.STRING, merchant_id: DataTypes.BIGINT,
name : DataTypes.STRING, name : DataTypes.STRING,
secret: DataTypes.STRING,
ip: DataTypes.STRING, ip: DataTypes.STRING,
merchant_id: DataTypes.BIGINT, is_enabled:{
type:DataTypes.BOOLEAN,
defaultValue: true
},
},{ },{
paranoid: true, //假的删除 paranoid: true, //假的删除
underscored: true, underscored: true,
......
...@@ -68,8 +68,8 @@ class MerchantService extends ServiceBase { ...@@ -68,8 +68,8 @@ class MerchantService extends ServiceBase {
} else { } else {
params.id = id; params.id = id;
rtn = await this.dao.create(params); rtn = await this.dao.create(params);
var secret = await this.getUidInfo(32); var secret = (await this.getUidInfo(32)).toLowerCase();
this.merchantapiSve.create({merchant_id: id, name: merchant.name, secret: secret}); this.merchantapiSve.create({merchant_id: id, name: merchant.name, secret: secret, is_enabled: true});
} }
return system.getResultSuccess(rtn); return system.getResultSuccess(rtn);
} catch (e) { } catch (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment