绿满眶商城微信小程序-uniapp
zxl
2025-06-04 ba5acc3cdefd33a4845b578015e2aae8b43f80d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
 * 公共API
 */
import { http, Method } from "@/utils/request.js";
import api from "@/config/api.js";
 
/**
 * 获取地区数据
 * @param id
 */
export function getRegionsById(id = 0) {
  return http.request({
    url: `${api.common}/common/region/item/${id}`,
    method: Method.GET,
    message: false,
  });
}
 
// 获取IM接口前缀
export function getIMDetail() {
  return http.request({
    url: `${api.common}/IM`,
    method: Method.GET,
    message: false,
  });
}
 
/**
 * 获取腾讯云cos sts临时访问凭证
 */
 export function getSTSToken() {
  return http.request({
    url: `${api.common}/lmk/file/sts`,
    method: Method.GET,
  });
}
 
export function getPreviewUrl(params){
    return http.request({
      url: `${api.common}/lmk/file/preview`,
      method: Method.POST,
      data:params
    });
}
 
 
/**
 * 获取文件访问地址
 */
 export function getFilePreviewUrl(fileKey) {
  return http.request({
    url: `${api.common}/lmk/file/preview`,
    method: Method.POST,
    data: {fileKey: fileKey}
  });
}
 
/**
 * 文件上传地址
 * @type {string}
 */
export const upload = api.common + "/common/upload/file";