Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ikcrm_sms
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
ikcrm_server
ikcrm_sms
Commits
24dd1692
Commit
24dd1692
authored
Jun 19, 2019
by
kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add oem sign name
parent
d21d1c39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
lib/sms.rb
+9
-3
No files found.
lib/sms.rb
View file @
24dd1692
...
@@ -18,9 +18,13 @@ def redis
...
@@ -18,9 +18,13 @@ def redis
end
end
end
end
def
load_config
def
load_config
(
oem_sign_name
=
nil
)
if
defined?
::
Rails
if
defined?
::
Rails
@sms_config
||=
HashWithIndifferentAccess
.
new
(
YAML
.
load_file
(
"
#{
::
Rails
.
root
}
/config/sms.yml"
)[
::
Rails
.
env
]
||
{})
@sms_config
||=
HashWithIndifferentAccess
.
new
(
YAML
.
load_file
(
"
#{
::
Rails
.
root
}
/config/sms.yml"
)[
::
Rails
.
env
]
||
{})
# 短信签名 根据OEM品牌名筛选
@sms_config
[
:taobao
][
:sms_free_sign_name
]
=
oem_sign_name
if
oem_sign_name
.
present?
&&
@sms_config
.
present?
@sms_config
else
else
{}
{}
end
end
...
@@ -52,9 +56,11 @@ class SmsSender
...
@@ -52,9 +56,11 @@ class SmsSender
end
end
def
extend_attrs
def
extend_attrs
return
unless
load_config
.
present?
_load_config
=
load_config
(
attrs
[
:oem_sign_name
])
return
unless
_load_config
.
present?
self
.
source_config
=
load_config
[
attrs
[
:source
]]
self
.
source_config
=
_
load_config
[
attrs
[
:source
]]
return
unless
source_config
.
present?
return
unless
source_config
.
present?
self
.
attrs
=
source_config
.
merge
(
attrs
)
self
.
attrs
=
source_config
.
merge
(
attrs
)
...
...
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