@ -1,2 +1,4 @@
|
||||
VITE_SERVICE_ENV = prod
|
||||
VITE_APP_BASE_API = '/api'
|
||||
VITE_SERVICE_ENV = production
|
||||
VITE_APP_BASEURL = '/api'
|
||||
VITE_APP_SERVER_URL = 'https://byffp.top'
|
||||
VITE_APP_IMG_UTL = 'https://byffp.top/avatar/'
|
@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request'
|
||||
import type {
|
||||
HomeSearchPage,
|
||||
PageParams,
|
||||
editClue,
|
||||
AssetsPage
|
||||
} from '@/types/consult'
|
||||
import type { OAuth2LoginParam, CaptchaConfig } from '@/components/Captcha/types'
|
||||
import { LoginResult, LoginObj } from '@/types/user'
|
||||
|
||||
const BASIC_AUTHORIZATION = 'Basic dWk6dWk='
|
||||
// 正式环境baseUrl = /api
|
||||
const baseUrl = '/api'
|
||||
export interface CaptchaData {
|
||||
id: string
|
||||
captcha: {
|
||||
backgroundImage: string
|
||||
templateImage: string
|
||||
backgroundImageWidth: number
|
||||
backgroundImageHeight: number
|
||||
sliderImageWidth: number
|
||||
sliderImageHeight: number
|
||||
data: {
|
||||
randomY?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const loginAPI = (mobile: string, password: string) => {
|
||||
return request.post(baseUrl + 'login/password', {
|
||||
mobile,
|
||||
password
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 账号密码登录
|
||||
* @param parameter
|
||||
*/
|
||||
export function accountLogin(parameter: OAuth2LoginParam) {
|
||||
return request<LoginResult>({
|
||||
url: baseUrl + '/oauth2/token',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: BASIC_AUTHORIZATION
|
||||
},
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 图形验证码
|
||||
* @returns
|
||||
*/
|
||||
export function getCodeData() {
|
||||
return request.get<LoginObj>(baseUrl + '/captcha/code')
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码校验
|
||||
* @param id 验证码id
|
||||
* @param data true:校验通过/false:校验失败
|
||||
* @returns
|
||||
*/
|
||||
export function captchaCheck(id: string, data: CaptchaConfig) {
|
||||
return request.post<boolean>(baseUrl + '/captcha/tianai/check', data, { params: { id } })
|
||||
}
|
||||
|
||||
// 资源列表
|
||||
export const getKnowledgePage = (params: HomeSearchPage) =>
|
||||
request.get<AssetsPage>(baseUrl + '/clue/page', { params })
|
||||
// 资源详情-id
|
||||
export const getDetails = (id: number) =>
|
||||
request.get<any>(baseUrl + '/clue/details/' + id )
|
||||
// 资源编辑
|
||||
export const editClueUpdate = (data: any) =>
|
||||
request.post<any>(baseUrl + '/clue/update', data)
|
||||
|
||||
export const getReadCount = () =>
|
||||
request.get<any>(baseUrl + '/notify/user-announcement/not/read/count')
|
||||
// export const getDoctorPage = (params: PageParams) =>
|
||||
// request.get<DoctorPage>('/home/page/doc', { params })
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
|
||||
* @Date: 2023-07-28 16:10:52
|
||||
* @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
|
||||
* @LastEditTime: 2023-08-09 17:08:53
|
||||
* @FilePath: \byhl-zt-app\src\config\env.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/** 请求服务的环境配置 */
|
||||
type ServiceEnv = Record<ServiceEnvType, ServiceEnvConfig>
|
||||
|
||||
export const serviceEnv: ServiceEnv = {
|
||||
dev: {
|
||||
url: 'http://172.18.0.225:8000',
|
||||
},
|
||||
prod: {
|
||||
url: 'http://admin.ballcat.cn',
|
||||
}
|
||||
}
|
||||
export const imgUrl = 'https://hccake-img.oss-cn-shanghai.aliyuncs.com/'
|
||||
/**
|
||||
* 获取当前环境模式下的请求服务的配置
|
||||
* @param env 环境
|
||||
*/
|
||||
export function getServiceEnvConfig(env: ImportMetaEnv) {
|
||||
const { VITE_SERVICE_ENV = 'dev' } = env
|
||||
|
||||
return serviceEnv[VITE_SERVICE_ENV]
|
||||
}
|
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 727 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 6.6 KiB |