Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
config_repository
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
config_repository
Commits
f4914f21
Commit
f4914f21
authored
Dec 26, 2017
by
daidekun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rm
parent
312a5374
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
60 deletions
+0
-60
toChannel.lua.bak
openresty/lua/toChannel.lua.bak
+0
-60
No files found.
openresty/lua/toChannel.lua.bak
deleted
100644 → 0
View file @
312a5374
function string.split(str)
local splitlist = {};
string.gsub(str, '[^,]+', function(w) table.insert(splitlist, w) end )
return splitlist;
end
function isInTable(value, tbl)
for k,v in ipairs(tbl) do
if v == value then
return true;
end
end
return false;
end
local path = ngx.var.normalPath;
local channelPath = ngx.var.channelPath;
if (ngx.var.registerChannel == '' and ngx.var.merchantChannel == '') then
return path;
end
local register = string.split(ngx.var.registerChannel);
local merchant = string.split(ngx.var.merchantChannel);
local register_cookie = ngx.var.cookie_registerFrom
local merchant_cookie = ngx.var.cookie_merchantId
local args = ngx.req.get_uri_args()
local register_uri = args['registerFrom']
local merchant_uri = args['merchantId']
if (register_uri) then
hitRegister = isInTable(register_uri, register)
else
hitRegister = isInTable(register_cookie, register)
end
if (merchant_uri) then
hitMerchantId = isInTable(merchant_uri, register)
else
hitMerchantId = isInTable(merchant_cookie, register)
end
local baiTiao = '222';
local isBaitiao = (register_cookie == baiTiao or register_uri == baiTiao)
if (isBaitiao and ngx.var.merchantChannel == '') then
return channelPath
end
if (isBaitiao and ngx.var.merchantChannel ~= '' and hitMerchantId) then
return channelPath
end
if ( not isBaitiao and hitRegister) then
return channelPath
end
return path;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment