Skip to content

Commit

Permalink
整理绑定相关接口
Browse files Browse the repository at this point in the history
  • Loading branch information
renyh committed Sep 8, 2022
1 parent d3eb417 commit c4da0f2
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 122 deletions.
2 changes: 1 addition & 1 deletion dp2weixin.service/dp2WeiXinService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5436,7 +5436,7 @@ public int GetPatronsByName(LoginInfo loginInfo,
/// <param name="tel"></param>
/// <param name="strError"></param>
/// <returns></returns>
public int ResetPassword(string weixinId,
public int ResetPassword(//string weixinId,
string libId,
//string libraryCode,
string name,
Expand Down
246 changes: 180 additions & 66 deletions dp2weixinP2P/ApiControllers/WxUserApiController.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dp2weixinP2P/Controllers/BaseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ private int InitViewBag(SessionInfo sessionInfo,
}
ViewBag.userName = userName;
ViewBag.userNameInfo = userNameInfo;
ViewBag.userId = sessionInfo.ActiveUser.id;
ViewBag.bindUserId = sessionInfo.ActiveUser.id;



Expand Down
2 changes: 1 addition & 1 deletion dp2weixinP2P/Views/Account/Bind.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
showMaskLayer();
// 调WxUser的Bind()
var url = "/api/wxuserApi";
var url = "/api2/wxuserApi/Bind";
//alert(url);
sendAjaxRequest(url, "POST",
function (result) {
Expand Down
2 changes: 1 addition & 1 deletion dp2weixinP2P/Views/Account/ChangePassword.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
showMaskLayer();
// 调web api修改密码
var url = "/api/wxuserApi?libId=" + libId
var url = "/api2/wxuserApi/ChangePassword?libId=" + libId
+ "&patron=" + encodeURIComponent(patron)
+ "&oldPassword=" + encodeURIComponent(oldPassword)
+ "&newPassword=" + encodeURIComponent(newPassword);
Expand Down
8 changes: 4 additions & 4 deletions dp2weixinP2P/Views/Account/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//alert("2");
// 调web api
var url = "/api/wxuserApi?weixinId=" + weixinId;
var url = "/api2/wxuserApi/GetBindUsersByClientId?clientId=" + weixinId;
sendAjaxRequest(url, "GET", function (result) {
//alert("3");
Expand Down Expand Up @@ -104,7 +104,7 @@
//alert("remove-"+item.libId);
// 2022/8/5 发现更新接口后,原来的/api/wxuserApi/id,这样调接口不支持了,改为api2接口地址
var url = "/api2/wxuserApi/Delete?bindUserId=" + item.id;
var url = "/api2/wxuserApi/Unbind?bindUserId=" + item.id;
sendAjaxRequest(url, "DELETE", function (result) {
// 关闭等待层
Expand Down Expand Up @@ -145,8 +145,8 @@
if (item.type == 1)
name = item.userName;
// 调ActivePatron api
var url = "/api/wxuserApi?weixinId=" + item.weixinId + "&bindUserId=" + item.id;
// 调ActiveUser api
var url = "/api2/wxuserApi/ActiveUser?clientId=" + item.weixinId + "&bindUserId=" + item.id;
sendAjaxRequest(url, "POST", function () {
// 因为有可能更新当前图书馆,所以reload保险,todo
Expand Down
4 changes: 2 additions & 2 deletions dp2weixinP2P/Views/Account/ResetPassword.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
showMaskLayer();
// 调 ResetPassword() api获取临时密码
var url = "/api/wxuserApi?weixinId=" + weixinId
var url = "/api2/wxuserApi/ResetPassword?clientId=" + weixinId
+ "&libId=" + libId
//+ "&libraryCode=" + encodeURIComponent(libraryCode)
+ "&name=" + encodeURIComponent(name)
Expand Down Expand Up @@ -196,7 +196,7 @@
showMaskLayer();
// bind() api
var url = "/api/wxuserApi";
var url = "/api2/wxuserApi/Bind";
sendAjaxRequest(url, "POST",
function (result) {
Expand Down
2 changes: 1 addition & 1 deletion dp2weixinP2P/Views/Account/ScanQRCodeBind.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
showMaskLayer();
// bind() api
var url = "/api/wxuserApi";
var url = "/api2/wxuserApi/Bind";
sendAjaxRequest(url, "POST",
function (result) {
Expand Down
14 changes: 7 additions & 7 deletions dp2weixinP2P/Views/Home/WeixinUser.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
model.wxUsers.removeAll();
// 调web api
var url = "/api/wxuserapi";
var url = "/api2/wxuserapi/GetAll";
sendAjaxRequest(url, "GET", function (result) {
// 关闭等待层
Expand Down Expand Up @@ -126,7 +126,7 @@
// 调web api
var url = "/api/wxuserApi?libId=" + libid + "&type=" + curText;
var url = "/api2/wxuserApi/GetBindUsersByLibId?libId=" + libid + "&type=" + curText;
sendAjaxRequest(url, "GET", function (result) {
// 关闭等待层
Expand Down Expand Up @@ -175,7 +175,7 @@
}
var url = "/api/wxuserapi/" + item.id;
var url = "/api2/wxuserapi/Unbind?bindUserId=" + item.id;
sendAjaxRequest(url, "DELETE", function (result) {
//getAllLib();
Expand All @@ -201,8 +201,8 @@
function updateUser(item) {
var url = "/api/wxuserApi?userId=" + item.id
+ "&infoType=libName";
var url = "/api2/wxuserApi/UpdateUserInfo?bindUserId=" + item.id
+ "&userInfoType=libName";
sendAjaxRequest(url, "POST", function (result) {
//getAllLib();
Expand Down Expand Up @@ -240,7 +240,7 @@
model.wxUsers.removeAll();
// 调web api
var url = "/api/wxuserApi?actionType=recover";
var url = "/api2/wxuserApi/DoThing_HF?actionType=recover";
sendAjaxRequest(url, "POST", function (result) {
// 关闭等待层
Expand Down Expand Up @@ -287,7 +287,7 @@
model.wxUsers.removeAll();
// 调web api
var url = "/api/wxuserApi?actionType=addAppId";
var url = "/api2/wxuserApi/DoThing_HF?actionType=addAppId";
sendAjaxRequest(url, "POST", function (result) {
// 关闭等待层
Expand Down
2 changes: 1 addition & 1 deletion dp2weixinP2P/Views/Patron/SelectLib.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
showMaskLayer();
//window.setTimeout("hideMaskLayer()", 5000);
var url = "/api/WxUserApi?weixinId=" + weixinId
var url = "/api2/WxUserApi/SetLibId?clientId=" + weixinId
+ "&libId=" + encodeURIComponent(lib);
//alert(url);
sendAjaxRequest(url, "POST",
Expand Down
2 changes: 1 addition & 1 deletion dp2weixinP2P/Views/Patron/SelectOwnerLib.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
showMaskLayer();
//window.setTimeout("hideMaskLayer()", 5000);
var url = "/api/WxUserApi?weixinId=" + weixinId
var url = "/api2/WxUserApi/SetLibId?clientId=" + weixinId
+ "&libId=" + encodeURIComponent(lib);
//alert(url);
sendAjaxRequest(url, "POST",
Expand Down
Loading

0 comments on commit c4da0f2

Please sign in to comment.