Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d44c7c60
authored
Jan 12, 2018
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
配置调整
parent
86ebc545
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
124 additions
and
53 deletions
app/Http/Controllers/MessageApiController.php
app/Http/Controllers/MessageController.php
config/app.php
config/msgconfig.php
config/perm.php
resources/views/message/addtemplate.blade.php
resources/views/message/allhistorylist.blade.php
resources/views/message/manualhistorylist.blade.php
resources/views/message/sendmanualmessage.blade.php
resources/views/message/templatelist.blade.php
app/Http/Controllers/MessageApiController.php
View file @
d44c7c60
...
...
@@ -231,18 +231,17 @@ class MessageApiController extends Controller
$this
->
Export
(
11024
,
'已存在相同模板描述,请更换描述内容'
);
}
// $url = 'http://api.liexin.com/msg/sendMessageByHandle';
// $url = 'http://szapi.ichunt.com/msg/sendMessageByHandle';
// $url = 'http://api.ichunt.com/msg/sendMessageByHandle';
$url
=
''
;
$current_domain
=
$_SERVER
[
'HTTP_HOST'
];
if
(
$current_domain
===
"message.liexin.com"
)
if
(
$current_domain
===
Config
(
'msgconfig.domain_local'
))
{
$url
=
Config
(
'msgconfig.api_domain_local'
);
}
elseif
(
$current_domain
===
Config
(
'msgconfig.domain_sz'
))
{
$url
=
Config
(
'
app.api_address'
)[
'local'
]
;
}
elseif
(
$current_domain
===
"message.ichunt.net"
)
$url
=
Config
(
'
msgconfig.api_domain_sz'
)
;
}
elseif
(
$current_domain
===
Config
(
'msgconfig.domain_release'
)
)
{
$url
=
Config
(
'
app.api_address'
)[
'test'
]
;
$url
=
Config
(
'
msgconfig.api_domain_release'
)
;
}
$params
=
[];
...
...
app/Http/Controllers/MessageController.php
View file @
d44c7c60
...
...
@@ -97,7 +97,7 @@ class MessageController extends Controller
$paths
=
[[
"title"
=>
"消息管理系统"
,
"href"
=>
'/database/'
]];
$username
=
$request
->
user
->
email
;
$useremail
=
$request
->
user
->
email
;
$menuconfig
=
DB
::
table
(
'config'
)
->
where
(
'config_id'
,
4
)
->
first
();
$menuconfig
=
DB
::
table
(
'config'
)
->
where
(
'config_id'
,
$this
->
getConfigId
()
)
->
first
();
$menus
=
[];
if
(
$menuconfig
&&
!
(
$menus
=
json_decode
(
$menuconfig
->
config_data
)))
$menus
=
[];
...
...
@@ -125,7 +125,7 @@ class MessageController extends Controller
$paths
=
[[
"title"
=>
"首页"
,
"href"
=>
'/database/'
]];
$username
=
$request
->
user
->
email
;
$useremail
=
$request
->
user
->
email
;
$menuconfig
=
DB
::
table
(
'config'
)
->
where
(
'config_id'
,
4
)
->
first
();
$menuconfig
=
DB
::
table
(
'config'
)
->
where
(
'config_id'
,
$this
->
getConfigId
()
)
->
first
();
$menus
=
[];
if
(
$menuconfig
&&
!
(
$menus
=
json_decode
(
$menuconfig
->
config_data
)))
$menus
=
[];
...
...
@@ -696,10 +696,28 @@ class MessageController extends Controller
{
$perms_str
=
implode
(
','
,
$perms_arr
);
$uid
=
$request
->
user
->
userId
;
// $bid = 8;
// $url = "http://perm.liexin.net/api/check/$uid/$bid/?perms=$perms_str";
$bid
=
Config
(
'perm.bid'
);
$perm_url
=
Config
(
'perm.url'
);
$bid
=
""
;
$perm_url
=
""
;
//区分环境
$current_domain
=
$_SERVER
[
'HTTP_HOST'
];
if
(
$current_domain
===
Config
(
'msgconfig.domain_local'
))
{
$bid
=
Config
(
'msgconfig.perm_bid_local'
);
$perm_url
=
Config
(
'msgconfig.perm_domain_local'
);
}
elseif
(
$current_domain
===
Config
(
'msgconfig.domain_sz'
))
{
$bid
=
Config
(
'msgconfig.perm_bid_sz'
);
$perm_url
=
Config
(
'msgconfig.perm_domain_sz'
);
}
elseif
(
$current_domain
===
Config
(
'msgconfig.domain_release'
))
{
$bid
=
Config
(
'msgconfig.perm_bid_release'
);
$perm_url
=
Config
(
'msgconfig.perm_domain_release'
);
}
$url
=
$perm_url
.
"/api/check/
$uid
/
$bid
/?perms=
$perms_str
"
;
$res
=
json_decode
(
curl
(
$url
),
true
);
if
(
!
$res
[
'retcode'
])
...
...
@@ -707,4 +725,23 @@ class MessageController extends Controller
return
$res
[
'data'
][
'perms'
];
}
}
//根据当前域名获取config_id
private
function
getConfigId
()
{
$current_domain
=
$_SERVER
[
'HTTP_HOST'
];
if
(
$current_domain
===
Config
(
'msgconfig.domain_local'
))
{
return
Config
(
'msgconfig.config_id_local'
);
}
elseif
(
$current_domain
===
Config
(
'msgconfig.domain_sz'
))
{
return
Config
(
'msgconfig.config_id_sz'
);
}
elseif
(
$current_domain
===
Config
(
'msgconfig.domain_release'
))
{
return
Config
(
'msgconfig.config_id_release'
);
}
}
}
\ No newline at end of file
config/app.php
View file @
d44c7c60
...
...
@@ -203,9 +203,4 @@ return [
],
'api_address'
=>
[
'local'
=>
'http://api.liexin.com/msg/sendMessageByHandle'
,
'test'
=>
'http://szapi.ichunt.com/msg/sendMessageByHandle'
,
],
];
config/msgconfig.php
0 → 100644
View file @
d44c7c60
<?php
/**
* Created by PhpStorm.
* User: leo
* Date: 2018/1/11
* Time: 19:17
*/
return
[
//域名
'domain_local'
=>
'message.liexin.com'
,
'domain_sz'
=>
'szmessage.ichunt.net'
,
'domain_release'
=>
'message.ichunt.net'
,
//接口地址
'api_domain_local'
=>
'http://api.liexin.com/msg/sendMessageByHandle'
,
'api_domain_sz'
=>
'http://szapi.ichunt.com/msg/sendMessageByHandle'
,
'api_domain_release'
=>
'http://api.ichunt.com/msg/sendMessageByHandle'
,
//项目config_id
'config_id_local'
=>
4
,
'config_id_sz'
=>
5
,
'config_id_release'
=>
5
,
//权限配置
'perm_bid_local'
=>
8
,
'perm_bid_sz'
=>
6
,
'perm_bid_release'
=>
6
,
'perm_domain_local'
=>
"http://perm.liexin.net"
,
'perm_domain_sz'
=>
"http://perm.ichunt.net"
,
'perm_domain_release'
=>
"http://perm.ichunt.net"
,
];
\ No newline at end of file
config/perm.php
deleted
100644 → 0
View file @
86ebc545
<?php
/**
* Created by PhpStorm.
* User: leo
* Date: 2017/12/27
* Time: 16:10
*/
return
[
'bid'
=>
8
,
'url'
=>
"http://perm.liexin.net"
,
'消息管理'
=>
[
'消息模板列表'
=>
[
'template_check'
],
'新增消息模板'
=>
[
'template_create'
,
'template_edit'
],
'手动消息历史'
=>
[
'manualhistorylist_check'
],
'手动发送消息'
=>
[
'manualmessage_edit'
,
'manualmessage_send'
],
'全部历史消息'
=>
[
'allhistorylist_check'
],
],
];
\ No newline at end of file
resources/views/message/addtemplate.blade.php
View file @
d44c7c60
...
...
@@ -287,7 +287,13 @@
<div
style=
"text-align: center"
>
<label
style=
"margin-top: 30px"
>
对不起,您没有权限查看此页面
</label>
<div>
<a
href=
"{{ Config('perm.url').'/page/business/'.Config('perm.bid').'/request/template_create' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@if($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_local'))
<a
href=
"{{ Config('msgconfig.perm_domain_local').'/page/business/'.Config('msgconfig.perm_bid_local').'/request/template_create' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_sz'))
<a
href=
"{{ Config('msgconfig.perm_domain_sz').'/page/business/'.Config('msgconfig.perm_bid_sz').'/request/template_create' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_release'))
<a
href=
"{{ Config('msgconfig.perm_domain_release').'/page/business/'.Config('msgconfig.perm_bid_release').'/request/template_create' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@endif
</div>
</div>
@endif
\ No newline at end of file
resources/views/message/allhistorylist.blade.php
View file @
d44c7c60
...
...
@@ -180,7 +180,13 @@
<div
style=
"text-align: center"
>
<label
style=
"margin-top: 30px"
>
对不起,您没有权限查看此页面
</label>
<div>
<a
href=
"{{ Config('perm.url').'/page/business/'.Config('perm.bid').'/request/allhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@if($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_local'))
<a
href=
"{{ Config('msgconfig.perm_domain_local').'/page/business/'.Config('msgconfig.perm_bid_local').'/request/allhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_sz'))
<a
href=
"{{ Config('msgconfig.perm_domain_sz').'/page/business/'.Config('msgconfig.perm_bid_sz').'/request/allhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_release'))
<a
href=
"{{ Config('msgconfig.perm_domain_release').'/page/business/'.Config('msgconfig.perm_bid_release').'/request/allhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@endif
</div>
</div>
@endif
...
...
resources/views/message/manualhistorylist.blade.php
View file @
d44c7c60
...
...
@@ -116,7 +116,13 @@
<div
style=
"text-align: center"
>
<label
style=
"margin-top: 30px"
>
对不起,您没有权限查看此页面
</label>
<div>
<a
href=
"{{ Config('perm.url').'/page/business/'.Config('perm.bid').'/request/manualhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@if($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_local'))
<a
href=
"{{ Config('msgconfig.perm_domain_local').'/page/business/'.Config('msgconfig.perm_bid_local').'/request/manualhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_sz'))
<a
href=
"{{ Config('msgconfig.perm_domain_sz').'/page/business/'.Config('msgconfig.perm_bid_sz').'/request/manualhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_release'))
<a
href=
"{{ Config('msgconfig.perm_domain_release').'/page/business/'.Config('msgconfig.perm_bid_release').'/request/manualhistorylist_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@endif
</div>
</div>
@endif
resources/views/message/sendmanualmessage.blade.php
View file @
d44c7c60
...
...
@@ -322,7 +322,13 @@
<div
style=
"text-align: center"
>
<label
style=
"margin-top: 30px"
>
对不起,您没有权限查看此页面
</label>
<div>
<a
href=
"{{ Config('perm.url').'/page/business/'.Config('perm.bid').'/request/manualmessage_send' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@if($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_local'))
<a
href=
"{{ Config('msgconfig.perm_domain_local').'/page/business/'.Config('msgconfig.perm_bid_local').'/request/manualmessage_send' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_sz'))
<a
href=
"{{ Config('msgconfig.perm_domain_sz').'/page/business/'.Config('msgconfig.perm_bid_sz').'/request/manualmessage_send' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_release'))
<a
href=
"{{ Config('msgconfig.perm_domain_release').'/page/business/'.Config('msgconfig.perm_bid_release').'/request/manualmessage_send' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@endif
</div>
</div>
@endif
\ No newline at end of file
resources/views/message/templatelist.blade.php
View file @
d44c7c60
...
...
@@ -91,7 +91,13 @@
<div
style=
"text-align: center"
>
<label
style=
"margin-top: 30px"
>
对不起,您没有权限查看此页面
</label>
<div>
<a
href=
"{{ Config('perm.url').'/page/business/'.Config('perm.bid').'/request/template_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@if($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_local'))
<a
href=
"{{ Config('msgconfig.perm_domain_local').'/page/business/'.Config('msgconfig.perm_bid_local').'/request/template_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_sz'))
<a
href=
"{{ Config('msgconfig.perm_domain_sz').'/page/business/'.Config('msgconfig.perm_bid_sz').'/request/template_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@elseif ($_SERVER['HTTP_HOST'] === Config('msgconfig.domain_release'))
<a
href=
"{{ Config('msgconfig.perm_domain_release').'/page/business/'.Config('msgconfig.perm_bid_release').'/request/template_check' }}"
target=
"_blank"
class=
"btn btn-primary"
>
申请权限
</a>
@endif
</div>
</div>
@endif
...
...
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