Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Release 1.1
Browse files Browse the repository at this point in the history
修复中文名称无法登录的 Bug
2023 / 1 / 26
  • Loading branch information
Zhiyuan36 authored Jan 26, 2023
1 parent 47add5f commit 58bf7fc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
22 changes: 20 additions & 2 deletions LoCyanFrpMSApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <direct.h> // 文件夹创建模块
#include "requests.h" // 爬取网页模块
#include "utils.h" // requests.h 的前置
#define VERSION (string)"Indev 4.0"
#define VERSION (string)"Version 1.1"
#pragma comment(lib, "Urlmon.lib")

using namespace std; // cin / cout 定义模块
Expand Down Expand Up @@ -85,6 +85,7 @@ inline string FromIDFindTunnelName(int id); // 根据隧道 ID 找名字
inline string FromIDFindProtocol(int id); // 根据隧道 ID 找隧道协议
inline string LTS(string s); // 大写转小写
inline string UTF8ToANSI(string s); // 编码转换
inline string ANSItoUTF8(string strAnsi); // 将 ANSI 编码转换为 UTF-8
inline LPCWSTR stringToLPCWSTR(string orig); // LPCWSTR -> String
string UserInternalID/* FrpToken */, name/* 用户名 */, password/* 密码 */, Temp/* 更新缓存 */;
bool ifLogin = false/* 是否已登录 */, ifAuxiliary = false /* 有没有下载辅助模块 */;
Expand Down Expand Up @@ -424,13 +425,16 @@ inline void login() // 登录模块
SetConsoleCursorPosition(hout, coord); // 在第 47 行,第 3 列插入文字
cout << "用户名:";
cin >> name; // 用户名输入-以后要居中-待改进
name = ANSItoUTF8(name);
coord = { 47 , 5 };
hout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hout, coord); // 在第 47 行,第 5 列插入文字
cout << "密码:";
cin >> password; // 输入密码-以后要改成输入时隐藏-待改进
print("正在校验密码", 52, 53);
string Return = Json(Get("https://api.locyanfrp.cn/User/DoLogin?username=" + name + "&password=" + password).GetText() , "status"); // 查看密码是否正确
cout << "https://api.locyanfrp.cn/User/DoLogin?username=" + name + "&password=" + password;
system("pause");
if (Return == "-1")
{
print("用户名或密码错误!", 49, 50);
Expand Down Expand Up @@ -1959,7 +1963,21 @@ inline string UTF8ToANSI(string s) // 将 UTF-8 编码转换为 ANSI
delete[] pszAnsi;
return r;
}

inline string ANSItoUTF8(string strAnsi) // 将 ANSI 编码转换为 UTF-8
{
UINT nLen = MultiByteToWideChar(936, NULL, strAnsi.c_str(), -1, NULL, NULL);
WCHAR* wszBuffer = new WCHAR[nLen + 1];
nLen = MultiByteToWideChar(936, NULL, strAnsi.c_str(), -1, wszBuffer, nLen);
wszBuffer[nLen] = 0;
nLen = WideCharToMultiByte(CP_UTF8, NULL, wszBuffer, -1, NULL, NULL, NULL, NULL);
CHAR* szBuffer = new CHAR[nLen + 1];
nLen = WideCharToMultiByte(CP_UTF8, NULL, wszBuffer, -1, szBuffer, nLen, NULL, NULL);
szBuffer[nLen] = 0;
strAnsi = szBuffer;
delete[]wszBuffer;
delete[]szBuffer;
return strAnsi;
}
inline LPCWSTR stringToLPCWSTR(string orig) // 将 LPCWSTR 形式的字符串转化为 String 形式的字符串
{
size_t origsize = orig.length() + 1;
Expand Down
13 changes: 7 additions & 6 deletions LoCyanFrpMSApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function MSApp_update(){
];
return json($data);
} else {
if (Request::get("version") == "Version 1.0 Rc 1"){
if (Request::get("version") == "Version 1.1"){
$data = [
"status" => 0,
"needupdate" => 0
Expand All @@ -79,10 +79,10 @@ public function MSApp_update(){
} else {
$data = [
"status" => 0,
"important" => 0,
"important" => 1,
"needupdate" => 1,
"version" => "Version 1.0 Rc 1",
"download_url" => "https://download.locyan.cn/d/LoCyanFrpMSApp/MSApp/Version%201.0%20Rc%201.exe"
"version" => "Version 1.1",
"download_url" => "https://download.locyan.cn/d/LoCyanFrpMSApp/LoCyanFrpMSApp.exe"
];
return json($data);
}
Expand All @@ -97,6 +97,7 @@ public function GetServerList(){
return;
}
public function GetTunnelList(){
$http = new \app\common\Http;
$username = Request::get("username");
$rs = Db::table("proxies")->where("username", $username)->select()->toArray();
echo(count($rs) . " ");
Expand All @@ -117,7 +118,7 @@ public function GetTunnelList(){
$ue = "0";
}

// 判断穿透协议以判断是否需要返回域名
// 是否存在域名
if ($r["proxy_type"] != "http" && $r["proxy_type"] != "https"){
$domain_S = "0";
echo ($r["id"] . " " . $r["proxy_name"] . " " . $r["local_port"] . " " . $r["remote_port"] . " " . $r["proxy_type"] . " " . $r["node"] . " " . $uc . " " . $ue . " " . $domain_S . " " . $r["local_ip"] . " ");
Expand All @@ -128,4 +129,4 @@ public function GetTunnelList(){
}
return;
}
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

### 安装

**$\color{Plum}{程序还尚未完成哦!敬请期待!}$**
详见**[文档](https://doc.locyan.cn/#/LoCyanFrpMSApp?id=%e5%ae%89%e8%a3%85)**

### 编译

* Visual Studio(安装 C++ 与 C)
* **[LoCyanFrp API](https://github.com/Daiyangcheng/LoCyanFrpAPI)**
* **[LoCyanFrp API](https://github.com/LoCyan-Team/LoCyanFrpAPI)**

编译 LoCyanFrpMSApp.cpp 与 rpAuxiliaryApp.cpp ,均编译完成后放在同一目录下,运行 LoCyanFrpMSApp.exe。
编译 LoCyanFrpMSApp.cpp 与 FrpAuxiliaryApp.cpp ,均编译完成后放在同一目录下,运行 LoCyanFrpMSApp.exe。

### 更新方向

Expand Down
3 changes: 1 addition & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

以下为还在**进行安全更新与维护**的版本

- [X] Version 1.0 Rc 1
- [X] Indev 3.6
- [X] Version 1.1

### 如果发现安全漏洞或 Bug

Expand Down

0 comments on commit 58bf7fc

Please sign in to comment.