update api url
This commit is contained in:
parent
5b0a4040b9
commit
9dafc7dd5d
19
nginx.conf
19
nginx.conf
@ -38,5 +38,24 @@ server {
|
||||
|
||||
add_header X-Cache $upstream_cache_status;
|
||||
}
|
||||
|
||||
|
||||
#PROXY-START/staff-api/
|
||||
location ^~ /staff-api
|
||||
{
|
||||
proxy_pass https://103.124.155.66/api;
|
||||
proxy_set_header Host test-api.hkchc.team;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_http_version 1.1;
|
||||
# proxy_hide_header Upgrade;
|
||||
|
||||
add_header X-Cache $upstream_cache_status;
|
||||
}
|
||||
#PROXY-END/
|
||||
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,10 @@ const BillDetailItems = (prop: BillDetailItemsProps) => {
|
||||
},[prop.bill])
|
||||
return (<>
|
||||
<BillDetailItem icon={<IconBillType/>} title={t('manual.bill_type')} value={billType}/>
|
||||
{prop.studentNumberRender?prop.studentNumberRender:<BillDetailItem icon={<IconStudentId/>} title={t('manual.student_number')} value={prop.bill.student_number || prop.bill.application_number || '-'}/>}
|
||||
{prop.studentNumberRender?prop.studentNumberRender:<>
|
||||
{prop.bill.student_number && prop.bill.student_number != prop.bill.application_number && <BillDetailItem icon={<IconStudentId/>} title={t('manual.student_number')} value={prop.bill.student_number}/> }
|
||||
{prop.bill.application_number && <BillDetailItem icon={<IconStudentId/>} title={t('base.bill_number')} value={prop.bill.application_number}/> }
|
||||
</>}
|
||||
<BillDetailItem icon={<IconStudentName/>} title={t('bill.title_student_name')}
|
||||
value={`${prop.bill.student_english_name||'-'}${prop.bill.student_chinese_name?' / '+ prop.bill.student_chinese_name : ''}`}/>
|
||||
<BillDetailItem icon={<IconStudentEmail/>} title={'Email'} value={prop.bill.student_email||'-'}/>
|
||||
|
@ -40,7 +40,7 @@
|
||||
}
|
||||
.bill-info-detail{
|
||||
margin-left: 30px;
|
||||
width: 340px;
|
||||
min-width: 380px;
|
||||
}
|
||||
.bill-exp-time{
|
||||
font-size: 18px;
|
||||
|
@ -1,38 +1,57 @@
|
||||
import styles from "@/pages/manual/manual.module.less";
|
||||
import {Button, Space} from "@douyinfe/semi-ui";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {useSetState} from "ahooks";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
import styles from "@/pages/manual/manual.module.less";
|
||||
import {BillDetailItems, useBillQRCode} from "@/components/bill/index.ts";
|
||||
import {getPayUrl} from "@/components/bill/qr-code.tsx";
|
||||
|
||||
import './bill.less'
|
||||
import dayjs from "dayjs";
|
||||
|
||||
|
||||
type BillDetailProps = {
|
||||
onCancel: ()=>void;
|
||||
bill:BillModel;
|
||||
onCancel: () => void;
|
||||
bill: BillModel;
|
||||
}
|
||||
const BillDetail:BasicComponent<BillDetailProps> = ({bill,onCancel})=>{
|
||||
const {t} = useTranslation();
|
||||
const { exportQRCode,QRCode } = useBillQRCode()
|
||||
return <div className={'modal-bill-detail'}>
|
||||
<div className={'modal-bill-info'}>
|
||||
<div className={'bill-qr-code'}>
|
||||
<div className={styles.QRCodeContainer}>
|
||||
<QRCode size={160} className={styles.qrCode} bill={bill} />
|
||||
</div>
|
||||
</div>
|
||||
<div className={'bill-info-detail'}>
|
||||
<div className={'bill-exp-time text-center'}> {t('manual.exp_time')} {dayjs(bill.expiration_time).format('YYYY-MM-DD HH:mm')} </div>
|
||||
<BillDetailItems bill={bill} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-center semi-modal-footer">
|
||||
<Space spacing={1}>
|
||||
<Button type="primary" onClick={onCancel}>{t('base.close')}</Button>
|
||||
<Button theme={'solid'} type="primary" onClick={exportQRCode}>{t('bill.download-qr-code')}</Button>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
const BillDetail: BasicComponent<BillDetailProps> = ({bill, onCancel}) => {
|
||||
const {t} = useTranslation();
|
||||
const {exportQRCode, QRCode} = useBillQRCode()
|
||||
const [state, setState] = useSetState<{ success: boolean }>({
|
||||
success: false
|
||||
})
|
||||
|
||||
const onCopy = () => {
|
||||
const payUrl = getPayUrl(bill.id,'link');
|
||||
navigator.clipboard.writeText(payUrl).then(() => {
|
||||
setState({success: true})
|
||||
setTimeout(() => {
|
||||
setState({success: false})
|
||||
}, 3000)
|
||||
})
|
||||
}
|
||||
return <div className={'modal-bill-detail'}>
|
||||
<div className={'modal-bill-info'}>
|
||||
<div className={'bill-qr-code'}>
|
||||
<div className={styles.QRCodeContainer}>
|
||||
<QRCode size={160} className={styles.qrCode} bill={bill}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'bill-info-detail'}>
|
||||
<div
|
||||
className={'bill-exp-time text-center'}> {t('manual.exp_time')} {dayjs(bill.expiration_time).format('YYYY-MM-DD HH:mm')} </div>
|
||||
<BillDetailItems bill={bill}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-center semi-modal-footer">
|
||||
<Space spacing={1}>
|
||||
<Button
|
||||
disabled={state.success} style={{width: 150}} theme={'borderless'}
|
||||
onClick={onCopy} type={'tertiary'}>{state.success ? 'Copy Success' : t('base.copy-pay-url')}</Button>
|
||||
<Button type="primary" onClick={onCancel}>{t('base.close')}</Button>
|
||||
<Button theme={'solid'} type="primary" onClick={exportQRCode}>{t('bill.download-qr-code')}</Button>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
export default BillDetail
|
@ -43,7 +43,8 @@ export const BillList: React.FC<BillListProps> = (props) => {
|
||||
showCols: string[]
|
||||
}>({
|
||||
showCols: [
|
||||
"id", "merchant_ref", "student_number", "application_number", 'confirm_status', "initiated_paid_at", "delivered_at", "paid_at", "student_english_name", "student_email", "programme_english_name",
|
||||
"id", "merchant_ref", "student_number", "application_number", 'confirm_status', "initiated_paid_at", "delivered_at",
|
||||
"paid_at", "student_english_name", "student_email", "programme_english_name","department_english_name",
|
||||
"intake_year", "detail", "detail_confirms", "amount", "pay_amount", "actual_payment_amount", "pay_method", "status", "apply_status"
|
||||
]
|
||||
})
|
||||
|
@ -13,9 +13,9 @@ export type BillQrcodeProps = {
|
||||
}
|
||||
|
||||
// get bill payment url
|
||||
function getPayUrl(billId?: string | number) {
|
||||
export function getPayUrl(billId?: string | number,from='qrcode') {
|
||||
const rootUrl = getAppUrl();
|
||||
return `${rootUrl}/pay?bill=${billId || 0}&from=qrcode`
|
||||
return `${rootUrl}/pay?bill=${billId || 0}&from=${from}`
|
||||
}
|
||||
|
||||
const useBillQRCode = () => {
|
||||
|
@ -2,7 +2,7 @@ import {useEffect, useState} from "react";
|
||||
|
||||
function getRemoteUserNameList() {
|
||||
return new Promise<string[][]>((resolve, reject) => {
|
||||
fetch(`${AppConfig.ldapApiUrl}/api/v1/hkchc/user/ldap/get_staff_list`, {
|
||||
fetch(`/staff-api/v1/hkchc/user/ldap/get_staff_list`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Apikey: AppConfig.ldapApiKey
|
||||
|
@ -8,6 +8,7 @@
|
||||
"confirm": "Confirm",
|
||||
"confirm_next_operation": "Please confirm this operation",
|
||||
"confirm_paid": "Confirm paid",
|
||||
"copy-pay-url": "Copy payment link",
|
||||
"operate_fail": "Operation failed",
|
||||
"operate_success": "Operation success",
|
||||
"please_enter": "Please Enter",
|
||||
@ -108,13 +109,13 @@
|
||||
"title": "Login"
|
||||
},
|
||||
"manual": {
|
||||
"amount": "Amount",
|
||||
"amount": "Bill Amount",
|
||||
"amount_gt0": "must be greater than 0",
|
||||
"amount_required": "require",
|
||||
"bill_type": "Bill Type",
|
||||
"bill_type_required": "please select bill type",
|
||||
"btn_generate": "Generate Bill",
|
||||
"exp_time": "The bill will expires at",
|
||||
"exp_time": "Bill expiration datetime",
|
||||
"student_number": "Student Number",
|
||||
"student_number_required": "required student number",
|
||||
"success": "Create bill success"
|
||||
|
@ -8,6 +8,7 @@
|
||||
"confirm": "确定",
|
||||
"confirm_next_operation": "请确认是否进行此操作",
|
||||
"confirm_paid": "确认已支付",
|
||||
"copy-pay-url": "复制支付链接",
|
||||
"operate_fail": "操作失败",
|
||||
"operate_success": "操作成功",
|
||||
"please_enter": "请输入",
|
||||
@ -108,7 +109,7 @@
|
||||
"title": "登录"
|
||||
},
|
||||
"manual": {
|
||||
"amount": "金额",
|
||||
"amount": "账单金额",
|
||||
"amount_gt0": "账单金额必须大于0",
|
||||
"amount_required": "请填写",
|
||||
"bill_type": "账单类型",
|
||||
|
@ -8,6 +8,7 @@
|
||||
"confirm": "確定",
|
||||
"confirm_next_operation": "請確認是否進行此操作",
|
||||
"confirm_paid": "確認已支付",
|
||||
"copy-pay-url": "複製付款連結",
|
||||
"operate_fail": "操作失敗",
|
||||
"operate_success": "操作成功",
|
||||
"please_enter": "請輸入",
|
||||
@ -108,7 +109,7 @@
|
||||
"title": "登入"
|
||||
},
|
||||
"manual": {
|
||||
"amount": "金額",
|
||||
"amount": "帳單金額",
|
||||
"amount_gt0": "帳單金額必須大於0",
|
||||
"amount_required": "請填寫",
|
||||
"bill_type": "帳單類型",
|
||||
|
@ -72,8 +72,9 @@ const BillQuery = () => {
|
||||
>
|
||||
<Button size={'small'} theme={'solid'} type={'primary'}>{t('bill.cancel')}</Button>
|
||||
</Popconfirm>
|
||||
<Button onClick={() => setShowBill(bill)} size={'small'} theme={'solid'}
|
||||
type={'primary'}>{t('base.qr-code')}</Button>
|
||||
<Button
|
||||
onClick={() => setShowBill(bill)} size={'small'} theme={'solid'}
|
||||
type={'primary'}>{t('base.qr-code')}</Button>
|
||||
{AppMode == 'development' && <a href={`/pay?bill=${bill.id}`} target={'_blank'}>支付</a>}
|
||||
</>}
|
||||
{
|
||||
@ -131,8 +132,8 @@ const BillQuery = () => {
|
||||
</ButtonGroup>
|
||||
</Space>}
|
||||
|
||||
onRowSelection={(keys)=>setSelectedKeys(keys as number[])}
|
||||
rowSelectionDisabled={(r)=>(r.status != BillStatus.PAID || r.confirm_status == 'CONFIRMED')}
|
||||
onRowSelection={(keys) => setSelectedKeys(keys as number[])}
|
||||
rowSelectionDisabled={(r) => (r.status != BillStatus.PAID || r.confirm_status == 'CONFIRMED')}
|
||||
onPageChange={(page_number) => {
|
||||
setBillQueryParams({
|
||||
...queryParams,
|
||||
@ -143,7 +144,7 @@ const BillQuery = () => {
|
||||
<Modal
|
||||
title="Bill Detail"
|
||||
visible={!!showBill}
|
||||
width={620}
|
||||
width={680}
|
||||
onCancel={() => setShowBill(undefined)} //>=1.16.0
|
||||
closeOnEsc={true}
|
||||
footer={null}
|
||||
|
@ -37,6 +37,12 @@ export default defineConfig(({mode}) => {
|
||||
// target: 'http://127.0.0.1:50000', //
|
||||
changeOrigin: true,
|
||||
//rewrite: (path) => path.replace(/^\/api/, '')
|
||||
},
|
||||
'/staff-api': {
|
||||
target: 'https://test-api.hkchc.team', //
|
||||
// target: 'http://127.0.0.1:50000', //
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/staff-api/, '/api/')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user