- 设计并实现了开发者中心与企业控制台两大模块 - 按用户角色区分开发者和企业客户,支持多项目类型及成员管理 - 新增项目管理、应用管理、API Key管理及成员邀请等多功能页面 - 实现应用版本发布、消息通知中心、权限审批与开发者申请流程 - 完成CI/CD流水线、运营监控、发票管理、SSO单点登录功能 - 搭建SDK下载中心、工单系统、FAQ系统、数据导入导出等模块 - 优化后端API,支持已登录和未注册用户不同加入应用流程 - 前端按钮统一采用微信手机号授权,完善用户授权体验 - 修复多个页面的JSX语法错误及依赖导入问题,替换部分组件库 - 增加详细的类型定义文件,提升项目类型安全 - 新增超过55个页面及60个API接口,扩展应用功能和服务体系 - 完成全面的样式设计,实现一致的视觉风格和交互体验
81 lines
2.2 KiB
TypeScript
81 lines
2.2 KiB
TypeScript
import {useState} from "react";
|
|
import Taro, {useDidShow} from '@tarojs/taro'
|
|
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
|
|
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
|
|
import {AppCredential} from "@/api/app/appCredential/model";
|
|
import {listAppCredential, removeAppCredential} from "@/api/app/appCredential";
|
|
|
|
const AppCredentialList = () => {
|
|
const [list, setList] = useState<AppCredential[]>([])
|
|
|
|
const reload = () => {
|
|
listAppCredential({})
|
|
.then(data => {
|
|
setList(data || [])
|
|
})
|
|
.catch(() => {
|
|
Taro.showToast({
|
|
title: '获取数据失败',
|
|
icon: 'error'
|
|
});
|
|
})
|
|
}
|
|
|
|
const onDel = async (id?: number) => {
|
|
await removeAppCredential(id)
|
|
Taro.showToast({
|
|
title: '删除成功',
|
|
icon: 'success'
|
|
});
|
|
reload();
|
|
}
|
|
|
|
useDidShow(() => {
|
|
reload()
|
|
});
|
|
|
|
if (list.length == 0) {
|
|
return (
|
|
<ConfigProvider>
|
|
<div className={'h-full flex flex-col justify-center items-center'} style={{
|
|
height: 'calc(100vh - 300px)',
|
|
}}>
|
|
<Empty
|
|
style={{
|
|
backgroundColor: 'transparent'
|
|
}}
|
|
description="暂无数据"
|
|
/>
|
|
<Space>
|
|
<Button onClick={() => Taro.navigateTo({url: '/app/appCredential/add'})}>新增应用密钥凭证</Button>
|
|
</Space>
|
|
</div>
|
|
</ConfigProvider>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<ConfigProvider>
|
|
<CellGroup>
|
|
{list.map((item) => (
|
|
<Cell
|
|
key={item.id}
|
|
title={item.credentialName || '未命名凭证'}
|
|
description={item.description}
|
|
align="center"
|
|
rightIcon={<ArrowRight />}
|
|
onClick={() => Taro.navigateTo({url: `/app/appCredential/add?id=${item.id}`})}
|
|
/>
|
|
))}
|
|
</CellGroup>
|
|
<Space direction="vertical" style={{padding: '16px'}}>
|
|
<Button onClick={() => Taro.navigateTo({url: '/app/appCredential/add'})}>
|
|
新增应用密钥凭证
|
|
</Button>
|
|
</Space>
|
|
</ConfigProvider>
|
|
);
|
|
};
|
|
|
|
export default AppCredentialList;
|