项目初始化

This commit is contained in:
2026-03-18 15:54:43 +08:00
commit dfcd762e23
601 changed files with 57883 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import createAxios from '/@/utils/axios'
export function getAdminRules() {
return createAxios({
url: '/admin/auth.Rule/index',
method: 'get',
})
}

142
web/src/api/backend/crud.ts Normal file
View File

@@ -0,0 +1,142 @@
import { useBaAccount } from '/@/stores/baAccount'
import { useSiteConfig } from '/@/stores/siteConfig'
import createAxios from '/@/utils/axios'
export const url = '/admin/crud.Crud/'
export function generate(data: anyObj) {
return createAxios(
{
url: url + 'generate',
method: 'post',
data: data,
},
{
showSuccessMessage: true,
}
)
}
export function getFileData(table: string, commonModel = 0) {
return createAxios({
url: url + 'getFileData',
method: 'get',
params: {
table: table,
commonModel: commonModel,
},
})
}
export function generateCheck(data: anyObj) {
return createAxios(
{
url: url + 'generateCheck',
method: 'post',
data: data,
},
{
showCodeMessage: false,
}
)
}
export function parseFieldData(data: anyObj) {
return createAxios({
url: url + 'parseFieldData',
method: 'post',
data: data,
})
}
export function postLogStart(id: string, type: string) {
const data: anyObj = {
id,
type,
}
if (type == 'Cloud history') {
const baAccount = useBaAccount()
data['token'] = baAccount.getToken('auth')
}
return createAxios({
url: url + 'logStart',
method: 'post',
data: data,
})
}
export function postDel(id: number) {
return createAxios({
url: url + 'delete',
method: 'post',
data: {
id: id,
},
})
}
export function checkCrudLog(table: string, connection: string) {
return createAxios({
url: url + 'checkCrudLog',
method: 'get',
params: {
table: table,
connection: connection,
},
})
}
export function uploadLog(data: anyObj) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + '/api/v6.Crud/uploadLog',
data: data,
method: 'post',
},
{
anotherToken: baAccount.getToken('auth'),
}
)
}
export function uploadCompleted(data: anyObj) {
return createAxios({
url: url + 'uploadCompleted',
data: data,
method: 'post',
})
}
export function logs(data: anyObj = {}) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + '/api/v6.Crud/logs',
data: data,
method: 'post',
},
{
anotherToken: baAccount.getToken('auth'),
}
)
}
export function delLog(data: anyObj = {}) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + '/api/v6.Crud/del',
data: data,
method: 'post',
},
{
anotherToken: baAccount.getToken('auth'),
}
)
}

View File

@@ -0,0 +1,10 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/Dashboard/'
export function index() {
return createAxios({
url: url + 'index',
method: 'get',
})
}

View File

@@ -0,0 +1,72 @@
import { useAdminInfo } from '/@/stores/adminInfo'
import { useBaAccount } from '/@/stores/baAccount'
import { useSiteConfig } from '/@/stores/siteConfig'
import createAxios from '/@/utils/axios'
export const url = '/admin/Index/'
export function index() {
return createAxios({
url: url + 'index',
method: 'get',
})
}
export function login(method: 'get' | 'post', params: object = {}) {
return createAxios({
url: url + 'login',
data: params,
method: method,
})
}
export function logout() {
const adminInfo = useAdminInfo()
return createAxios({
url: url + 'logout',
method: 'POST',
data: {
refreshToken: adminInfo.getToken('refresh'),
},
})
}
export function baAccountCheckIn(params: object = {}) {
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + '/api/user/checkIn',
data: params,
method: 'post',
},
{
showSuccessMessage: true,
}
)
}
export function baAccountGetUserInfo() {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + '/api/user/info',
method: 'get',
},
{
anotherToken: baAccount.getToken('auth'),
}
)
}
export function baAccountLogout() {
const siteConfig = useSiteConfig()
const baAccount = useBaAccount()
return createAxios({
url: siteConfig.apiUrl + '/api/user/logout',
method: 'POST',
data: {
refreshToken: baAccount.getToken('refresh'),
},
})
}

View File

@@ -0,0 +1,190 @@
import { useBaAccount } from '/@/stores/baAccount'
import { useSiteConfig } from '/@/stores/siteConfig'
import createAxios from '/@/utils/axios'
const storeUrl = '/api/v7.store/'
const moduleControllerUrl = '/admin/module/'
export function index(params: anyObj = {}) {
return createAxios({
url: moduleControllerUrl + 'index',
method: 'get',
params: params,
})
}
export function modules(params: anyObj = {}) {
const siteConfig = useSiteConfig()
return createAxios({
url: siteConfig.apiUrl + storeUrl + 'modules',
method: 'get',
params: params,
})
}
export function info(params: anyObj) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + storeUrl + 'info',
method: 'get',
params: params,
},
{
anotherToken: baAccount.getToken('auth'),
}
)
}
export function createOrder(params: object = {}) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + storeUrl + 'order',
method: 'post',
params: params,
},
{
anotherToken: baAccount.getToken('auth'),
}
)
}
export function payOrder(orderId: number, payType: string) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + storeUrl + 'pay',
method: 'post',
params: {
order_id: orderId,
pay_type: payType,
},
},
{
anotherToken: baAccount.getToken('auth'),
showSuccessMessage: true,
}
)
}
export function payCheck(sn: string) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + '/api/pay/check',
method: 'get',
params: {
sn: sn,
},
},
{
anotherToken: baAccount.getToken('auth'),
showCodeMessage: false,
}
)
}
/**
* 获取模块的可安装版本列表
*/
export function preDownload(data: anyObj) {
const baAccount = useBaAccount()
const siteConfig = useSiteConfig()
return createAxios(
{
url: siteConfig.apiUrl + storeUrl + 'preDownload',
method: 'POST',
data,
},
{
anotherToken: baAccount.getToken('auth'),
}
)
}
export function getInstallState(uid: string) {
return createAxios({
url: moduleControllerUrl + 'state',
method: 'get',
params: {
uid: uid,
},
})
}
export function postInstallModule(uid: string, orderId: number, version: string, update: boolean, extend: anyObj = {}) {
const baAccount = useBaAccount()
return createAxios(
{
url: moduleControllerUrl + 'install',
method: 'POST',
data: {
uid,
update,
version,
orderId,
token: baAccount.getToken('auth'),
extend,
},
timeout: 3000 * 10,
},
{
showCodeMessage: false,
}
)
}
export function postUninstall(uid: string) {
return createAxios(
{
url: moduleControllerUrl + 'uninstall',
method: 'post',
params: {
uid: uid,
},
},
{
showSuccessMessage: true,
}
)
}
export function changeState(params: anyObj) {
return createAxios(
{
url: moduleControllerUrl + 'changeState',
method: 'post',
data: params,
},
{
showCodeMessage: false,
}
)
}
export function dependentInstallComplete(uid: string) {
return createAxios({
url: moduleControllerUrl + 'dependentInstallComplete',
method: 'post',
params: {
uid: uid,
},
})
}
export function upload(file: string) {
const baAccount = useBaAccount()
return createAxios({
url: moduleControllerUrl + 'upload',
method: 'post',
params: {
file: file,
token: baAccount.getToken('auth'),
},
})
}

View File

@@ -0,0 +1,37 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/routine.AdminInfo/'
export const actionUrl = new Map([
['index', url + 'index'],
['edit', url + 'edit'],
['log', '/admin/auth.AdminLog/index'],
])
export function index() {
return createAxios({
url: actionUrl.get('index'),
method: 'get',
})
}
export function log(filter: anyObj = {}) {
return createAxios<TableDefaultData>({
url: actionUrl.get('log'),
method: 'get',
params: filter,
})
}
export function postData(data: anyObj) {
return createAxios(
{
url: actionUrl.get('edit'),
method: 'post',
data: data,
},
{
showSuccessMessage: true,
}
)
}

View File

@@ -0,0 +1,59 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/routine.Config/'
export const actionUrl = new Map([
['index', url + 'index'],
['add', url + 'add'],
['edit', url + 'edit'],
['del', url + 'del'],
['sendTestMail', url + 'sendTestMail'],
])
export function index() {
return createAxios({
url: actionUrl.get('index'),
method: 'get',
})
}
export function postData(action: string, data: anyObj) {
return createAxios(
{
url: actionUrl.get(action),
method: 'post',
data: data,
},
{
showSuccessMessage: true,
}
)
}
export function del(ids: string[]) {
return createAxios(
{
url: actionUrl.get('del'),
method: 'DELETE',
params: {
ids: ids,
},
},
{
showSuccessMessage: true,
}
)
}
export function postSendTestMail(data: anyObj, mail: string) {
return createAxios(
{
url: actionUrl.get('sendTestMail'),
method: 'POST',
data: Object.assign({}, data, { testMail: mail }),
},
{
showSuccessMessage: true,
}
)
}

View File

@@ -0,0 +1,10 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/security.DataRecycle/'
export function add() {
return createAxios({
url: url + 'add',
method: 'get',
})
}

View File

@@ -0,0 +1,28 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/security.DataRecycleLog/'
export function restore(ids: string[]) {
return createAxios(
{
url: url + 'restore',
method: 'POST',
data: {
ids: ids,
},
},
{
showSuccessMessage: true,
}
)
}
export function info(id: string) {
return createAxios({
url: url + 'info',
method: 'get',
params: {
id: id,
},
})
}

View File

@@ -0,0 +1,10 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/security.SensitiveData/'
export function add() {
return createAxios({
url: url + 'add',
method: 'get',
})
}

View File

@@ -0,0 +1,28 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/security.SensitiveDataLog/'
export function rollback(ids: string[]) {
return createAxios(
{
url: url + 'rollback',
method: 'POST',
data: {
ids: ids,
},
},
{
showSuccessMessage: true,
}
)
}
export function info(id: string) {
return createAxios({
url: url + 'info',
method: 'get',
params: {
id: id,
},
})
}

View File

@@ -0,0 +1,8 @@
import createAxios from '/@/utils/axios'
export function getUserRules() {
return createAxios({
url: '/admin/user.Rule/index',
method: 'get',
})
}

View File

@@ -0,0 +1,13 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/user.MoneyLog/'
export function add(userId: string) {
return createAxios({
url: url + 'add',
method: 'get',
params: {
userId: userId,
},
})
}

View File

@@ -0,0 +1,13 @@
import createAxios from '/@/utils/axios'
export const url = '/admin/user.ScoreLog/'
export function add(userId: string) {
return createAxios({
url: url + 'add',
method: 'get',
params: {
userId: userId,
},
})
}