Commit eaf8cd17 by linboxuan

lin add getAllService

parent 25859d1b
......@@ -87,7 +87,7 @@ class AccessAuthAPI extends APIBase {
if (!actionBody.vcode) {
return system.getResult(null, "actionBody.vcode can not be empty !");
}
if(!pobj.userInfo){
if (!pobj.userInfo) {
return system.getResult(null, "userpin can not be empty !");
}
var result = await this.opPlatformUtils.putUserMobileByVcode(pobj, actionBody);
......@@ -114,10 +114,14 @@ class AccessAuthAPI extends APIBase {
* 获取所有渠道
* @returns {Promise<void>}
*/
async getAllChannels(){
async getAllChannels() {
var result = await this.utilsappSve.getAllChannels();
return result;
}
async getAllService() {
var result = await this.utilsappSve.getAllService();
return result;
}
}
module.exports = AccessAuthAPI;
\ No newline at end of file
......@@ -52,11 +52,11 @@ class UtilsAppSve extends AppServiceBase {
async getAppInfo(pobj) {
var uapp_id = pobj.uappId || "";
var app = await this.appDao.findOne({app_code:uapp_id});
if(app) {
var app = await this.appDao.findOne({ app_code: uapp_id });
if (app) {
return system.getResultSuccess(app);
}
if(!app) {
if (!app) {
return system.getResult(null, "渠道码错误")
}
}
......@@ -65,10 +65,20 @@ class UtilsAppSve extends AppServiceBase {
* 获取所有渠道
* @returns {Promise<{msg: *, data: (*|null), status: number}>}
*/
async getAllChannels(){
async getAllChannels() {
let sql = `SELECT DISTINCT(uapp_id),app_name FROM p_app`;
let result = await this.appDao.customQuery(sql);
return system.getResultSuccess(result);
}
/**
* 获取所有渠道
* @returns {Promise<{msg: *, data: (*|null), status: number}>}
*/
async getAllService() {
let sql = `select uapp_id,app_hosts,app_name,\`desc\` from p_app`;
let result = await this.appDao.customQuery(sql);
return system.getResultSuccess(result);
}
}
module.exports = UtilsAppSve;
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