Compare commits

..

2 Commits

Author SHA1 Message Date
Clarence 5754f44e69 更改登录 2025-02-04 00:57:32 +08:00
Clarence cb732d71b9 更改登录问题 2025-02-04 00:53:29 +08:00
3 changed files with 14 additions and 7 deletions

View File

@ -6,6 +6,8 @@ interface requestType {
params?: any
}
const handleCode = async (code: number, msg: string) => {
console.log(code);
switch (code) {
case 401:
ElMessage.error(msg || '登录失效')
@ -26,14 +28,15 @@ const service = axios.create({
baseURL: "https://sh-ocr-api.bskies.cc/",
// baseURL: "/api",
timeout: 30000,
headers: {
'Content-Type': 'application/json;charset=UTF-8',
"authorization": localStorage.getItem("token"),
}
});
// 添加请求拦截器
service.interceptors.request.use(
(config: any) => {
config.headers = {
'Content-Type': 'application/json;charset=UTF-8',
"authorization": localStorage.getItem("token"),
}
console.log(config, 'config')
return config;
},

View File

@ -13,7 +13,11 @@
</el-form>
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="name" label="名称" width="180" />
<el-table-column prop="price" label="价格" width="180" />
<el-table-column prop="price" label="价格" width="180">
<template #default="scope">
<div>{{ scope.row.price/100 }}</div>
</template>
</el-table-column>
<el-table-column prop="api_usage_limit" label="次数" />
<el-table-column prop="created_at" label="开通时间" />
<el-table-column prop="description" label="备注" />

View File

@ -14,7 +14,7 @@
<el-table-column prop="product_name" label="产品名" width="180" />
<el-table-column prop="total_amount" label="价格" width="100">
<template #default="scope">
<div>{{ scope.row.total_amount }}</div>
<div>{{ scope.row.total_amount / 100 }}</div>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" />
@ -92,7 +92,7 @@ const getList = async () => {
page: 1,
size: 20,
}
if (status.value&&status.value!='0') {
if (status.value && status.value != '0') {
params.payment_status = status.value
}
const { code, body: { records, total } } = await orderList(params)