WIn_RustTools/RustTools/ApiFox/user.cs

37 lines
1.2 KiB
C#
Raw Normal View History

2024-08-16 05:15:18 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using RustTools.muqing;
namespace RustTools.ApiFox;
public class user
{
public static async Task<string> loginPc(string account, string passWord)
{
var pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
var v = Regex.IsMatch(account, pattern);
//gj.sc(account + " " + v); //这里不知道为什么会出现 True 而不是 true 导致识别邮箱失败
var task = await wl.postAsync("/php/user.php?action=loginPc", new string[][]
{
new string[]{ "account",account},
new string[]{ "passWord", passWord },
new string[]{ "isEmail", v.ToString().ToLower() }
});
return task;
}
public static async Task<string> SpaceInfo(string account)
{
var pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
var v = Regex.IsMatch(account, pattern);
var task = await wl.postAsync("/php/user.php?action=getSpaceInfo", new string[][]
{
new string[]{ "account",account}
});
return task;
}
}