Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
8d123705
Commit
8d123705
authored
Mar 21, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
083c850b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
1 deletions
+79
-1
center-app/app/base/api/impl/auth/accessAuth.js
+15
-1
center-app/app/base/db/impl/dbapp/appmobilemsgDao.js
+16
-0
center-app/app/base/db/models/dbapp/appmobilemsg.js
+31
-0
center-app/app/base/service/impl/dbapp/appmobilemsgSve.js
+17
-0
No files found.
center-app/app/base/api/impl/auth/accessAuth.js
View file @
8d123705
...
...
@@ -4,6 +4,7 @@ class AccessAuthAPI extends APIBase {
constructor
()
{
super
();
this
.
opPlatformUtils
=
system
.
getObject
(
"util.businessManager.opPlatformUtils"
);
this
.
appmobilemsgSve
=
system
.
getObject
(
"service.dbapp.appmobilemsgSve"
);
}
async
getTokenByHosts
(
pobj
,
qobj
,
req
)
{
...
...
@@ -15,7 +16,20 @@ class AccessAuthAPI extends APIBase {
if
(
!
pobj
.
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"actionBody.mobile can not be empty !"
);
}
var
result
=
await
this
.
opPlatformUtils
.
fetchDefaultVCode
(
pobj
.
actionBody
.
mobile
,
pobj
.
appInfo
.
uapp_key
,
pobj
.
appInfo
.
uapp_secret
);
var
itemResult
=
await
this
.
appmobilemsgSve
.
getItemByUappId
(
pobj
);
var
result
=
system
.
getResult
(
null
,
"get msg error"
);
if
(
itemResult
.
status
!=
0
)
{
result
=
await
this
.
opPlatformUtils
.
fetchDefaultVCode
(
pobj
.
actionBody
.
mobile
,
pobj
.
appInfo
.
uapp_key
,
pobj
.
appInfo
.
uapp_secret
);
return
result
;
}
var
param
=
{
mobile
:
pobj
.
actionBody
.
mobile
,
tmplCode
:
itemResult
.
data
.
tmpl_code
,
signName
:
itemResult
.
data
.
sign_name
,
accessKeyId
:
itemResult
.
data
.
access_key_id
,
accessKeySecret
:
itemResult
.
data
.
access_key_secret
}
result
=
await
this
.
fetchOtherVCode
(
param
,
pobj
.
appInfo
.
uapp_key
,
pobj
.
appInfo
.
uapp_secret
);
return
result
;
}
...
...
center-app/app/base/db/impl/dbapp/appmobilemsgDao.js
0 → 100644
View file @
8d123705
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
AppMobileMsgDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
AppMobileMsgDao
));
}
async
getItemByUAppId
(
uapp_id
)
{
return
this
.
model
.
findOne
({
where
:
{
uapp_id
:
uapp_id
},
raw
:
true
});
}
}
module
.
exports
=
AppMobileMsgDao
;
center-app/app/base/db/models/dbapp/appmobilemsg.js
0 → 100644
View file @
8d123705
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"appmobilemsg"
,
{
uapp_id
:
DataTypes
.
STRING
(
50
),
tmpl_code
:
DataTypes
.
STRING
(
64
),
//短信模板code
sign_name
:
DataTypes
.
STRING
(
64
),
//短信签名
access_key_id
:
DataTypes
.
STRING
(
64
),
//短信秘钥key
is_enabled
:
{
//状态 0禁用 1启用
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
true
,
},
access_key_secret
:
DataTypes
.
STRING
(
255
),
//短信秘钥
notes
:
DataTypes
.
STRING
(
255
),
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
tableName
:
'p_app_mobilemsg'
,
validate
:
{
},
indexes
:
[
]
});
}
\ No newline at end of file
center-app/app/base/service/impl/dbapp/appmobilemsgSve.js
0 → 100644
View file @
8d123705
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
AppMobileMsgService
extends
ServiceBase
{
constructor
()
{
super
(
"dbapp"
,
ServiceBase
.
getDaoName
(
AppMobileMsgService
));
}
async
getItemByUappId
(
pobj
)
{
var
item
=
await
this
.
dao
.
getItemByUAppId
(
pobj
.
appInfo
.
uapp_id
);
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"Data is empty!"
);
}
return
system
.
getResultSuccess
(
item
);
}
}
module
.
exports
=
AppMobileMsgService
;
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