Commit c790c493 by 王昆

gsb

parent a6eb2b0e
...@@ -37,7 +37,7 @@ class TuserCtl extends CtlBase { ...@@ -37,7 +37,7 @@ class TuserCtl extends CtlBase {
loginInfo = loginInfo.data; loginInfo = loginInfo.data;
let key = await this.setLogin(loginInfo); let key = await this.setLogin(loginInfo);
return system.getResultSuccess({ return system.getResultSuccess({
login: key taxsid: key
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
......
...@@ -27,7 +27,7 @@ module.exports = function (app) { ...@@ -27,7 +27,7 @@ module.exports = function (app) {
app.all('*', function (req, res, next) { app.all('*', function (req, res, next) {
req.objs = system; req.objs = system;
res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, xggadminsid'); res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, taxsid');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS'); res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
// res.header('Access-Control-Allow-Credentials', 'true'); // res.header('Access-Control-Allow-Credentials', 'true');
if (req.method == 'OPTIONS') { if (req.method == 'OPTIONS') {
...@@ -40,7 +40,7 @@ module.exports = function (app) { ...@@ -40,7 +40,7 @@ module.exports = function (app) {
if (settings.env == "dev") { if (settings.env == "dev") {
app.use(session( app.use(session(
{ {
name: 'xggadminsid', name: 'taxsid',
cookie: { maxAge: 3600000 }, cookie: { maxAge: 3600000 },
rolling: true, rolling: true,
resave: false, resave: false,
......
...@@ -6,12 +6,12 @@ const redisClient = system.getObject("util.redisClient"); ...@@ -6,12 +6,12 @@ const redisClient = system.getObject("util.redisClient");
module.exports = function (app) { module.exports = function (app) {
app.all("/web/*", async function (req, res, next) { app.all("/web/*", async function (req, res, next) {
var xggadminsid; var loginToken;
var jsonUser = req.session.user; var jsonUser = req.session.user;
// var jsonUser = null; // var jsonUser = null;
if(!jsonUser) { if(!jsonUser) {
xggadminsid = req.headers["xggadminsid"] || ""; loginToken = req.headers["taxsid"] || "";
jsonUser = await redisClient.get(xggadminsid); jsonUser = await redisClient.get(loginToken);
if(jsonUser) { if(jsonUser) {
jsonUser = JSON.parse(jsonUser); jsonUser = JSON.parse(jsonUser);
} }
...@@ -33,8 +33,8 @@ module.exports = function (app) { ...@@ -33,8 +33,8 @@ module.exports = function (app) {
return; return;
} }
if(xggadminsid) { if(loginToken) {
redisClient.setWithEx(xggadminsid, JSON.stringify(jsonUser), 60 * 60 * 60); redisClient.setWithEx(loginToken, JSON.stringify(jsonUser), 60 * 60 * 60);
} }
req.loginUser = jsonUser; req.loginUser = jsonUser;
next(); next();
......
<a name="menu">目录</a> <a name="menu">目录</a>
1. [自动登录](#smartLogin)
1. [商户税务](#merchantTaxPage) 1. [商户税务](#merchantTaxPage)
1. [个人税务](#personTaxPage) 1. [个人税务](#personTaxPage)
1. [个人税务-完税证明](#personTaxPage_taxurl) 1. [个人税务-完税证明](#personTaxPage_taxurl)
## **<a name="smartLogin"> 自动登录 </a>**
[返回到目录](#menu)
##### URL
[/web/tax/tuserCtl/smartLogin]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"data": "AFx9j7LcjO7kte9dSNmFXIteTvWphfA4ZG2oqcOO2SwRVN5U0byxbZPP1w2d1JyHda062Hy3/tAB4ax8oOVswy7vsBBcNKRlOU1THT4pbyFgTVfHvxiNQ2hR5S6mYh4PnrmoJRXVjlTrb/61zZ4itQ=="
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"taxsid": "bt_3cb49932-fa02-44f0-90db-9f06fe02e5c7"
}
}
```
## **<a name="merchantTaxPage"> 商户税务 </a>**
[返回到目录](#menu)
##### URL
[/web/tax/tcompanytaxCtl/taxPage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": "1",
"pageSize": "10",
"month": "", // 月份 如:2019-02
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 1,
"rows": [
{
"companyName": "杭州淘粉吧网络技术股份有限公司", // 商户名
"mchtId": "1103667243432067073" // 商户id
"month_date": "2019-02", // 完税月份
"tax_url": "https://g...", // 完税pdf
"tax_amt": "0", // 完税金额
"created_at": "2020-02-27 03:32:22",
"updated_at": "2020-02-27 03:32:24",
"deleted_at": null,
"version": 0,
}
]
}
}
```
## **<a name="merchantTaxPage"> 商户税务 </a>** ## **<a name="merchantTaxPage"> 商户税务 </a>**
[返回到目录](#menu) [返回到目录](#menu)
##### URL ##### URL
......
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