07f5c92f4b
- 添加编辑和新增收货地址页面,支持表单数据加载和提交 - 新增应用密钥凭证、新增应用操作动态、新增应用成员、新增应用版本页面配置 - 实现文章新增及编辑页面,包含图片上传及多种文章属性配置 - 增加注册会员页面,支持头像上传、手机号获取和邀请人关系处理 - 引入统一表单提交成功和失败处理,支持编辑模式数据回显 - 配置统一eslint和editorconfig规则,增强代码规范和编辑体验 - 新增.gitignore规则,屏蔽无关文件和目录,优化版本管理
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
import { View, Text } from '@tarojs/components'
|
|
import Taro from '@tarojs/taro'
|
|
import { ConfigProvider, Grid } from '@nutui/nutui-react-taro'
|
|
import { useUser } from '@/hooks/useUser'
|
|
import { useThemeStyles } from '@/hooks/useTheme'
|
|
import { Edit } from '@nutui/icons-react-taro'
|
|
|
|
function Admin() {
|
|
const { isAdmin } = useUser()
|
|
const themeStyles = useThemeStyles()
|
|
|
|
if (!isAdmin()) {
|
|
return (
|
|
<View className="bg-gray-100 min-h-screen flex items-center justify-center">
|
|
<View className="text-center">
|
|
<Text className="text-gray-400 text-sm">暂无访问权限</Text>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<View className="bg-gray-100 min-h-screen">
|
|
<View className="px-4 py-6" style={themeStyles.primaryBackground}>
|
|
<Text className="text-white text-lg font-bold">内容管理</Text>
|
|
<View className="mt-1">
|
|
<Text className="text-white text-sm opacity-80">管理文章、内容等数据</Text>
|
|
</View>
|
|
</View>
|
|
|
|
<View className="bg-white mx-4 mt-4 rounded-xl p-4">
|
|
<Text className="font-semibold text-gray-800 mb-4 block">管理工具</Text>
|
|
<ConfigProvider>
|
|
<Grid columns={4}>
|
|
<Grid.Item text="文章管理" onClick={() => Taro.navigateTo({ url: '/admin/article/index' })}>
|
|
<View className="text-center">
|
|
<View className="w-12 h-12 bg-blue-500 rounded-xl flex items-center justify-center mx-auto mb-2">
|
|
<Edit color="#3b82f6" size="20" />
|
|
</View>
|
|
</View>
|
|
</Grid.Item>
|
|
</Grid>
|
|
</ConfigProvider>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
export default Admin
|