代码提交
This commit is contained in:
17
Store_vue/api/modules/auth.js
Normal file
17
Store_vue/api/modules/auth.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { request, requestWithRetry } from '../config'
|
||||
|
||||
// 认证相关API
|
||||
export const authApi = {
|
||||
// 用户登录
|
||||
login: (account, password) => {
|
||||
return request({
|
||||
url: '/v1/auth/login',
|
||||
method: 'POST',
|
||||
data: {
|
||||
account: account,
|
||||
password: password,
|
||||
typeId: 2 // 固定为2
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
31
Store_vue/api/modules/example.js
Normal file
31
Store_vue/api/modules/example.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { request, requestWithRetry } from '../config'
|
||||
|
||||
// 示例API
|
||||
export const exampleApi = {
|
||||
// 普通请求示例
|
||||
getData: (params) => {
|
||||
return request({
|
||||
url: '/api/getData',
|
||||
method: 'GET',
|
||||
data: params
|
||||
})
|
||||
},
|
||||
|
||||
// 使用重试机制的请求示例
|
||||
getDataWithRetry: (params) => {
|
||||
return requestWithRetry({
|
||||
url: '/api/getData',
|
||||
method: 'GET',
|
||||
data: params
|
||||
})
|
||||
},
|
||||
|
||||
// POST请求示例
|
||||
postData: (data) => {
|
||||
return request({
|
||||
url: '/api/postData',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
31
Store_vue/api/modules/traffic.js
Normal file
31
Store_vue/api/modules/traffic.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { request, requestWithRetry } from '../config'
|
||||
|
||||
// 流量相关API
|
||||
export const trafficApi = {
|
||||
// 获取流量套餐列表
|
||||
getFlowPackages: () => {
|
||||
return requestWithRetry({
|
||||
url: '/v1/store/flow-packages',
|
||||
method: 'GET'
|
||||
})
|
||||
},
|
||||
|
||||
// 获取本月流量使用情况
|
||||
getRemainingFlow: () => {
|
||||
return requestWithRetry({
|
||||
url: '/v1/store/flow-packages/remaining-flow',
|
||||
method: 'GET'
|
||||
})
|
||||
},
|
||||
|
||||
// 创建流量套餐订单
|
||||
createOrder: (packageId) => {
|
||||
return request({
|
||||
url: '/v1/store/flow-packages/order',
|
||||
method: 'POST',
|
||||
data: {
|
||||
packageId
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user