Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
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
a53605fa
authored
Jan 03, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
供应商账号加密
parent
fc6c76a7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
3 deletions
app/Http/Controllers/Api/SupplierAccountApiController.php
app/Http/Transformers/SupplierAccountTransformer.php
resources/views/script/SupplierAccountListScript.blade.php
resources/views/script/supplier/SupplierContactScript.blade.php
app/Http/Controllers/Api/SupplierAccountApiController.php
View file @
a53605fa
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Filter\SupplierAccountFilter
;
use
App\Http\Services\LogService
;
use
App\Http\Services\SupplierAccountService
;
use
App\Http\Transformers\SupplierLogTransformer
;
use
App\Http\Validators\SupplierAccountValidator
;
...
...
@@ -131,4 +132,16 @@ class SupplierAccountApiController extends Controller
}
$this
->
response
(
-
1
,
'禁用失败'
,
$result
);
}
public
function
GetSupplierAccount
(
$request
)
{
$id
=
$request
->
input
(
'id'
);
$type
=
$request
->
input
(
'type'
);
$account
=
SupplierAccountModel
::
where
(
'id'
,
$id
)
->
first
()
->
toArray
();
$logService
=
new
LogService
();
$temp
=
(
$type
==
'mobile'
)
?
'账号'
:
'密码'
;
$content
=
$request
->
user
->
name
.
' 查看了供应商账号的'
.
$temp
;
$logService
->
AddLog
(
$account
[
'supplier_id'
],
LogModel
::
VIEW_OPERATE
,
'查看供应商基本资料'
,
$content
);
$this
->
response
(
0
,
'ok'
,
$account
);
}
}
app/Http/Transformers/SupplierAccountTransformer.php
View file @
a53605fa
...
...
@@ -19,6 +19,11 @@ class SupplierAccountTransformer
$item
[
'type_name'
]
=
array_get
(
config
(
'field.SupplierAccountType'
),
$item
[
'a_type'
]);
$item
[
'create_time'
]
=
$item
[
'create_time'
]
?
date
(
'Y-m-d H:i:s'
,
$item
[
'create_time'
])
:
''
;
$item
[
'update_time'
]
=
$item
[
'update_time'
]
?
date
(
'Y-m-d H:i:s'
,
$item
[
'update_time'
])
:
''
;
if
(
!
empty
(
$item
[
'mobile'
]))
{
$item
[
'mobile'
]
=
substr
(
$item
[
'mobile'
],
0
,
3
)
.
'****'
.
substr
(
$item
[
'mobile'
],
7
);
}
$replace
=
str_pad
(
'*'
,
strlen
(
$item
[
'password_raw'
]),
'*'
);
$item
[
'password_raw'
]
=
str_replace
(
$item
[
'password_raw'
],
$replace
,
$item
[
'password_raw'
]);
}
unset
(
$item
);
...
...
resources/views/script/SupplierAccountListScript.blade.php
View file @
a53605fa
...
...
@@ -15,9 +15,17 @@
{
type
:
'radio'
},
{
field
:
'id'
,
title
:
'ID'
,
align
:
'center'
,
width
:
80
},
{
field
:
'mobile'
,
title
:
'账号'
,
align
:
'center'
,
width
:
170
field
:
'mobile'
,
title
:
'账号'
,
align
:
'center'
,
width
:
170
,
templet
:
function
(
data
)
{
return
'
<
span
>
' + data.mobile + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="mobile" id="' + data.id + '">查看</
span
>
'
}
},
{
field: '
password_raw
', title: '
密码
', align: '
center
', width: 170,
templet: function (data) {
return '
<
span
>
' + data.password_raw + '
<
/span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="password_raw" id="' + data.id + '">查看</
span
>
'
}
},
{
field
:
'password_raw'
,
title
:
'密码'
,
align
:
'center'
,
width
:
170
},
{
field: '
supplier_code
', title: '
供应商编码
', align: '
center
', width: 120
},
...
...
@@ -145,5 +153,29 @@
location
.
reload
();
});
$
(
document
).
on
(
'click'
,
'.viewAccount'
,
function
()
{
let
id
=
$
(
this
).
attr
(
'id'
);
let
type
=
$
(
this
).
attr
(
'type'
);
let
resp
=
ajax
(
'/api/supplier_account/GetSupplierAccount'
,
{
id
:
id
,
type
:
type
});
if
(
!
resp
)
{
layer
.
msg
(
'网络连接失败'
,
{
'icon'
:
5
});
return
false
;
}
if
(
resp
.
err_code
===
0
)
{
switch
(
type
)
{
case
'mobile'
:
$
(
this
).
prev
().
text
(
resp
.
data
.
mobile
);
break
;
case
'password_raw'
:
$
(
this
).
prev
().
text
(
resp
.
data
.
password_raw
);
break
;
}
console
.
log
(
resp
);
}
else
{
layer
.
msg
(
resp
.
err_msg
,
{
'icon'
:
5
});
return
false
;
}
});
});
</script>
\ No newline at end of file
resources/views/script/supplier/SupplierContactScript.blade.php
View file @
a53605fa
...
...
@@ -149,7 +149,6 @@
});
}
//删除
$
(
document
).
on
(
'click'
,
'.viewContact'
,
function
()
{
let
contactId
=
$
(
this
).
attr
(
'contact_id'
);
let
type
=
$
(
this
).
attr
(
'type'
);
...
...
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