Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
TokenVaultManagement
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jasonwai
TokenVaultManagement
Commits
8c30004c
Commit
8c30004c
authored
2 years ago
by
Jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.fix 權限登入問題
2.修改密碼邏輯
parent
8f51b435
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
194 additions
and
160 deletions
+194
-160
KeyController.cs
...n Vault Management/backstage/Controllers/KeyController.cs
+7
-4
TokenVaultController .cs
...Management/backstage/Controllers/TokenVaultController .cs
+11
-11
UserController.cs
... Vault Management/backstage/Controllers/UserController.cs
+84
-69
User.cs
...ant Token Vault Management/backstage/Models/Users/User.cs
+1
-0
ListKeys.cshtml
...oken Vault Management/backstage/Views/Key/ListKeys.cshtml
+4
-1
_Layout.cshtml
...en Vault Management/backstage/Views/Shared/_Layout.cshtml
+2
-2
ListUsers.cshtml
...lt Management/backstage/Views/TokenVault/ListUsers.cshtml
+85
-73
key_part1.png
...n Vault Management/backstage/wwwroot/images/key_part1.png
+0
-0
key_part2.png
...n Vault Management/backstage/wwwroot/images/key_part2.png
+0
-0
No files found.
Merchant Token Vault Management/backstage/Controllers/KeyController.cs
View file @
8c30004c
...
@@ -173,14 +173,17 @@ namespace backstage.Controllers
...
@@ -173,14 +173,17 @@ namespace backstage.Controllers
{
{
// 下載圖檔位元組數據
// 下載圖檔位元組數據
byte
[]
imageBytes
=
await
client
.
GetByteArrayAsync
(
imageUrl
);
byte
[]
imageBytes
=
await
client
.
GetByteArrayAsync
(
imageUrl
);
System
.
IO
.
File
.
Delete
(
imagePath
);
// 將圖檔寫入目標路徑
// 將圖檔寫入目標路徑
System
.
IO
.
File
.
WriteAllBytes
(
imagePath
,
imageBytes
);
System
.
IO
.
File
.
WriteAllBytes
(
imagePath
,
imageBytes
);
// 添加下載路徑到集合中
// 添加下載路徑到集合中
if
(
System
.
IO
.
File
.
Exists
(
imagePath
))
{
string
downloadPath
=
Path
.
Combine
(
"/images"
,
fileName
);
string
downloadPath
=
Path
.
Combine
(
"/images"
,
fileName
);
downloadPaths
.
Add
(
downloadPath
);
downloadPaths
.
Add
(
downloadPath
);
}
}
}
}
}
result
.
Data
=
downloadPaths
;
result
.
Data
=
downloadPaths
;
#
region
step2
combine
key
#
region
step2
combine
key
...
...
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/Controllers/TokenVaultController .cs
View file @
8c30004c
...
@@ -628,20 +628,20 @@ namespace backstage.Controllers
...
@@ -628,20 +628,20 @@ namespace backstage.Controllers
/// <returns></returns>
/// <returns></returns>
[
Authorize
(
Policy
=
"AdminOnly"
)]
[
Authorize
(
Policy
=
"AdminOnly"
)]
[
HttpPost
]
[
HttpPost
]
public
async
Task
<
ResultModel
>
AddUsers
([
FromBody
]
JsonElement
requestData
)
public
async
Task
<
ResultModel
>
AddUsers
([
FromBody
]
IFormCollection
form
)
{
{
string
msg
;
string
msg
;
var
result
=
new
ResultModel
();
var
result
=
new
ResultModel
();
int
Merchant_id
=
requestData
.
GetProperty
(
"Merchant_id"
).
GetInt32
(
);
int
merchant_id
=
Convert
.
ToInt32
(
form
[
"merchant_id"
]
);
int
vault_id
=
requestData
.
GetProperty
(
"vault_id"
).
GetInt32
(
);
int
vault_id
=
Convert
.
ToInt32
(
form
[
"vault_id"
]
);
int
field_id
=
requestData
.
GetProperty
(
"field_id"
).
GetInt32
(
);
int
field_id
=
Convert
.
ToInt32
(
form
[
"field_id"
]
);
int
user_id
=
requestData
.
GetProperty
(
"user_id"
).
GetInt32
(
);
int
user_id
=
Convert
.
ToInt32
(
form
[
"id"
]
);
// 構建包含參數的查詢字串
// 構建包含參數的查詢字串
var
queryString
=
new
RouteValueDictionary
{
var
queryString
=
new
RouteValueDictionary
{
{
"Merchant_id"
,
M
erchant_id
},
{
"Merchant_id"
,
m
erchant_id
},
{
"vault_id"
,
vault_id
},
{
"vault_id"
,
vault_id
},
{
"field_id"
,
field_id
},
{
"field_id"
,
field_id
},
};
};
...
@@ -749,7 +749,7 @@ namespace backstage.Controllers
...
@@ -749,7 +749,7 @@ namespace backstage.Controllers
var
DepartmentsResponse
=
JsonConvert
.
DeserializeObject
<
DepartmentsResponse
>(
apiResult
.
Data
.
ToString
());
var
DepartmentsResponse
=
JsonConvert
.
DeserializeObject
<
DepartmentsResponse
>(
apiResult
.
Data
.
ToString
());
if
(
DepartmentsResponse
.
count
>
0
)
if
(
DepartmentsResponse
.
count
>
0
)
{
{
var
existDepartment
=
DepartmentsResponse
.
merchants
.
Where
(
m
=>
m
.
merchant_id
==
M
erchant_id
).
FirstOrDefault
();
var
existDepartment
=
DepartmentsResponse
.
merchants
.
Where
(
m
=>
m
.
merchant_id
==
m
erchant_id
).
FirstOrDefault
();
if
(
existDepartment
==
null
)
if
(
existDepartment
==
null
)
{
{
switch
(
_currentLanguage
)
switch
(
_currentLanguage
)
...
@@ -820,7 +820,7 @@ namespace backstage.Controllers
...
@@ -820,7 +820,7 @@ namespace backstage.Controllers
httpMethod
=
HttpMethod
.
Post
;
httpMethod
=
HttpMethod
.
Post
;
parameters
=
new
Dictionary
<
string
,
string
>
parameters
=
new
Dictionary
<
string
,
string
>
{
{
{
"Merchant_id"
,
M
erchant_id
.
ToString
()
},
{
"Merchant_id"
,
m
erchant_id
.
ToString
()
},
{
"id"
,
vault_id
.
ToString
()
},
{
"id"
,
vault_id
.
ToString
()
},
{
"info"
,
"FIELDS"
},
{
"info"
,
"FIELDS"
},
...
@@ -904,7 +904,7 @@ namespace backstage.Controllers
...
@@ -904,7 +904,7 @@ namespace backstage.Controllers
{
{
new
{
new
{
userId
=
user_id
.
ToString
(),
userId
=
user_id
.
ToString
(),
merchantId
=
M
erchant_id
.
ToString
()
merchantId
=
m
erchant_id
.
ToString
()
}
}
};
};
parameters
=
new
Dictionary
<
string
,
string
>
parameters
=
new
Dictionary
<
string
,
string
>
...
@@ -949,7 +949,7 @@ namespace backstage.Controllers
...
@@ -949,7 +949,7 @@ namespace backstage.Controllers
{
"token"
,
token
},
{
"token"
,
token
},
{
"vault_id"
,
vault_id
.
ToString
()},
{
"vault_id"
,
vault_id
.
ToString
()},
{
"access_code"
,
"31"
},
{
"access_code"
,
"31"
},
{
"merchant_id"
,
M
erchant_id
.
ToString
()},
{
"merchant_id"
,
m
erchant_id
.
ToString
()},
{
"user_id"
,
user_id
.
ToString
()},
{
"user_id"
,
user_id
.
ToString
()},
};
};
...
@@ -999,7 +999,7 @@ namespace backstage.Controllers
...
@@ -999,7 +999,7 @@ namespace backstage.Controllers
{
"id"
,
vault_id
.
ToString
()},
{
"id"
,
vault_id
.
ToString
()},
{
"info"
,
"USERS"
},
{
"info"
,
"USERS"
},
{
"Merchant_id"
,
M
erchant_id
.
ToString
()},
{
"Merchant_id"
,
m
erchant_id
.
ToString
()},
{
"data"
,
JsonConvert
.
SerializeObject
(
addUserToField_data
)},
{
"data"
,
JsonConvert
.
SerializeObject
(
addUserToField_data
)},
};
};
...
...
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/Controllers/UserController.cs
View file @
8c30004c
...
@@ -277,7 +277,7 @@ namespace backstage.Controllers
...
@@ -277,7 +277,7 @@ namespace backstage.Controllers
}
}
[
Authorize
]
[
Authorize
(
Policy
=
"AdminOnly"
)
]
[
HttpGet
]
[
HttpGet
]
public
async
Task
<
IActionResult
>
ListUsers
()
public
async
Task
<
IActionResult
>
ListUsers
()
{
{
...
@@ -458,7 +458,7 @@ namespace backstage.Controllers
...
@@ -458,7 +458,7 @@ namespace backstage.Controllers
/// 修改密碼
/// 修改密碼
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
Authorize
(
Policy
=
"AdminOnly"
)
]
[
Authorize
]
[
HttpGet
]
[
HttpGet
]
public
async
Task
<
IActionResult
>
ChangePassword
(
string
username
,
string
returnUrl
)
public
async
Task
<
IActionResult
>
ChangePassword
(
string
username
,
string
returnUrl
)
{
{
...
@@ -657,7 +657,7 @@ namespace backstage.Controllers
...
@@ -657,7 +657,7 @@ namespace backstage.Controllers
{
{
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"msg"
]
=
JsonConvert
.
SerializeObject
(
userAddResponse
.
m
);
TempData
[
"msg"
]
=
JsonConvert
.
SerializeObject
(
userAddResponse
.
m
);
return
View
(
user
);
return
RedirectToAction
(
"GetUser"
,
new
{
uid
=
user
.
uid
}
);
}
}
...
@@ -960,16 +960,35 @@ namespace backstage.Controllers
...
@@ -960,16 +960,35 @@ namespace backstage.Controllers
//修改密碼
//修改密碼
if
(!
string
.
IsNullOrEmpty
(
user
.
newPassword
))
if
(!
string
.
IsNullOrEmpty
(
user
.
newPassword
))
{
{
var
u
=
new
UserLogin
();
string
user_token
=
""
;
url
=
_config
[
"IP"
];
parameters
=
new
Dictionary
<
string
,
string
>
{
{
"username"
,
user
.
username
},
{
"pwd"
,
user
.
password
},
{
"reqPermFlag[0]"
,
"merchant-login"
}
};
apiResult
=
await
_callApi
.
CallAPI
(
url
,
parameters
,
httpMethod
);
if
(
apiResult
.
IsSuccess
)
{
// API 呼叫成功,進行相應的處理
u
=
JsonConvert
.
DeserializeObject
<
UserLogin
>(
apiResult
.
Data
.
ToString
());
if
(
u
.
r
==
0
&&
!
string
.
IsNullOrEmpty
(
u
.
token
))
{
user_token
=
u
.
token
;
existUser
.
password
=
user
.
newPassword
;
existUser
.
password
=
user
.
newPassword
;
url
=
_config
[
"IP"
]
+
"/user/changepassword"
;
url
=
_config
[
"IP"
]
+
"/user/changepassword"
;
parameters
=
new
Dictionary
<
string
,
string
>
parameters
=
new
Dictionary
<
string
,
string
>
{
{
{
"token"
,
token
},
{
"token"
,
user_
token
},
{
"oldpwd"
,
user
.
password
},
{
"oldpwd"
,
user
.
password
},
{
"newpwd"
,
user
.
newPassword
}
{
"newpwd"
,
user
.
newPassword
}
};
};
apiResult
=
await
_callApi
.
CallAPI
(
url
,
parameters
,
httpMethod
);
apiResult
=
await
_callApi
.
CallAPI
(
url
,
parameters
,
httpMethod
);
...
@@ -999,38 +1018,32 @@ namespace backstage.Controllers
...
@@ -999,38 +1018,32 @@ namespace backstage.Controllers
}
}
else
else
{
{
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"msg"
]
=
response
.
m
;
TempData
[
"msg"
]
=
response
.
r
+
","
+
response
.
m
;
return
View
(
);
return
RedirectToAction
(
"GetUser"
,
new
{
uid
=
user
.
uid
}
);
}
}
return
RedirectToAction
(
"ListUsers"
);
return
RedirectToAction
(
"ListUsers"
);
}
}
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"msg"
]
=
apiResult
.
Message
;
return
RedirectToAction
(
"GetUser"
,
new
{
uid
=
user
.
uid
});
}
}
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"msg"
]
=
u
.
r
+
","
+
u
.
m
.
ToString
();
return
RedirectToAction
(
"GetUser"
,
new
{
uid
=
user
.
uid
});
return
RedirectToAction
(
"ListUsers"
);
}
}
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"msg"
]
=
apiResult
.
Message
;
return
RedirectToAction
(
"GetUser"
,
new
{
uid
=
user
.
uid
});
}
switch
(
_currentLanguage
)
{
case
"en"
:
msg
=
"user_id is not exist."
;
break
;
case
"zh"
:
msg
=
"user_id不存在"
;
break
;
default
:
msg
=
"user_id不存在"
;
break
;
return
RedirectToAction
(
"ListUsers"
);
}
}
TempData
[
"IsSuccess"
]
=
false
;
TempData
[
"msg"
]
=
msg
;
return
View
(
existUser
);
}
}
...
@@ -1251,10 +1264,10 @@ namespace backstage.Controllers
...
@@ -1251,10 +1264,10 @@ namespace backstage.Controllers
address
=
"null"
,
address
=
"null"
,
countryid
=
"Taiwan"
,
countryid
=
"Taiwan"
,
postcode
=
"123"
,
postcode
=
"123"
,
phone
=
"null"
,
phone
=
"null"
,
name_en
=
"null"
,
name_en
=
"null"
,
VATID_verify
=
"1"
,
VATID_verify
=
"1"
,
enabled
=
1
enabled
=
1
};
};
...
@@ -1367,10 +1380,8 @@ namespace backstage.Controllers
...
@@ -1367,10 +1380,8 @@ namespace backstage.Controllers
var
parameters
=
new
Dictionary
<
string
,
string
>
var
parameters
=
new
Dictionary
<
string
,
string
>
{
{
{
"token"
,
token
},
{
"token"
,
token
},
{
"types"
,
JsonConvert
.
SerializeObject
(
types_data
)},
{
"types"
,
JsonConvert
.
SerializeObject
(
types_data
)}
{
"email"
,
"1"
},
{
"phone"
,
"1"
}
//{ "types", "{\"inc\":[\"all\"]}"}
};
};
...
@@ -1457,7 +1468,6 @@ namespace backstage.Controllers
...
@@ -1457,7 +1468,6 @@ namespace backstage.Controllers
result
.
IsSuccess
=
false
;
result
.
IsSuccess
=
false
;
result
.
Message
=
msg
;
result
.
Message
=
msg
;
return
result
;
return
result
;
return
result
;
}
}
}
}
else
else
...
@@ -1466,10 +1476,15 @@ namespace backstage.Controllers
...
@@ -1466,10 +1476,15 @@ namespace backstage.Controllers
httpMethod
=
HttpMethod
.
Post
;
httpMethod
=
HttpMethod
.
Post
;
existAdmin
.
enabled
=
isAdmin
;
existAdmin
.
enabled
=
isAdmin
;
var
data
=
new
{
uid
=
existAdmin
.
uid
,
admin_role_id
=
"1"
,
enabled
=
isAdmin
};
parameters
=
new
Dictionary
<
string
,
string
>
parameters
=
new
Dictionary
<
string
,
string
>
{
{
{
"token"
,
token
},
{
"token"
,
token
},
{
"data"
,
JsonConvert
.
SerializeObject
(
existAdmin
)}
{
"data"
,
JsonConvert
.
SerializeObject
(
data
)}
};
};
apiResult
=
await
_callApi
.
CallAPI
(
url
,
parameters
,
httpMethod
);
apiResult
=
await
_callApi
.
CallAPI
(
url
,
parameters
,
httpMethod
);
...
...
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/Models/Users/User.cs
View file @
8c30004c
...
@@ -34,6 +34,7 @@ namespace backstage.Models.Users
...
@@ -34,6 +34,7 @@ namespace backstage.Models.Users
public
string
lang
{
get
;
set
;
}
=
"zhg"
;
public
string
lang
{
get
;
set
;
}
=
"zhg"
;
//判斷是否為admin
//判斷是否為admin
public
bool
isAdmin
{
get
;
set
;
}
=
false
;
public
bool
isAdmin
{
get
;
set
;
}
=
false
;
public
int
[]
admin_rold_id
{
get
;
set
;
}
=
new
int
[
1
];
//最高權限
//=========Fields=========
//=========Fields=========
public
List
<
int
>
masks
{
get
;
set
;}
public
List
<
int
>
masks
{
get
;
set
;}
...
...
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/Views/Key/ListKeys.cshtml
View file @
8c30004c
...
@@ -400,6 +400,8 @@
...
@@ -400,6 +400,8 @@
// 页面加载完成后,隐藏 maskSettingsAdvID
// 页面加载完成后,隐藏 maskSettingsAdvID
//刪除鑰匙
//刪除鑰匙
$("#confirmBtn").on("click", function (e) {
$("#confirmBtn").on("click", function (e) {
e.preventDefault(); // 防止點擊後刷新頁面(如果該鏈接是 <a> 標籤)
e.preventDefault(); // 防止點擊後刷新頁面(如果該鏈接是 <a> 標籤)
...
@@ -455,7 +457,8 @@
...
@@ -455,7 +457,8 @@
$('#image2').attr('src', imageUrls[1]);
$('#image2').attr('src', imageUrls[1]);
$('#downloadBtn1').attr('href', imageUrls[0]);
$('#downloadBtn1').attr('href', imageUrls[0]);
$('#downloadBtn2').attr('href', imageUrls[1]);
$('#downloadBtn2').attr('href', imageUrls[1]);
$('#imageModal').modal();
$('#imageModal').modal({ backdrop: 'static', keyboard: false });
//setTimeout(function () {
//setTimeout(function () {
// location.reload();
// location.reload();
//}, 2000);
//}, 2000);
...
...
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/Views/Shared/_Layout.cshtml
View file @
8c30004c
...
@@ -79,12 +79,12 @@
...
@@ -79,12 +79,12 @@
<a
class=
"dropdown-item"
asp-controller=
"User"
asp-action=
"ChangePassword"
asp-route-username=
"@Context.User.Claims.FirstOrDefault(m => m.Type == "
username
").
Value
"
asp-route-returnUrl=
"@Context.Request.Path.Value"
>
<a
class=
"dropdown-item"
asp-controller=
"User"
asp-action=
"ChangePassword"
asp-route-username=
"@Context.User.Claims.FirstOrDefault(m => m.Type == "
username
").
Value
"
asp-route-returnUrl=
"@Context.Request.Path.Value"
>
<i
class=
"mdi mdi-lock-open mr-2"
></i>
@Localizer["Change Password"]
<i
class=
"mdi mdi-lock-open mr-2"
></i>
@Localizer["Change Password"]
</a>
</a>
<a
class=
"dropdown-item"
asp-controller=
"User"
asp-action=
"Register"
>
@*
<a
class=
"dropdown-item"
asp-controller=
"User"
asp-action=
"Register"
>
<i
class=
"mdi mdi-account-plus mr-2"
></i>
@Localizer["Setting Backup"]
<i
class=
"mdi mdi-account-plus mr-2"
></i>
@Localizer["Setting Backup"]
</a>
</a>
<a
class=
"dropdown-item"
asp-controller=
""
asp-action=
""
>
<a
class=
"dropdown-item"
asp-controller=
""
asp-action=
""
>
<i
class=
"mdi mdi-account-details mr-2"
></i>
@Localizer["Vault Backup"]
<i
class=
"mdi mdi-account-details mr-2"
></i>
@Localizer["Vault Backup"]
</a>
</a>
*@
<div
class=
"dropdown-divider"
></div>
<div
class=
"dropdown-divider"
></div>
<a
class=
"dropdown-item"
asp-controller=
"User"
asp-action=
"Logout"
>
<a
class=
"dropdown-item"
asp-controller=
"User"
asp-action=
"Logout"
>
...
...
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/Views/TokenVault/ListUsers.cshtml
View file @
8c30004c
...
@@ -135,8 +135,6 @@
...
@@ -135,8 +135,6 @@
</div>
</div>
</div>
</div>
</div>-->
</div>-->
<!--新增使用者 Popup Form-->
<!--新增使用者 Popup Form-->
<div class="modal fade modal-full" id="new-field-user" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal fade modal-full" id="new-field-user" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal-dialog modalforMemberGo">
<div class="modal-dialog modalforMemberGo">
...
@@ -155,7 +153,7 @@
...
@@ -155,7 +153,7 @@
</div> <!--END of div "modal-header"-->
</div> <!--END of div "modal-header"-->
<div class="modal-body" style="padding-top:35px">
<div class="modal-body" style="padding-top:35px">
<form class="form-horizontal0">
<form
id="addUserForm"
class="form-horizontal0">
<!-- <div class="form-group">
<!-- <div class="form-group">
<label class="control-labe" for="name">姓名:</label>
<label class="control-labe" for="name">姓名:</label>
...
@@ -169,12 +167,15 @@
...
@@ -169,12 +167,15 @@
<input type="text" class="form-control form-control-sm0">
<input type="text" class="form-control form-control-sm0">
</div>
</div>
</div> -->
</div> -->
<input hidden name="merchant_id" value="@ViewBag.Merchant_id" />
<input hidden name="vault_id" value="@ViewBag.vault_id" />
<input hidden name="field_id" value="@ViewBag.field_id" />
<input hidden name="id" />
<div class="form-group">
<div class="form-group">
<label class="control-labe" for="userName">使用者名稱:</label>
<label class="control-labe" for="userName">使用者名稱:</label>
<div class="form-group">
<div class="form-group">
<div class="dropdown bootstrap-select selecter form-control
-tokenization
">
<div class="dropdown bootstrap-select selecter form-control ">
<select title="請選使用者名稱(單選)" class="selectpicker selecter form-control selectpicker-tokenization" asp-items="ViewBag.users" tabindex="null">
<select
id="user_selectpicker"
title="請選使用者名稱(單選)" class="selectpicker selecter form-control selectpicker-tokenization" asp-items="ViewBag.users" tabindex="null">
</select>
</select>
</div>
</div>
...
@@ -184,8 +185,8 @@
...
@@ -184,8 +185,8 @@
<div class="form-group">
<div class="form-group">
<label class="control-labe" for="mask">遮罩:</label>
<label class="control-labe" for="mask">遮罩:</label>
<div class="form-group">
<div class="form-group">
<div class="dropdown bootstrap-select show-tick selecter form-control
-tokenization
">
<div class="dropdown bootstrap-select show-tick selecter form-control ">
<select
id="select_mask" multiple="" title="請選遮罩(複選)" class="
selectpicker selecter form-control selectpicker-tokenization" tabindex="null" asp-items="ViewBag.masks">
<select
name="allow_masks" id="select_mask" multiple="" title="請選遮罩(複選)" class="mask_selectpicker
selectpicker selecter form-control selectpicker-tokenization" tabindex="null" asp-items="ViewBag.masks">
</select>
</select>
</div>
</div>
</div>
</div>
...
@@ -194,9 +195,8 @@
...
@@ -194,9 +195,8 @@
<div class="form-group">
<div class="form-group">
<label class="control-labe" for="mask">預設遮罩:</label>
<label class="control-labe" for="mask">預設遮罩:</label>
<div class="form-group">
<div class="form-group">
<div class="dropdown bootstrap-select selecter form-control -tokenization">
<div class="dropdown bootstrap-select selecter form-control ">
<select id="default_mask" title="請選預設遮罩(單選)" class="selectpicker selecter form-control selectpicker-tokenization" tabindex="null">
<select name="default_mask_id" id="default_mask" title="請選預設遮罩(單選)" class=" default_mask_selectpicker selectpicker selecter form-control selectpicker-tokenization" tabindex="null" asp-items="ViewBag.masks">
</select>
</select>
</div>
</div>
</div>
</div>
...
@@ -205,13 +205,13 @@
...
@@ -205,13 +205,13 @@
<div class="form-group">
<div class="form-group">
<label class="control-labe" for="">允許解密:</label>
<label class="control-labe" for="">允許解密:</label>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
Decode
" id="allowDecodeY" value="option1">
<input class="form-check-input" type="radio" name="allow
_decrypt
" id="allowDecodeY" value="option1">
<label class="form-check-label" for="allowDecodeY">
<label class="form-check-label" for="allowDecodeY">
是
是
</label>
</label>
</div>
</div>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
Decode
" id="allowDecodeN" value="option2">
<input class="form-check-input" type="radio" name="allow
_decrypt
" id="allowDecodeN" value="option2">
<label class="form-check-label" for="allowDecodeN">
<label class="form-check-label" for="allowDecodeN">
否
否
</label>
</label>
...
@@ -221,13 +221,13 @@
...
@@ -221,13 +221,13 @@
<div class="form-group">
<div class="form-group">
<label class="control-labe" for="">允許新增:</label>
<label class="control-labe" for="">允許新增:</label>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
Add
" id="allowAddY" value="option1">
<input class="form-check-input" type="radio" name="allow
_new
" id="allowAddY" value="option1">
<label class="form-check-label" for="allowAddY">
<label class="form-check-label" for="allowAddY">
是
是
</label>
</label>
</div>
</div>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
Add
" id="allowAddN" value="option2">
<input class="form-check-input" type="radio" name="allow
_new
" id="allowAddN" value="option2">
<label class="form-check-label" for="allowAddN">
<label class="form-check-label" for="allowAddN">
否
否
</label>
</label>
...
@@ -237,13 +237,13 @@
...
@@ -237,13 +237,13 @@
<div class="form-group">
<div class="form-group">
<label class="control-labe" for="">允許更新:</label>
<label class="control-labe" for="">允許更新:</label>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
U
pdate" id="allowUpdateY" value="option1">
<input class="form-check-input" type="radio" name="allow
_u
pdate" id="allowUpdateY" value="option1">
<label class="form-check-label" for="allowUpdateY">
<label class="form-check-label" for="allowUpdateY">
是
是
</label>
</label>
</div>
</div>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
U
pdate" id="allowUpdateN" value="option2">
<input class="form-check-input" type="radio" name="allow
_u
pdate" id="allowUpdateN" value="option2">
<label class="form-check-label" for="allowUpdateN">
<label class="form-check-label" for="allowUpdateN">
否
否
</label>
</label>
...
@@ -253,13 +253,13 @@
...
@@ -253,13 +253,13 @@
<div class="form-group">
<div class="form-group">
<label class="control-labe" for="">允許刪除:</label>
<label class="control-labe" for="">允許刪除:</label>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
Delete
" id="allowDeleteY" value="option1">
<input class="form-check-input" type="radio" name="allow
_del
" id="allowDeleteY" value="option1">
<label class="form-check-label" for="allowDeleteY">
<label class="form-check-label" for="allowDeleteY">
是
是
</label>
</label>
</div>
</div>
<div class="form-check form-check-inline">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="allow
Delete
" id="allowDeleteN" value="option2">
<input class="form-check-input" type="radio" name="allow
_del
" id="allowDeleteN" value="option2">
<label class="form-check-label" for="allowDeleteN">
<label class="form-check-label" for="allowDeleteN">
否
否
</label>
</label>
...
@@ -267,7 +267,7 @@
...
@@ -267,7 +267,7 @@
</div>
</div>
<div class="SubmitBlock">
<div class="SubmitBlock">
<button
type="submit
" class="btn btn-mainblue-solid btnSubmit">新增</button>
<button
id="createUserBtn
" class="btn btn-mainblue-solid btnSubmit">新增</button>
<button type="button" class="btn btn-mainblue-hollow btnReset" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-mainblue-hollow btnReset" data-dismiss="modal">取消</button>
</div>
</div>
</form>
</form>
...
@@ -334,6 +334,7 @@
...
@@ -334,6 +334,7 @@
var msg = '@TempData["msg"]';
var msg = '@TempData["msg"]';
var IsSuccess = '@TempData["IsSuccess"]';
var IsSuccess = '@TempData["IsSuccess"]';
console.log(IsSuccess + msg);
console.log(IsSuccess + msg);
if (msg != '') {
if (msg != '') {
showAlert(IsSuccess, msg);
showAlert(IsSuccess, msg);
}
}
...
@@ -345,19 +346,50 @@
...
@@ -345,19 +346,50 @@
tooltipClass: "custom-tooltip-width"
tooltipClass: "custom-tooltip-width"
});
});
$("#confirmBtn").on("click", function () {
// 確認按鈕被點擊時的處理程式碼
var selectUserId = 0;
// 在這裡呼叫您的 API
var merchant_id = parseInt('@ViewBag.Merchant_id');
var vault_id = parseInt('@ViewBag.vault_id');
var field_id = parseInt('@ViewBag.field_id');
var selectedUser = parseInt($("#selectUser").val()); // 替換為您實際使用的選取元素的 ID
//選定使用者
$('#user_selectpicker').on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {
$('input[name=id]').val( $('#user_selectpicker').val());
});
//addUserForm 選單連動
$('.mask_selectpicker').on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {
// 先銷毀 selectpicker
$('#default_mask').selectpicker('destroy');
// 清空選擇器內的選項
$('#default_mask').empty();
// 重新初始化選擇器
$('#default_mask').selectpicker();
// 將 #select_mask 的所有選中選項加入到 #default_mask 中
$('#select_mask option:selected').each(function () {
var optionValue = $(this).val();
var optionText = $(this).text();
//console.log('optionText=' + optionText);
$('#default_mask').append(new Option(optionText, optionValue, false, false));
});
//// 刷新 #default_mask
$('#default_mask').selectpicker('refresh');
});
//送出新增使用者
$("#createUserBtn").on("click", function () {
$('#createMaskForm').serialize(),
$.ajax({
$.ajax({
url: "/TokenVault/Addusers",
url: "/TokenVault/Addusers",
method: "POST",
method: "POST",
contentType: "application/json",
contentType: "application/json",
data:
JSON.stringify({ Merchant_id: merchant_id, vault_id: vault_id, field_id: field_id, user_id: selectedUser}
),
data:
$('#addUserForm').serialize(
),
success: function (response) {
success: function (response) {
showAlert(response.isSuccess, response.message);
showAlert(response.isSuccess, response.message);
if (response.isSuccess) {
if (response.isSuccess) {
...
@@ -374,27 +406,7 @@
...
@@ -374,27 +406,7 @@
});
});
});
});
$('#select_mask').on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {
// 清空 #default_mask 的選項
$('#default_mask').empty();
// 刷新 #default_mask
$('#default_mask').selectpicker('refresh');
console.log('select mask')
// 將 #select_mask 的所有選中選項加入到 #default_mask 中
$('#select_mask option:selected').each(function () {
var optionValue = $(this).val();
var optionText = $(this).text();
$('#default_mask').append(new Option(optionText, optionValue, false, false));
});
// 刷新 #default_mask
$('#default_mask').selectpicker('refresh');
});
//移除user
//移除user
var selectUserId = 0;
$('.btnPermission').click(function () {
$('.btnPermission').click(function () {
...
...
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/wwwroot/images/key_part1.png
View replaced file @
8f51b435
View file @
8c30004c
721 Bytes
|
W:
0px
|
H:
0px
716 Bytes
|
W:
0px
|
H:
0px
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
Merchant Token Vault Management/backstage/wwwroot/images/key_part2.png
View replaced file @
8f51b435
View file @
8c30004c
709 Bytes
|
W:
0px
|
H:
0px
709 Bytes
|
W:
0px
|
H:
0px
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
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