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
78a765c4
Commit
78a765c4
authored
Nov 28, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xggsve-uc' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-uc
parents
c466c8de
4affbebd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
75 deletions
+60
-75
xggsve-uc/app/base/api/impl/op/action.js
+1
-1
xggsve-uc/app/base/db/impl/user/userorgDao.js
+0
-9
xggsve-uc/app/base/db/models/user/user.js
+7
-1
xggsve-uc/app/base/db/models/user/userorg.js
+0
-52
xggsve-uc/app/base/service/impl/user/userSve.js
+44
-2
xggsve-uc/app/base/service/impl/user/userorgSve.js
+0
-10
xggsve-uc/app/base/service/sve.base.js
+8
-0
No files found.
xggsve-uc/app/base/api/impl/op/action.js
View file @
78a765c4
...
...
@@ -111,9 +111,9 @@ class ActionAPI extends APIBase {
case
"listRole"
:
opResult
=
await
this
.
roleSve
.
apiListRole
(
action_body
);
break
;
// 用户
case
"addUser"
:
break
;
case
"updUser"
:
break
;
...
...
xggsve-uc/app/base/db/impl/user/userorgDao.js
deleted
100644 → 0
View file @
c466c8de
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
UserorgDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
UserorgDao
));
}
}
module
.
exports
=
UserorgDao
;
\ No newline at end of file
xggsve-uc/app/base/db/models/user/user.js
View file @
78a765c4
...
...
@@ -7,11 +7,17 @@ module.exports = (db, DataTypes) => {
ucname
:
DataTypes
.
STRING
,
password
:
DataTypes
.
STRING
,
uctype
:
DataTypes
.
INTEGER
,
saas_id
:
DataTypes
.
INTEGER
,
org_id
:
DataTypes
.
INTEGER
,
orgpath
:
DataTypes
.
STRING
,
isMain
:
{
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
true
},
isEnabled
:
{
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
true
},
saas_id
:
DataTypes
.
INTEGER
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
...
...
xggsve-uc/app/base/db/models/user/userorg.js
deleted
100644 → 0
View file @
c466c8de
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"userorg"
,
{
user_id
:
DataTypes
.
INTEGER
,
org_id
:
DataTypes
.
INTEGER
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'uc_user_org'
,
validate
:
{
},
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
\ No newline at end of file
xggsve-uc/app/base/service/impl/user/userSve.js
View file @
78a765c4
...
...
@@ -4,6 +4,7 @@ const settings = require("../../../../config/settings")
class
UserService
extends
ServiceBase
{
constructor
()
{
super
(
"user"
,
ServiceBase
.
getDaoName
(
UserService
));
this
.
user
}
...
...
@@ -36,5 +37,47 @@ class UserService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
add
(
obj
)
{
var
roles
=
obj
.
roles
||
[];
var
org
=
obj
.
org
;
var
saas_id
=
Number
(
obj
.
saas_id
||
0
);
var
ucname
=
this
.
trim
(
obj
.
ucname
);
var
password
=
this
.
trim
(
obj
.
password
);
var
uctype
=
this
.
trim
(
obj
.
uctype
);
var
mobile
=
this
.
trim
(
obj
.
mobile
);
var
realName
=
this
.
trim
(
obj
.
realName
);
if
(
!
saas_id
)
{
// TODO 写到这
}
var
user
=
{
ucid
:
ucid
,
ucname
:
ucname
,
password
:
password
,
uctype
:
uctype
,
org_id
:
org
.
id
,
isMain
:
obj
.
isMain
||
0
,
orgpath
:
""
,
password
:
""
,
isEnabled
:
1
,
}
var
info
=
{
mobile
:
mobile
,
realName
:
realName
,
}
var
self
=
this
;
await
self
.
db
.
transaction
(
async
function
(
t
)
{
// 创建商户
user
=
await
self
.
dao
.
create
(
user
,
t
);
return
user
;
});
}
}
module
.
exports
=
UserService
;
\ No newline at end of file
module
.
exports
=
UserService
;
xggsve-uc/app/base/service/impl/user/userorgSve.js
deleted
100644 → 0
View file @
c466c8de
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
class
UserorgService
extends
ServiceBase
{
constructor
()
{
super
(
"user"
,
ServiceBase
.
getDaoName
(
UserorgService
));
}
}
module
.
exports
=
UserorgService
;
\ No newline at end of file
xggsve-uc/app/base/service/sve.base.js
View file @
78a765c4
...
...
@@ -272,5 +272,13 @@ class ServiceBase {
}
return
o
.
toString
().
trim
();
}
async
getEncryptStr
(
str
)
{
if
(
!
str
)
{
throw
new
Error
(
"字符串不能为空"
);
}
var
md5
=
md5
(
str
+
"_"
+
settings
.
salt
);
return
md5
.
toString
().
toLowerCase
();
}
}
module
.
exports
=
ServiceBase
;
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