Commit dbbffc0b authored by gengshaojing's avatar gengshaojing
parents 3c77906e ae1b92d9
......@@ -15,6 +15,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@types/qr-image": "^3.2.4",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"dayjs": "^1.10.6",
......@@ -28,6 +29,7 @@
"koa-static": "^5.0.0",
"koa-views": "^7.0.1",
"moment": "^2.29.1",
"qr-image": "^3.2.0",
"request": "^2.88.2",
"uglifyjs-webpack-plugin": "^2.2.0",
"uuid": "^8.3.2",
......
const qr = require('qr-image');
exports.gen_qr_code = async (ctx) => {
const url = ctx.query.url;
try {
let img = qr.image(decodeURIComponent(url));
ctx.type= 'image/png';
ctx.body = img;
} catch (e) {
ctx.type='text/html;charset=utf-8';
ctx.body='<h1>414 Request-URI Too Large</h1>';
}
};
......@@ -9,12 +9,14 @@ const goods = require('./controllers/goods');
const activity = require('./controllers/activity');
const withdrawal = require('./controllers/withdrawal');
const groupmeal = require('./controllers/groupmeal');
const qr_code = require('./controllers/qr-code');
const router = Router();
const API_VERSION = "/api/v1";
router.get(/^\/op.*/, static.index)
router.get(`${API_VERSION}/qr_code`, qr_code.gen_qr_code);
router.get(`${API_VERSION}/fetch_user`, system.fetch_user);
router.get(`${API_VERSION}/user/:type`, user.query)
router.post(`${API_VERSION}/J_login`, system.J_login);
......
......@@ -369,7 +369,7 @@ export default {
} else if (process.env.NODE_ENV == "test") {
ENV = "http://bp-test.ini.yidian-inc.com/";
} else {
ENV = "http://bp.ini.yidian-inc.com/";
ENV = "http://bp.int.yidian-inc.com/";
}
url && window.open(ENV + url);
},
......
......@@ -112,7 +112,7 @@ export function getOrderExportURL(eventId, type) {
}else if(process.env.NODE_ENV == "test"){
ENV = "http://bp-test.ini.yidian-inc.com/"
}else{
ENV = "http://bp.ini.yidian-inc.com/"
ENV = "http://bp.int.yidian-inc.com/"
}
return `${ENV}order/oldbackground/order_export?marketing_id=${eventId}&type=${type}`;
}
......@@ -190,7 +190,7 @@ export function newGetOrderExportURL(eventId, type) {
}else if(process.env.NODE_ENV == "test"){
ENV = "http://bp-test.ini.yidian-inc.com/"
}else{
ENV = "http://bp.ini.yidian-inc.com/"
ENV = "http://bp.int.yidian-inc.com/"
}
return `${ENV}order/background/order_export?marketing_id=${eventId}&type=${type}`;
}
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