mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 07:55:53 +08:00
commit message
This commit is contained in:
42
api/common.js
Normal file
42
api/common.js
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* 公共API
|
||||
*/
|
||||
import storage from "@/utils/storage.js"
|
||||
import {http, Method} from '@/utils/request.js';
|
||||
import api from '@/config/api.js';
|
||||
|
||||
/**
|
||||
* 获取图片验证码URL
|
||||
* @param type
|
||||
* @param uuid
|
||||
* @returns {string}
|
||||
*/
|
||||
export function getValidateCodeUrl(type, uuid) {
|
||||
if (!type) {
|
||||
return '';
|
||||
}
|
||||
if (!uuid) {
|
||||
uuid = storage.getUuid()
|
||||
}
|
||||
return `${api.base}/captchas/${uuid}/${type}?r=${new Date().getTime()}`;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取地区数据
|
||||
* @param id
|
||||
*/
|
||||
export function getRegionsById(id = 0) {
|
||||
return http.request({
|
||||
url: `${api.common}/region/item/${id}`,
|
||||
method: Method.GET,
|
||||
message: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
* @type {string}
|
||||
*/
|
||||
export const upload =api.common+'/upload/file';
|
||||
|
||||
Reference in New Issue
Block a user