新版本官网优化完成
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
||||
SmsCaptchaResult
|
||||
} from './model';
|
||||
import { SERVER_API_URL } from '~/config';
|
||||
import type {UserParam} from "~/api/system/user/model";
|
||||
|
||||
/**
|
||||
* 登录
|
||||
@@ -49,18 +50,22 @@ export async function loginBySms(data: LoginParam) {
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
console.log(res.data,'登录成功')
|
||||
// setToken(res.data.data?.access_token, data.remember);
|
||||
// if (res.data.data?.user) {
|
||||
// const user = res.data.data?.user;
|
||||
// localStorage.setItem('TenantId', String(user.tenantId));
|
||||
// localStorage.setItem('Phone', String(user.phone));
|
||||
// localStorage.setItem('UserId', String(user.userId));
|
||||
// localStorage.setItem('MerchantId', String(user.merchantId));
|
||||
// localStorage.setItem('MerchantName', String(user.merchantName));
|
||||
// }
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
return res.message;
|
||||
/**
|
||||
* 用户注册
|
||||
* @param data
|
||||
*/
|
||||
export async function register(data: UserParam) {
|
||||
const res = await request.post<ApiResult<LoginResult>>(
|
||||
SERVER_API_URL + '/register',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ export interface LoginParam {
|
||||
phone?: string;
|
||||
// 短信验证码
|
||||
code?: string;
|
||||
// 是否超级管理员
|
||||
isSuperAdmin?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user