Commit a660b28e by 孙亚楠

d

parent a5c03210
const system=require("../../system");
const Dao=require("../dao.base");
class CwxsignapiDao extends Dao{
constructor(){
super(Dao.getModelName(CwxsignapiDao));
}
}
module.exports=CwxsignapiDao;
const system=require("../../system");
const Dao=require("../dao.base");
class CwxsigninfoDao extends Dao{
constructor(){
super(Dao.getModelName(CwxsigninfoDao));
}
}
module.exports=CwxsigninfoDao;
const system=require("../../system");
const settings=require("../../../config/settings");
const uiconfig=system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {
return db.define("cwxsignapi", {
app_id: {
type: DataTypes.BIGINT,
allowNull: true,
},
app_secret: {
type: DataTypes.BIGINT,
allowNull: true,
},
app_type: {
type: DataTypes.BIGINT,
allowNull: true,
comment:'应用类型 0无需签约 1两方签 2三方签'
},
auth_type: {
type: DataTypes.BIGINT,
allowNull: true,
comment:'认证类型 0无认证 1姓名二要素 2银行卡三要素 3银行卡四要素'
},
company_id: {
type: DataTypes.BIGINT,
allowNull: true,
},//需要在后台补充
ecid: {
type: DataTypes.BIGINT,
allowNull: true,
},
wx_notify_url:{
type:DataTypes.STRING,
allowNull: true
},
sign_notify_url:{
type:DataTypes.STRING,
allowNull: true,
},
redirect_url:{
type:DataTypes.STRING,
allowNull: true,
},
form_field:{
type:DataTypes.STRING,
allowNull: true,
},
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'c_wxsign_api',
validate: {},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system=require("../../system");
const settings=require("../../../config/settings");
const uiconfig=system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {
return db.define("cwxsigninfo", {
api_id: {
type: DataTypes.BIGINT,
allowNull: true,
},
openId: {
type: DataTypes.STRING,
allowNull: true,
},
id_name: {
type: DataTypes.STRING,
allowNull: true
},
id_no: {
type: DataTypes.STRING,
allowNull: true
},
mobile: {
type: DataTypes.STRING,
allowNull: true,
},//需要在后台补充
bank_no: {
type: DataTypes.STRING,
allowNull: true,
},
contract_id:{
type:DataTypes.BIGINT,
allowNull: true
},
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'c_wxsign_info',
validate: {},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system=require("../../system");
const ServiceBase=require("../sve.base");
class CwxsignapiService extends ServiceBase{
constructor(){
super(ServiceBase.getDaoName(CwxsignapiService));
}
}
module.exports=CwxsignapiService;
const system=require("../../system");
const ServiceBase=require("../sve.base");
class cwxsigninfoService extends ServiceBase{
constructor(){
super(ServiceBase.getDaoName(cwxsigninfoService));
}
/**
* fn:保存签约信息
* @param params
* @returns {Promise<void>}
*/
async save(params){
try {
let properties = {};
properties.api_id=this.trim(params.api_id) || "";
properties.openId=this.trim(params.openId) || "";
properties.id_name=this.trim(params.id_name) || "";
properties.id_no=this.trim(params.id_no) || "";
properties.mobile=this.trim(params.mobile) || "";
properties.bank_no=this.trim(params.bank_no) || "";
properties.contract_id=this.trim(params.contract_id) || "";
let res = await this.dao.creat(properties);
return system.getResult(res);
}catch (e) {
console.log(e);
system.getResult(null, `系统错误`);
}
}
}
module.exports=cwxsigninfoService;
......@@ -110,8 +110,8 @@ var app = new Vue({
}
url = url.split("?")[0];
// url = "https://bpohhr.gongsibao.com/bpoproxy"
// http://192.168.18.125:3000/wxsign?comid=10172&userCode=100018&nonceStr=nonceStrnonceStr&sign=E47D90EA49DCB7E9114A27767DCBF3C2
url = "https://bpohhr.gongsibao.com/bpoproxy"
// http://127.0.0.1:3000/wxsign?comid=10172&userCode=100018&nonceStr=nonceStrnonceStr&sign=E47D90EA49DCB7E9114A27767DCBF3C2
var redirect_uri = encodeURIComponent(url);
var appkey = this.appid;
var wxurl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appkey}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=${this.companyId}#wechat_redirect`;
......
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