Commit 94b2fa9b by 王昆

gsb

parent ef7b3237
...@@ -2,6 +2,9 @@ const system = require("../system"); ...@@ -2,6 +2,9 @@ const system = require("../system");
const moment = require('moment') const moment = require('moment')
const settings = require("../../config/settings"); const settings = require("../../config/settings");
const md5 = require("MD5"); const md5 = require("MD5");
const axios = require('axios');
class ServiceBase { class ServiceBase {
constructor() { constructor() {
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
...@@ -220,7 +223,16 @@ class ServiceBase { ...@@ -220,7 +223,16 @@ class ServiceBase {
"action_type": apiName, "action_type": apiName,
"action_body": params || {}, "action_body": params || {},
} }
if(settings.env == 'dev') {
let rs = await axios({
method: 'post',
url: reqUrl,
data: params
});
console.log(rs);
return rs.data;
}
var rs = await this.restClient.execPost(params, reqUrl); var rs = await this.restClient.execPost(params, reqUrl);
if (rs && rs.stdout) { if (rs && rs.stdout) {
return JSON.parse(rs.stdout); return JSON.parse(rs.stdout);
......
...@@ -169,8 +169,9 @@ class System { ...@@ -169,8 +169,9 @@ class System {
console.log(settings.env, "-------------- microsetting env ------------------"); console.log(settings.env, "-------------- microsetting env ------------------");
var path = "/api/op/action/springboard"; var path = "/api/op/action/springboard";
if (settings.env == "dev") { if (settings.env == "dev") {
var domain = "http://192.168.18.237"; // var domain = "http://192.168.18.237";
// var domain = "http://127.0.0.1"; var domain = "http://127.0.0.1";
var domain2 = "http://39.107.234.14";
return { return {
// 公共服务 // 公共服务
common: domain + ":3102" + path, common: domain + ":3102" + path,
...@@ -189,7 +190,7 @@ class System { ...@@ -189,7 +190,7 @@ class System {
// invoice: "http://127.0.0.1:3105" + path, // invoice: "http://127.0.0.1:3105" + path,
// 用户中心 // 用户中心
uc: domain + ":3106" + path , uc: domain2 + ":3106" + path ,
// uc: "http://127.0.0.1:3106" + path, // uc: "http://127.0.0.1:3106" + path,
} }
} else { } else {
......
...@@ -10,10 +10,10 @@ var settings={ ...@@ -10,10 +10,10 @@ var settings={
user: "write", user: "write",
password: "write", password: "write",
config: { config: {
host: '192.168.18.237', // host: '192.168.18.237',
port: 3306, // port: 3306,
// host: '43.247.184.35', host: '43.247.184.35',
// port: 8899, port: 8899,
dialect: 'mysql', dialect: 'mysql',
operatorsAliases: false, operatorsAliases: false,
pool: { pool: {
......
...@@ -354,6 +354,14 @@ ...@@ -354,6 +354,14 @@
"integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==",
"dev": true "dev": true
}, },
"axios": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
"requires": {
"follow-redirects": "1.5.10"
}
},
"babel-helper-vue-jsx-merge-props": { "babel-helper-vue-jsx-merge-props": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz", "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
...@@ -2115,6 +2123,24 @@ ...@@ -2115,6 +2123,24 @@
"integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=", "integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=",
"dev": true "dev": true
}, },
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
}
}
},
"for-in": { "for-in": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"MD5": "^1.3.0", "MD5": "^1.3.0",
"after": "^0.8.2", "after": "^0.8.2",
"ali-oss": "^4.12.2", "ali-oss": "^4.12.2",
"axios": "^0.19.2",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"base64id": "^1.0.0", "base64id": "^1.0.0",
"bluebird": "^3.5.1", "bluebird": "^3.5.1",
......
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