12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import { AuthModule } from "..";
- export const https = AuthModule.http({
- // 获取验证码
- getSmsCode(data: {
- email?: string;
- phone?: string;
- use: "login" | "register" | "resetPasswd" | "bindAccount";
- }) {
- return this.request(data.phone ? "/sms" : "/senEmail", {
- method: "POST",
- data,
- });
- },
- // 个人账号注册
- personRegister(data: { phone: string; password: string }) {
- return this.request("/register", {
- method: "POST",
- data,
- });
- },
- // 邮箱注册
- emailRegist(data: { email: string; password: string }) {
- return this.request("/user/register/email", {
- data,
- method: "POST",
- });
- },
- // 个人账号密码登录
- personPwdLogin(data: { phone: string; password: string; key: string }) {
- return this.request("/login/password", {
- method: "POST",
- data,
- });
- },
- // 个人账号短信登录
- personSmsLogin(data: { phone: string; code: string; key: string }) {
- return this.request("/login/sms", {
- method: "POST",
- data,
- });
- },
- /** 微信登录 */
- personWechatLogin(params: { [key: string]: any }) {
- return this.request("/wechat/login", { method: "POST", data: params });
- },
- // 获取用户信息
- getProfile() {
- return this.request("/profile", {
- method: "GET",
- silence: false,
- });
- },
- // 更新用户信息
- updateProfile(data: any) {
- return this.request("/profile", {
- method: "POST",
- data,
- });
- },
- // 重置登录密码 、 忘记密码
- resetPwd(data: {
- email?: string;
- phone?: string;
- password: string;
- code: string;
- }) {
- return this.request("/resetpwd", {
- method: "POST",
- data,
- });
- },
- // 绑定手机号码、邮箱
- bindAccount(data: { phone?: string; email?: string; code: string }) {
- return this.request("/bind/account ", { method: "post", data });
- },
- });
|