打包用户端和管理后台

This commit is contained in:
Lrd
2026-07-03 14:22:11 +08:00
parent 7e6318742c
commit b5538ee27a
7 changed files with 79 additions and 65 deletions
+1 -1
View File
@@ -487,7 +487,7 @@ export async function createOauthApp(data: {
app_id: string;
secret: string;
open_type: number;
count?: number;
max_count?: number;
auth_url?: string;
company?: string;
}): Promise<any> {
+24 -24
View File
@@ -10,16 +10,16 @@ import { formatDate } from '../utils/formatDate';
interface OAuthApp {
id: string;
app_id: string;
appId: string;
secret: string;
status: number;
max_count: number;
open_type: number;
auth_url?: string;
maxCount: number;
openType: number;
authUrl?: string;
company?: string;
create_by: string;
created_at: string;
updated_at: string;
createBy: string;
createdAt: string;
updatedAt: string;
}
const AdminOauthAppList: React.FC = () => {
@@ -54,7 +54,7 @@ const AdminOauthAppList: React.FC = () => {
app_id: values.app_id,
secret: values.secret,
open_type: values.open_type,
count: values.count,
max_count: values.max_count,
auth_url: values.auth_url,
company: values.company,
});
@@ -82,11 +82,11 @@ const AdminOauthAppList: React.FC = () => {
const app = await getOauthApp(id);
setCurrentApp(app);
updateForm.setFieldsValue({
app_id: app.app_id,
appId: app.appId,
secret: app.secret,
open_type: app.open_type,
count: app.max_count,
auth_url: app.auth_url,
openType: app.openType,
maxCount: app.maxCount,
authUrl: app.authUrl,
company: app.company,
});
setUpdateModalVisible(true);
@@ -298,7 +298,7 @@ const AdminOauthAppList: React.FC = () => {
</Select>
</Form.Item>
<Form.Item
name="count"
name="max_count"
label="最大授权用户数"
initialValue={100}
>
@@ -334,22 +334,22 @@ const AdminOauthAppList: React.FC = () => {
{currentApp && (
<div style={{ lineHeight: '2' }}>
<p><strong>ID:</strong> {currentApp.id}</p>
<p><strong>ID:</strong> {currentApp.app_id}</p>
<p><strong>ID:</strong> {currentApp.appId}</p>
<p><strong>:</strong> {currentApp.secret}</p>
<p><strong>:</strong> {(() => {
const typeMap: Record<number, string> = {
1: '千川', 2: '广告', 3: '本地推', 4: '星图', 5: '快手代理商',
6: '巨量星图', 7: '巨量服务单', 8: '腾讯服务单', 9: '腾讯营销K2', 10: '腾讯营销K3'
};
return typeMap[currentApp.open_type] || currentApp.open_type;
return typeMap[currentApp.openType] || currentApp.openType;
})()}</p>
<p><strong>:</strong> {currentApp.company || '-'}</p>
<p><strong>:</strong> {currentApp.max_count}</p>
<p><strong>:</strong> {currentApp.maxCount}</p>
<p><strong>:</strong> {currentApp.status === 1 ? '正常' : '禁用'}</p>
<p><strong>URL:</strong> {currentApp.auth_url || '-'}</p>
<p><strong>:</strong> {currentApp.create_by}</p>
<p><strong>:</strong> {formatDate(currentApp.created_at)}</p>
<p><strong>:</strong> {formatDate(currentApp.updated_at)}</p>
<p><strong>URL:</strong> {currentApp.authUrl || '-'}</p>
<p><strong>:</strong> {currentApp.createBy}</p>
<p><strong>:</strong> {formatDate(currentApp.createdAt)}</p>
<p><strong>:</strong> {formatDate(currentApp.updatedAt)}</p>
</div>
)}
</Modal>
@@ -369,7 +369,7 @@ const AdminOauthAppList: React.FC = () => {
>
<Form form={updateForm} layout="vertical">
<Form.Item
name="app_id"
name="appId"
label="应用ID"
rules={[{ required: true, message: '请输入应用ID' }, { max: 64, message: '应用ID不能超过64个字符' }]}
>
@@ -383,7 +383,7 @@ const AdminOauthAppList: React.FC = () => {
<Input placeholder="请输入应用密钥" />
</Form.Item>
<Form.Item
name="open_type"
name="openType"
label="开户方式"
rules={[{ required: true, message: '请选择开户方式' }]}
>
@@ -401,13 +401,13 @@ const AdminOauthAppList: React.FC = () => {
</Select>
</Form.Item>
<Form.Item
name="count"
name="maxCount"
label="最大授权用户数"
>
<InputNumber min={1} placeholder="应用最大可以授权多少个用户" />
</Form.Item>
<Form.Item
name="auth_url"
name="authUrl"
label="应用授权链接"
>
<Input placeholder="请输入应用授权链接" />