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
ca31f10d
Commit
ca31f10d
authored
Dec 27, 2017
by
daidekun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change name to lua-ui
parent
cc152d74
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
0 additions
and
346 deletions
+0
-346
new-paycenter-ui.js
openresty/config/new-paycenter-ui.js
+0
-10
paycenter-ui.js
openresty/config/paycenter-ui.js
+0
-9
xjd-ui.js
openresty/config/xjd-ui.js
+0
-26
xyqb-ui.js
openresty/config/xyqb-ui.js
+0
-43
default.conf
openresty/default.conf
+0
-9
addCookie.lua
openresty/lua/addCookie.lua
+0
-11
channel.conf
openresty/lua/channel.conf
+0
-57
isGray.lua
openresty/lua/isGray.lua
+0
-34
parseConfig.lua
openresty/lua/parseConfig.lua
+0
-15
toChannel.lua
openresty/lua/toChannel.lua
+0
-75
paycenter-ui.conf
openresty/paycenter-ui.conf
+0
-29
xyqb-ui.conf
openresty/xyqb-ui.conf
+0
-28
No files found.
openresty/config/new-paycenter-ui.js
deleted
100644 → 0
View file @
cc152d74
var
protocol
=
window
.
location
.
protocol
var
apiHost
=
protocol
+
'
//payapi.xyqb.com
'
;
var
xyqbUserUrl
=
protocol
+
'
//passport.xyqb.com
'
;
module
.
exports
=
{
api
:
apiHost
,
test
:
false
,
xyqbUserUrl
:
xyqbUserUrl
}
openresty/config/paycenter-ui.js
deleted
100644 → 0
View file @
cc152d74
var
protocal
=
window
.
location
.
protocol
;
var
apiHost
=
protocal
+
'
//payapi.xyqb.com
'
;
module
.
exports
=
{
api
:
apiHost
,
test
:
true
};
\ No newline at end of file
openresty/config/xjd-ui.js
deleted
100644 → 0
View file @
cc152d74
var
protocol
=
window
.
location
.
protocol
var
apiHost
=
protocol
+
'
//api.xyqb.com/
'
var
xyqbUserUIHost
=
protocol
+
'
//passport.xyqb.com/
'
var
activityUI
=
protocol
+
'
//activity.xyqb.com/
'
var
qiniuHost
=
protocol
+
'
//ohsx2fi5w.bkt.clouddn.com/
'
var
btHost
=
protocol
+
'
//bt.xyqb.com/
'
var
shuntHost
=
protocol
+
'
//flow.xyqb.com/
'
var
mallApi
=
protocol
+
'
//mallapi.xyqb.com
'
;
var
mallUrl
=
protocol
+
'
//mall.xyqb.com
'
;
var
h5Url
=
protocol
+
'
//h5.xyqb.com
'
;
var
redPacketUrl
=
protocol
+
'
//redpacket.xyqb.com/
'
;
module
.
exports
=
{
ApiBaseUrl
:
apiHost
,
// 信用钱包后端
XyqbUserUI
:
xyqbUserUIHost
,
// 用户中心
ActivityUI
:
activityUI
,
// 活动中心
QiniuHostUrl
:
qiniuHost
,
BtBaseUrl
:
btHost
,
// 白条
ShuntBaseUrl
:
shuntHost
,
// 流量分发
mallApi
:
mallApi
,
// 商城后端
mallUrl
:
mallUrl
,
// 商城前端
h5Url
:
h5Url
,
RedPacketUrl
:
redPacketUrl
// 红包
}
openresty/config/xyqb-ui.js
deleted
100644 → 0
View file @
cc152d74
(
function
()
{
'
use strict
'
;
var
protocol
=
window
.
location
.
protocol
;
var
apiHost
=
protocol
+
'
//api.xyqb.com/
'
;
var
xyqbUserUIHost
=
protocol
+
'
//passport.xyqb.com/
'
;
var
authHost
=
protocol
+
'
//auth.xyqb.com/
'
;
var
bankCardReturnToken
=
'
BIND_RETURN_ONLINE
'
;
var
repayReturnToken
=
'
REPAY_RETURN_ONLINE
'
;
var
rebindRepayReturnToken
=
'
REBIND_RETURN_ONLINE
'
;
var
activityUI
=
protocol
+
'
//activity.xyqb.com/
'
;
var
qiniuHost
=
protocol
+
'
//ohsx2fi5w.bkt.clouddn.com/
'
;
var
btHost
=
protocol
+
'
//bt.xyqb.com/
'
;
var
shuntHost
=
protocol
+
'
//flow.xyqb.com/
'
;
var
h5Host
=
protocol
+
'
//h5.xyqb.com/
'
;
var
xyqbApp
=
angular
.
module
(
'
xyqbUiApp
'
);
xyqbApp
.
value
(
'
ApiBaseUrl
'
,
apiHost
);
xyqbApp
.
value
(
'
AuthBaseUrl
'
,
authHost
);
xyqbApp
.
value
(
'
ActivityUI
'
,
activityUI
);
xyqbApp
.
value
(
'
QiniuHostUrl
'
,
qiniuHost
);
xyqbApp
.
value
(
'
BtBaseUrl
'
,
btHost
);
xyqbApp
.
value
(
'
ShuntBaseUrl
'
,
shuntHost
);
xyqbApp
.
value
(
'
XyqbUserUI
'
,
xyqbUserUIHost
);
xyqbApp
.
value
(
'
h5BaseUrl
'
,
h5Host
);
if
(
location
.
host
===
'
58.xyqb.com
'
)
{
bankCardReturnToken
=
'
58BIND_RETURN_ONLINE
'
;
repayReturnToken
=
'
58REPAY_RETURN_ONLINE
'
;
rebindRepayReturnToken
=
'
58REBIND_RETURN_ONLINE
'
;
xyqbApp
.
value
(
'
BindCardToken
'
,
bankCardReturnToken
);
xyqbApp
.
value
(
'
RepayToken
'
,
repayReturnToken
);
xyqbApp
.
value
(
'
RebindToken
'
,
rebindRepayReturnToken
);
}
else
{
xyqbApp
.
value
(
'
BindCardToken
'
,
bankCardReturnToken
);
xyqbApp
.
value
(
'
RepayToken
'
,
repayReturnToken
);
xyqbApp
.
value
(
'
RebindToken
'
,
rebindRepayReturnToken
);
}
})();
openresty/default.conf
deleted
100644 → 0
View file @
cc152d74
server
{
listen
80
;
server_name
_
;
location
/ {
root
/
home
/
quant_group
/
project
/
public
;
try_files
$
uri
$
uri
/ /
index
.
html
;
}
}
\ No newline at end of file
openresty/lua/addCookie.lua
deleted
100644 → 0
View file @
cc152d74
local
args
=
ngx
.
req
.
get_uri_args
()
local
register_uri
=
args
[
'registerFrom'
]
local
merchant_uri
=
args
[
'merchantId'
]
if
(
register_uri
)
then
ngx
.
header
[
'Set-Cookie'
]
=
{
'registerFrom='
..
register_uri
..
'; path=/;'
}
end
if
(
merchant_uri
)
then
ngx
.
header
[
'Set-Cookie'
]
=
{
'merchantId='
..
merchant_uri
..
'; path=/;'
}
end
openresty/lua/channel.conf
deleted
100644 → 0
View file @
cc152d74
worker_processes
1
;
error_log
logs
/
error
.
log
;
events
{
worker_connections
1024
;
}
http
{
access_log
logs
/
access
.
log
combined
;
server
{
listen
8100
;
server_name
sc
.
xyqb
.
com
;
gzip
on
;
gzip_min_length
1
k
;
gzip_buffers
4
16
k
;
gzip_http_version
1
.
0
;
gzip_comp_level
2
;
gzip_types
text
/
plain
application
/
x
-
javascript
text
/
css
application
/
xml
application
/
javascript
;
gzip_vary
on
;
# 正常发布路径 和 灰度发布路径
set
$
rootPath
"/Users/xuezhijie/playground/nginx/test1/public"
;
set
$
gatedRootPath
"/Users/xuezhijie/playground/nginx/test1-gated/public"
;
# jenkins灰度渠道参数
set
$
gatedStr
"registerFrom=1,2&merchantId=2,3"
;
# 解析灰度配置
# 1,2
set_by_lua_file
$
regConfig
confs
/
parseConfig
.
lua
$
gatedStr
"registerFrom"
;
# 2,3
set_by_lua_file
$
merchantConfig
confs
/
parseConfig
.
lua
$
gatedStr
"merchantId"
;
location
/ {
echo
"http_cookie: $http_cookie"
;
# 获取cookie渠道号,判断是否属于灰度范围
echo
"registerFrom渠道号: $cookie_registerFrom"
;
echo
"merchantId渠道号: $cookie_merchantId"
;
echo
"灰度配置registerFrom: $regConfig"
;
echo
"灰度配置merchantId: $merchantConfig"
;
set_by_lua_file
$
isGray
confs
/
isGray
.
lua
$
regConfig
$
merchantConfig
$
cookie_registerFrom
$
cookie_merchantId
;
echo
$
isGray
;
# 按渠道发布
if
($
isGray
!=
''
) {
set
$
rootPath
$
gatedRootPath
;
}
root
$
rootPath
;
try_files
$
uri
$
uri
/ /
index
.
html
;
}
}
}
\ No newline at end of file
openresty/lua/isGray.lua
deleted
100644 → 0
View file @
cc152d74
--[[ 参数:
registerFrom 灰度设置
merchantId 灰度设置
cookie registerFrom值
cookie merchantId值
]]
local
regConfig
=
ngx
.
arg
[
1
];
local
merConfig
=
ngx
.
arg
[
2
];
local
regCookie
=
ngx
.
arg
[
3
];
local
merCookie
=
ngx
.
arg
[
4
];
local
isGrayReg
=
false
;
local
isGrayMer
=
false
;
if
(
regConfig
~=
''
and
regCookie
~=
''
and
string.find
(
regConfig
,
regCookie
))
then
isGrayReg
=
true
;
end
if
(
merConfig
~=
''
and
merCookie
~=
''
and
string.find
(
merConfig
,
merCookie
))
then
isGrayMer
=
true
;
end
local
isGray
=
''
;
if
(
isGrayReg
or
isGrayMer
)
then
isGray
=
'1'
;
end
--print(isGray)
return
isGray
;
\ No newline at end of file
openresty/lua/parseConfig.lua
deleted
100644 → 0
View file @
cc152d74
local
t
=
""
;
local
str
=
ngx
.
arg
[
1
];
local
prop
=
ngx
.
arg
[
2
];
-- local str = "registerFrom=1,2,3&merchantId=2,3";
-- local prop = "merchantId";
for
k
,
v
in
string.gmatch
(
str
,
"(%w+)=([%w,]+)"
)
do
if
(
k
==
prop
)
then
-- print(k, v)
t
=
v
;
break
;
end
end
return
t
;
\ No newline at end of file
openresty/lua/toChannel.lua
deleted
100644 → 0
View file @
cc152d74
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
);
-- cookie值
local
register_cookie
=
ngx
.
var
.
cookie_registerFrom
local
merchant_cookie
=
ngx
.
var
.
cookie_merchantId
-- uri参数值
local
args
=
ngx
.
req
.
get_uri_args
()
local
register_uri
=
args
[
'registerFrom'
]
local
merchant_uri
=
args
[
'merchantId'
]
-- 优先匹配参数中的registerFrom
if
(
register_uri
)
then
hitRegister
=
isInTable
(
register_uri
,
register
)
else
hitRegister
=
isInTable
(
register_cookie
,
register
)
end
-- 优先匹配参数中的merchantId
if
(
merchant_uri
)
then
hitMerchantId
=
isInTable
(
merchant_uri
,
register
)
else
hitMerchantId
=
isInTable
(
merchant_cookie
,
register
)
end
local
baiTiao
=
'222'
;
--
if
(
register_uri
)
then
isBaitiao
=
register_uri
==
baiTiao
else
isBatitiao
=
register_cookie
==
baiTiao
end
-- 是白条,未设置merchantId规则,命中
if
(
isBaitiao
and
ngx
.
var
.
merchantChannel
==
''
)
then
return
channelPath
end
-- 是白条,设置了merchantId规则,匹配merchantId后命中
if
(
isBaitiao
and
ngx
.
var
.
merchantChannel
~=
''
and
hitMerchantId
)
then
return
channelPath
end
-- 不是白条,匹配registerFrom后命中
if
(
not
isBaitiao
and
hitRegister
)
then
return
channelPath
end
return
path
;
openresty/paycenter-ui.conf
deleted
100644 → 0
View file @
cc152d74
server
{
listen
80
;
gzip
on
;
gzip_min_length
1
k
;
gzip_buffers
4
16
k
;
gzip_http_version
1
.
0
;
gzip_comp_level
4
;
gzip_types
text
/
plain
application
/
x
-
javascript
text
/
css
application
/
xml
application
/
javascript
;
gzip_vary
on
;
set
$
normalPath
"/home/quant_group/paycenter-ui/dist"
;
set
$
channelPath
"/home/quant_group/new-paycenter-ui/dist"
;
set
$
registerChannel
"758,222,198"
;
set
$
merchantChannel
""
;
location
/ {
expires
-
1
;
set_by_lua_file
$
rootPath
/
usr
/
local
/
openresty
/
nginx
/
conf
/
conf
.
d
/
lua
/
toChannel
.
lua
;
header_filter_by_lua_file
/
usr
/
local
/
openresty
/
nginx
/
conf
/
conf
.
d
/
lua
/
addCookie
.
lua
;
root
$
rootPath
;
try_files
$
uri
$
uri
/ /
index
.
html
?$
query_string
;
}
}
openresty/xyqb-ui.conf
deleted
100644 → 0
View file @
cc152d74
server
{
listen
80
;
gzip
on
;
gzip_min_length
1
k
;
gzip_buffers
4
16
k
;
gzip_http_version
1
.
0
;
gzip_comp_level
4
;
gzip_types
text
/
plain
application
/
x
-
javascript
text
/
css
application
/
xml
application
/
javascript
;
gzip_vary
on
;
set
$
normalPath
"/home/quant_group/xyqb-ui/dist/public"
;
set
$
channelPath
"/home/quant_group/xjd-ui/dist"
;
set
$
registerChannel
"864,158744"
;
set
$
merchantChannel
""
;
location
/ {
expires
-
1
;
set_by_lua_file
$
rootPath
/
usr
/
local
/
openresty
/
nginx
/
conf
/
conf
.
d
/
lua
/
toChannel
.
lua
;
header_filter_by_lua_file
/
usr
/
local
/
openresty
/
nginx
/
conf
/
conf
.
d
/
lua
/
addCookie
.
lua
;
root
$
rootPath
;
try_files
$
uri
$
uri
/ /
index
.
html
?$
query_string
;
}
}
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