新版本官网优化完成
This commit is contained in:
@@ -95,9 +95,9 @@ export async function removeBatchCmsWebsite(data: (number | undefined)[]) {
|
||||
/**
|
||||
* 根据id查询网站信息记录表
|
||||
*/
|
||||
export async function getCmsWebsite(id: number) {
|
||||
export async function getCmsWebsiteAll(id: number) {
|
||||
const res = await request.get<ApiResult<CmsWebsite>>(
|
||||
'https://cms-api.websoft.top/api/cms/cms-website/' + id
|
||||
'/cms/cms-website/all/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
@@ -120,7 +120,7 @@ export async function removeSiteInfoCache(key?: string) {
|
||||
|
||||
export async function pageCmsWebsiteAll(params: CmsWebsiteParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsWebsite>>>(
|
||||
'https://cms-api.websoft.top/api/cms/cms-website/pageAll',
|
||||
'/cms/cms-website/pageAll',
|
||||
{
|
||||
params
|
||||
}
|
||||
|
||||
@@ -19,6 +19,16 @@ export interface CmsWebsite {
|
||||
websiteDarkLogo?: string;
|
||||
// 网站类型
|
||||
websiteType?: string;
|
||||
// 评分
|
||||
rate?: number;
|
||||
// 点赞数
|
||||
likes?: number;
|
||||
// 点击量
|
||||
clicks?: number;
|
||||
// 购买量
|
||||
buys?: number;
|
||||
// 下载安装
|
||||
downloads?: number;
|
||||
// 网站截图
|
||||
files?: string;
|
||||
// 网站关键词
|
||||
@@ -106,5 +116,6 @@ export interface CmsWebsite {
|
||||
export interface CmsWebsiteParam extends PageParam {
|
||||
websiteId?: number;
|
||||
status?: number;
|
||||
recommend?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,11 @@ export async function getSiteInfo(params: CmsWebsiteParam) {
|
||||
*/
|
||||
export async function getUserInfo(): Promise<User> {
|
||||
const config = useRuntimeConfig();
|
||||
const res = await request.get<ApiResult<User>>(config.public.apiServer + '/auth/user');
|
||||
const res = await request.get<ApiResult<User>>(config.public.apiServer + '/auth/user',{
|
||||
headers: {
|
||||
TenantId: `${localStorage.getItem('TID_ADMIN')}`
|
||||
}
|
||||
});
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -135,6 +135,7 @@ export interface UserParam extends PageParam {
|
||||
type?: any;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
password?: string;
|
||||
nickname?: string;
|
||||
realName?: string;
|
||||
gradeId?: unknown;
|
||||
@@ -144,12 +145,15 @@ export interface UserParam extends PageParam {
|
||||
cityMate?: string;
|
||||
sex?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
code?: string;
|
||||
status?: number;
|
||||
organizationId?: number;
|
||||
parentId?: number;
|
||||
sexName?: string;
|
||||
roleId?: string;
|
||||
isAdmin?: number;
|
||||
isSuperAdmin?: boolean;
|
||||
showProfile?: boolean;
|
||||
isStaff?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user