fix: git branch
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 8m48s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 8m48s
This commit is contained in:
@@ -3,10 +3,12 @@ name: 构建并部署前端到测试环境
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- iteration/august
|
||||||
- dev
|
- dev
|
||||||
- test
|
- test
|
||||||
- iteration/august
|
# 如果不再需要 main 分支触发构建,可以把下面这行删掉;
|
||||||
|
# 如果只是想保留构建(不部署),可以留着,反正部署条件已经只认 iteration/august
|
||||||
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: registry.boss160.cn
|
REGISTRY: registry.boss160.cn
|
||||||
@@ -22,43 +24,37 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export PATH="$HOME/.nix-profile/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
|
export PATH="$HOME/.nix-profile/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
|
||||||
export GIT_SSL_NO_VERIFY=1
|
export GIT_SSL_NO_VERIFY=1
|
||||||
|
|
||||||
git clone https://git.boss160.cn/luo/one-pipe-system.git .
|
git clone https://git.boss160.cn/luo/one-pipe-system.git .
|
||||||
git checkout ${{ github.sha }}
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
- name: 设置镜像标签
|
- name: 设置镜像标签
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
if [ "${{ github.ref }}" = "refs/heads/iteration/august" ]; then
|
||||||
echo "tag=latest" >> $GITHUB_OUTPUT
|
echo "tag=latest" >> $GITHUB_OUTPUT
|
||||||
elif [ "${{ github.ref }}" = "refs/heads/dev" ]; then
|
elif [ "${{ github.ref }}" = "refs/heads/dev" ]; then
|
||||||
echo "tag=dev" >> $GITHUB_OUTPUT
|
echo "tag=dev" >> $GITHUB_OUTPUT
|
||||||
elif [ "${{ github.ref }}" = "refs/heads/test" ]; then
|
elif [ "${{ github.ref }}" = "refs/heads/test" ]; then
|
||||||
echo "tag=test" >> $GITHUB_OUTPUT
|
echo "tag=test" >> $GITHUB_OUTPUT
|
||||||
elif [ "${{ github.ref }}" = "refs/heads/iteration/august" ]; then
|
|
||||||
echo "tag=test" >> $GITHUB_OUTPUT
|
|
||||||
else
|
else
|
||||||
echo "tag=unknown" >> $GITHUB_OUTPUT
|
echo "tag=unknown" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 登录 Docker Registry
|
- name: 登录 Docker Registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "${{ env.REGISTRY }}" \
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "${{ env.REGISTRY }}" --username "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||||
--username "${{ secrets.REGISTRY_USERNAME }}" \
|
|
||||||
--password-stdin
|
|
||||||
|
|
||||||
- name: 构建前端镜像
|
- name: 构建前端镜像
|
||||||
run: |
|
run: |
|
||||||
docker build -t ${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} .
|
docker build -t ${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} .
|
||||||
docker tag ${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} \
|
docker tag ${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} ${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
${{ env.IMAGE_NAME }}:${{ github.sha }}
|
|
||||||
|
|
||||||
- name: 推送镜像到 Registry
|
- name: 推送镜像到 Registry
|
||||||
run: |
|
run: |
|
||||||
docker push ${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
|
docker push ${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
|
||||||
docker push ${{ env.IMAGE_NAME }}:${{ github.sha }}
|
docker push ${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
|
|
||||||
- name: 部署到测试环境(iteration/august)
|
- name: 部署到本地(仅 iteration/august 分支)
|
||||||
if: github.ref == 'refs/heads/iteration/august'
|
if: github.ref == 'refs/heads/iteration/august'
|
||||||
run: |
|
run: |
|
||||||
# 确保部署目录存在
|
# 确保部署目录存在
|
||||||
@@ -86,32 +82,6 @@ jobs:
|
|||||||
echo "部署完成!"
|
echo "部署完成!"
|
||||||
docker compose -f docker-compose.prod.yml ps
|
docker compose -f docker-compose.prod.yml ps
|
||||||
|
|
||||||
- name: 部署到生产环境(main)
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.DEPLOY_DIR }}
|
|
||||||
|
|
||||||
echo "当前工作目录: $(pwd)"
|
|
||||||
echo "当前目录内容:"
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
echo "更新部署配置文件..."
|
|
||||||
cp -v docker-compose.prod.yml ${{ env.DEPLOY_DIR }}/
|
|
||||||
|
|
||||||
cd ${{ env.DEPLOY_DIR }}
|
|
||||||
|
|
||||||
echo "拉取最新镜像..."
|
|
||||||
docker compose -f docker-compose.prod.yml pull
|
|
||||||
|
|
||||||
echo "重启服务..."
|
|
||||||
docker compose -f docker-compose.prod.yml up -d
|
|
||||||
|
|
||||||
echo "等待服务启动..."
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
echo "部署完成!"
|
|
||||||
docker compose -f docker-compose.prod.yml ps
|
|
||||||
|
|
||||||
- name: 构建结果通知
|
- name: 构建结果通知
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
@@ -120,4 +90,4 @@ jobs:
|
|||||||
echo "镜像标签: ${{ github.sha }}"
|
echo "镜像标签: ${{ github.sha }}"
|
||||||
else
|
else
|
||||||
echo "构建失败"
|
echo "构建失败"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -55,10 +55,18 @@
|
|||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<template v-if="formData.method === RefundMethod.CUSTOMER_ACCOUNT">
|
<template v-if="formData.method === RefundMethod.CUSTOMER_ACCOUNT">
|
||||||
<ElFormItem label="收款账户名" prop="customer_account_name">
|
<ElFormItem label="收款账户名" prop="customer_account_name">
|
||||||
<ElInput v-model="formData.customer_account_name" placeholder="请输入收款账户名" maxlength="50" />
|
<ElInput
|
||||||
|
v-model="formData.customer_account_name"
|
||||||
|
placeholder="请输入收款账户名"
|
||||||
|
maxlength="50"
|
||||||
|
/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="收款账号" prop="customer_account_number">
|
<ElFormItem label="收款账号" prop="customer_account_number">
|
||||||
<ElInput v-model="formData.customer_account_number" placeholder="请输入收款账号" maxlength="64" />
|
<ElInput
|
||||||
|
v-model="formData.customer_account_number"
|
||||||
|
placeholder="请输入收款账号"
|
||||||
|
maxlength="64"
|
||||||
|
/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="开户银行">
|
<ElFormItem label="开户银行">
|
||||||
<ElInput v-model="formData.customer_bank_name" placeholder="选填" maxlength="50" />
|
<ElInput v-model="formData.customer_bank_name" placeholder="选填" maxlength="50" />
|
||||||
@@ -295,13 +303,7 @@
|
|||||||
requested_refund_amount: yuanToFen(formData.requested_refund_amount) ?? 0
|
requested_refund_amount: yuanToFen(formData.requested_refund_amount) ?? 0
|
||||||
}
|
}
|
||||||
if (formData.method === RefundMethod.CUSTOMER_ACCOUNT) {
|
if (formData.method === RefundMethod.CUSTOMER_ACCOUNT) {
|
||||||
data.customer_account_info = {
|
data.customer_account_info = `${formData.customer_account_name.trim()} ${formData.customer_account_number.trim()}${formData.customer_bank_name.trim() ? ` ${formData.customer_bank_name.trim()}` : ''}`
|
||||||
account_name: formData.customer_account_name.trim(),
|
|
||||||
account_number: formData.customer_account_number.trim(),
|
|
||||||
...(formData.customer_bank_name.trim()
|
|
||||||
? { bank_name: formData.customer_bank_name.trim() }
|
|
||||||
: {})
|
|
||||||
}
|
|
||||||
data.refund_voucher_key = formData.refund_voucher_key
|
data.refund_voucher_key = formData.refund_voucher_key
|
||||||
} else if (formData.refund_voucher_key.length) {
|
} else if (formData.refund_voucher_key.length) {
|
||||||
data.refund_voucher_key = formData.refund_voucher_key
|
data.refund_voucher_key = formData.refund_voucher_key
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export interface RefundAttemptItem {
|
|||||||
refund_amount?: number | null // 退款金额(分)
|
refund_amount?: number | null // 退款金额(分)
|
||||||
frozen_actual_received_amount?: number | null // 冻结实收金额(分)
|
frozen_actual_received_amount?: number | null // 冻结实收金额(分)
|
||||||
refund_reason?: string | null // 退款原因
|
refund_reason?: string | null // 退款原因
|
||||||
customer_account_info?: Record<string, string> | null // 客户收款信息
|
customer_account_info?: string | null // 客户收款信息,如 "张三 1111111111
|
||||||
customer_voucher_key?: string[] | string | null // 客户凭证键
|
customer_voucher_key?: string[] | string | null // 客户凭证键
|
||||||
channel_refund_request_no?: string | null // 渠道退款申请号
|
channel_refund_request_no?: string | null // 渠道退款申请号
|
||||||
submitted_by_account_id?: number | null // 提交人账号ID
|
submitted_by_account_id?: number | null // 提交人账号ID
|
||||||
@@ -109,7 +109,7 @@ export interface Refund {
|
|||||||
method?: RefundMethod | null // 退款方式
|
method?: RefundMethod | null // 退款方式
|
||||||
method_name?: string | null // 退款方式名称
|
method_name?: string | null // 退款方式名称
|
||||||
frozen_actual_received_amount?: number | null // 冻结实收金额(分)
|
frozen_actual_received_amount?: number | null // 冻结实收金额(分)
|
||||||
customer_account_info?: Record<string, string> | null // 客户收款信息
|
customer_account_info?: string | null // 客户收款信息,如 "张三 1111111111
|
||||||
channel_refund_status?: ChannelRefundStatus | null // 渠道退款状态
|
channel_refund_status?: ChannelRefundStatus | null // 渠道退款状态
|
||||||
channel_refund_status_name?: string | null // 渠道退款状态名称
|
channel_refund_status_name?: string | null // 渠道退款状态名称
|
||||||
channel_refund_no?: string | null // 渠道退款单号
|
channel_refund_no?: string | null // 渠道退款单号
|
||||||
@@ -182,7 +182,7 @@ export interface CreateRefundRequest {
|
|||||||
requested_refund_amount: number // 申请退款金额(分)
|
requested_refund_amount: number // 申请退款金额(分)
|
||||||
package_usage_id: number // 关联套餐使用记录 ID,无关联记录时传 0
|
package_usage_id: number // 关联套餐使用记录 ID,无关联记录时传 0
|
||||||
refund_reason: string
|
refund_reason: string
|
||||||
customer_account_info?: Record<string, string> | null // 客户收款信息(customer_account 方式必填)
|
customer_account_info?: string | null // 客户收款信息,如 "张三 1111111111(customer_account 方式必填)
|
||||||
refund_voucher_key?: string[] | null // 退款凭证(customer_account 方式必填至少 1 个)
|
refund_voucher_key?: string[] | null // 退款凭证(customer_account 方式必填至少 1 个)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ export interface ResubmitRefundRequest {
|
|||||||
method?: RefundMethod | null // 退款方式(不传沿用原值)
|
method?: RefundMethod | null // 退款方式(不传沿用原值)
|
||||||
requested_refund_amount?: number
|
requested_refund_amount?: number
|
||||||
refund_reason?: string
|
refund_reason?: string
|
||||||
customer_account_info?: Record<string, string> | null // 客户收款信息(不传沿用原值)
|
customer_account_info?: string | null // 客户收款信息,如 "张三 1111111111(不传沿用原值)
|
||||||
refund_voucher_key?: string[] | null
|
refund_voucher_key?: string[] | null
|
||||||
attachments?: RefundAttachment[]
|
attachments?: RefundAttachment[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,18 @@
|
|||||||
>
|
>
|
||||||
通过
|
通过
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton v-if="hasAuth('refund:reject')" type="danger" @click="openApprovalDialog('reject')">
|
<ElButton
|
||||||
|
v-if="hasAuth('refund:reject')"
|
||||||
|
type="danger"
|
||||||
|
@click="openApprovalDialog('reject')"
|
||||||
|
>
|
||||||
拒绝
|
拒绝
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton v-if="hasAuth('refund:return')" type="primary" @click="openApprovalDialog('return')">
|
<ElButton
|
||||||
|
v-if="hasAuth('refund:return')"
|
||||||
|
type="primary"
|
||||||
|
@click="openApprovalDialog('return')"
|
||||||
|
>
|
||||||
退回
|
退回
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</template>
|
</template>
|
||||||
@@ -111,11 +119,7 @@
|
|||||||
/>
|
/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="开户银行">
|
<ElFormItem label="开户银行">
|
||||||
<ElInput
|
<ElInput v-model="resubmitForm.customer_bank_name" placeholder="选填" maxlength="50" />
|
||||||
v-model="resubmitForm.customer_bank_name"
|
|
||||||
placeholder="选填"
|
|
||||||
maxlength="50"
|
|
||||||
/>
|
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</template>
|
</template>
|
||||||
<ElFormItem label="退款原因">
|
<ElFormItem label="退款原因">
|
||||||
@@ -125,8 +129,8 @@
|
|||||||
:rows="3"
|
:rows="3"
|
||||||
maxlength="1000"
|
maxlength="1000"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
placeholder="请输入退款原因"
|
placeholder="请输入退款原因"
|
||||||
/>
|
/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:label="
|
:label="
|
||||||
@@ -226,8 +230,7 @@
|
|||||||
const resubmitUploadRef = ref<InstanceType<typeof VoucherUpload>>()
|
const resubmitUploadRef = ref<InstanceType<typeof VoucherUpload>>()
|
||||||
|
|
||||||
const requireResubmitCustomerAccount =
|
const requireResubmitCustomerAccount =
|
||||||
(message: string) =>
|
(message: string) => (_rule: unknown, value: string, callback: (error?: Error) => void) => {
|
||||||
(_rule: unknown, value: string, callback: (error?: Error) => void) => {
|
|
||||||
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT && !value?.trim()) {
|
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT && !value?.trim()) {
|
||||||
callback(new Error(message))
|
callback(new Error(message))
|
||||||
} else {
|
} else {
|
||||||
@@ -373,9 +376,7 @@
|
|||||||
[
|
[
|
||||||
`退款方式:${item.method_name || '-'}`,
|
`退款方式:${item.method_name || '-'}`,
|
||||||
`金额:${formatCurrency(item.refund_amount)}`,
|
`金额:${formatCurrency(item.refund_amount)}`,
|
||||||
item.channel_refund_request_no
|
item.channel_refund_request_no ? `渠道申请号:${item.channel_refund_request_no}` : '',
|
||||||
? `渠道申请号:${item.channel_refund_request_no}`
|
|
||||||
: '',
|
|
||||||
item.created_at ? `提交时间:${formatDateTime(item.created_at)}` : ''
|
item.created_at ? `提交时间:${formatDateTime(item.created_at)}` : ''
|
||||||
]
|
]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
@@ -479,9 +480,7 @@
|
|||||||
{
|
{
|
||||||
label: '异常标记',
|
label: '异常标记',
|
||||||
formatter: (_, data) =>
|
formatter: (_, data) =>
|
||||||
Number(data.anomaly_flag) === 1
|
Number(data.anomaly_flag) === 1 ? `异常:${data.anomaly_reason || ''}` : '正常'
|
||||||
? `异常:${data.anomaly_reason || ''}`
|
|
||||||
: '正常'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '套餐已用量/总量',
|
label: '套餐已用量/总量',
|
||||||
@@ -493,7 +492,7 @@
|
|||||||
fullWidth: true,
|
fullWidth: true,
|
||||||
render: (data) =>
|
render: (data) =>
|
||||||
data.method === RefundMethod.CUSTOMER_ACCOUNT && data.customer_account_info
|
data.method === RefundMethod.CUSTOMER_ACCOUNT && data.customer_account_info
|
||||||
? renderStructuredValue(data.customer_account_info)
|
? h('span', data.customer_account_info)
|
||||||
: h('span', '-')
|
: h('span', '-')
|
||||||
},
|
},
|
||||||
...(!isRestrictedCustomerRole.value
|
...(!isRestrictedCustomerRole.value
|
||||||
@@ -741,13 +740,7 @@
|
|||||||
data.method = resubmitForm.method
|
data.method = resubmitForm.method
|
||||||
}
|
}
|
||||||
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT) {
|
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT) {
|
||||||
data.customer_account_info = {
|
data.customer_account_info = `${resubmitForm.customer_account_name.trim()} ${resubmitForm.customer_account_number.trim()}${resubmitForm.customer_bank_name.trim() ? ` ${resubmitForm.customer_bank_name.trim()}` : ''}`
|
||||||
account_name: resubmitForm.customer_account_name.trim(),
|
|
||||||
account_number: resubmitForm.customer_account_number.trim(),
|
|
||||||
...(resubmitForm.customer_bank_name.trim()
|
|
||||||
? { bank_name: resubmitForm.customer_bank_name.trim() }
|
|
||||||
: {})
|
|
||||||
}
|
|
||||||
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
||||||
} else if (resubmitForm.refund_voucher_key.length) {
|
} else if (resubmitForm.refund_voucher_key.length) {
|
||||||
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
||||||
|
|||||||
@@ -150,7 +150,9 @@
|
|||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:label="
|
:label="
|
||||||
resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT ? '退款凭证(必填)' : '退款凭证'
|
resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT
|
||||||
|
? '退款凭证(必填)'
|
||||||
|
: '退款凭证'
|
||||||
"
|
"
|
||||||
prop="refund_voucher_key"
|
prop="refund_voucher_key"
|
||||||
>
|
>
|
||||||
@@ -393,8 +395,7 @@
|
|||||||
const resubmitFormRef = ref<FormInstance>()
|
const resubmitFormRef = ref<FormInstance>()
|
||||||
|
|
||||||
const requireResubmitCustomerAccount =
|
const requireResubmitCustomerAccount =
|
||||||
(message: string) =>
|
(message: string) => (_rule: unknown, value: string, callback: (error?: Error) => void) => {
|
||||||
(_rule: unknown, value: string, callback: (error?: Error) => void) => {
|
|
||||||
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT && !value?.trim()) {
|
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT && !value?.trim()) {
|
||||||
callback(new Error(message))
|
callback(new Error(message))
|
||||||
} else {
|
} else {
|
||||||
@@ -876,13 +877,7 @@
|
|||||||
data.method = resubmitForm.method
|
data.method = resubmitForm.method
|
||||||
}
|
}
|
||||||
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT) {
|
if (resubmitForm.method === RefundMethod.CUSTOMER_ACCOUNT) {
|
||||||
data.customer_account_info = {
|
data.customer_account_info = `${resubmitForm.customer_account_name.trim()} ${resubmitForm.customer_account_number.trim()}${resubmitForm.customer_bank_name.trim() ? ` ${resubmitForm.customer_bank_name.trim()}` : ''}`
|
||||||
account_name: resubmitForm.customer_account_name.trim(),
|
|
||||||
account_number: resubmitForm.customer_account_number.trim(),
|
|
||||||
...(resubmitForm.customer_bank_name.trim()
|
|
||||||
? { bank_name: resubmitForm.customer_bank_name.trim() }
|
|
||||||
: {})
|
|
||||||
}
|
|
||||||
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
||||||
} else if (resubmitForm.refund_voucher_key.length) {
|
} else if (resubmitForm.refund_voucher_key.length) {
|
||||||
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
data.refund_voucher_key = resubmitForm.refund_voucher_key
|
||||||
@@ -1068,7 +1063,6 @@
|
|||||||
refundVoucherFileKeys.value = voucherKeys
|
refundVoucherFileKeys.value = voucherKeys
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.refund-page {
|
.refund-page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user