Commit 68b03231 by 王昆

gsb

parent b1ffd909
...@@ -43,14 +43,21 @@ class UserCtl extends CtlBase { ...@@ -43,14 +43,21 @@ class UserCtl extends CtlBase {
loginUser = loginUser.data; loginUser = loginUser.data;
var loginKey = await this.setLogin(loginUser); var loginKey = await this.setLogin(loginUser);
let ntapi = settings.ntapi(); let ntapi = settings.ntapi();
let loginUrl = settings.protocalPrefix + req.headers['host'] + "/#/logins";
console.log(loginUrl, "---------------loginUrl--------------");
let loginBaseUrl = system.base64_encode(loginUrl);
let test = system.base64_decode(loginBaseUrl);
console.log(test);
let rs = { let rs = {
key: loginKey.xggadminsid, key: loginKey.xggadminsid,
taxLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&target=tax`, taxLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&target=tax&baseurl=${loginBaseUrl}`,
finLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}`, finLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&baseurl=${loginBaseUrl}`,
loginname: loginUser.ucname, loginname: loginUser.ucname,
auth: loginUser.auth, auth: loginUser.auth,
isManager: loginUser.isManager, isManager: loginUser.isManager,
menus: {gtArr: this.getOrderMenu(loginUser), pjArr: this.getInvoiceMenu(loginUser)} menus: {gtArr: this.getOrderMenu(loginUser), pjArr: this.getInvoiceMenu(loginUser)},
loginUrl: loginUrl,
}; };
return system.getResultSuccess(rs); return system.getResultSuccess(rs);
......
var fs = require("fs"); const fs = require("fs");
var objsettings = require("../config/objsettings"); const objsettings = require("../config/objsettings");
var settings = require("../config/settings"); const settings = require("../config/settings");
const Base64 = require('js-base64').Base64;
class System { class System {
static declare(ns) { static declare(ns) {
var ar = ns.split('.'); var ar = ns.split('.');
...@@ -144,6 +146,15 @@ class System { ...@@ -144,6 +146,15 @@ class System {
} }
} }
} }
static base64_encode(str) {
return Base64.encodeURI(str || "");
}
static base64_decode(str) {
return Base64.decode(str || "");
}
static getUid(len, radix) { static getUid(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
var uuid = [], var uuid = [],
......
...@@ -18,7 +18,7 @@ var settings = { ...@@ -18,7 +18,7 @@ var settings = {
commonroleid: 1, commonroleid: 1,
passroleid: 2, passroleid: 2,
tanentroleid: 1, tanentroleid: 1,
protocalPrefix: "http://", protocalPrefix: ENVINPUT.APP_ENV == "dev" ? "http://" : "https://",
appKey: ENVINPUT.APP_ENV == "dev" ? "2f41920e82fa46dd98887d81df9457ab" : "728b979f7afd4413ac683344cd4a97fa", appKey: ENVINPUT.APP_ENV == "dev" ? "2f41920e82fa46dd98887d81df9457ab" : "728b979f7afd4413ac683344cd4a97fa",
secret: ENVINPUT.APP_ENV == "dev" ? "ede9b66ddb964d15b0a543b7ac7bb28f" : "f8891fcf37574f5a9f21b3030c302f4a", secret: ENVINPUT.APP_ENV == "dev" ? "ede9b66ddb964d15b0a543b7ac7bb28f" : "f8891fcf37574f5a9f21b3030c302f4a",
......
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