·
4
.env.development
Normal file
@ -0,0 +1,4 @@
|
||||
# .env.development
|
||||
VITE_ENV = 'development'
|
||||
VITE_API_URL = 'http://localhost:5277'
|
||||
# VITE_API_URL = 'https://tankapi.xy88.fun:8180'
|
||||
3
.env.production
Normal file
@ -0,0 +1,3 @@
|
||||
# .env.production
|
||||
VITE_ENV = 'production'
|
||||
VITE_API_URL = 'https://tankapi.xy88.fun:8180'
|
||||
24
.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
3
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["Vue.volar"]
|
||||
}
|
||||
13
index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
4306
package-lock.json
generated
Normal file
40
package.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "crazyx.admin",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc -b && vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babylonjs/core": "^8.27.0",
|
||||
"@babylonjs/loaders": "^8.27.0",
|
||||
"ali-oss": "^6.23.0",
|
||||
"amfe-flexible": "^2.2.1",
|
||||
"axios": "^1.11.0",
|
||||
"element-plus": "^2.11.1",
|
||||
"fabric": "^6.7.1",
|
||||
"file-saver": "^2.0.5",
|
||||
"imagetracerjs": "^1.2.6",
|
||||
"js-cookie": "^3.0.5",
|
||||
"save": "^2.9.0",
|
||||
"vue": "^3.5.18",
|
||||
"vue-loading-overlay": "^6.0.6",
|
||||
"vue-router": "^4.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ali-oss": "^6.16.11",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/node": "^24.5.1",
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"less": "^4.4.1",
|
||||
"simplify-img-compressor": "^1.0.4",
|
||||
"typescript": "~5.8.3",
|
||||
"vite": "^7.1.2",
|
||||
"vue-tsc": "^3.0.5"
|
||||
}
|
||||
}
|
||||
BIN
public/assets/hdr/autoshop_01_1k.hdr
Normal file
BIN
public/assets/hdr/autoshop_01_2k.hdr
Normal file
BIN
public/assets/image/firespace/originpic/1.jpg
Normal file
|
After Width: | Height: | Size: 851 KiB |
BIN
public/assets/image/firespace/originpic/10.jpg
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
public/assets/image/firespace/originpic/11.jpg
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
public/assets/image/firespace/originpic/12.jpg
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
public/assets/image/firespace/originpic/2.jpg
Normal file
|
After Width: | Height: | Size: 378 KiB |
BIN
public/assets/image/firespace/originpic/3.jpg
Normal file
|
After Width: | Height: | Size: 262 KiB |
BIN
public/assets/image/firespace/originpic/4.jpg
Normal file
|
After Width: | Height: | Size: 404 KiB |
BIN
public/assets/image/firespace/originpic/5.jpg
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
public/assets/image/firespace/originpic/6.jpg
Normal file
|
After Width: | Height: | Size: 612 KiB |
BIN
public/assets/image/firespace/originpic/7.jpg
Normal file
|
After Width: | Height: | Size: 562 KiB |
BIN
public/assets/image/firespace/originpic/8.jpg
Normal file
|
After Width: | Height: | Size: 341 KiB |
BIN
public/assets/image/firespace/originpic/9.jpg
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
public/assets/image/firespace/originpic/test/101010.jpg
Normal file
|
After Width: | Height: | Size: 574 KiB |
BIN
public/assets/image/firespace/originpic/test/111.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
public/assets/image/firespace/originpic/test/111111.jpg
Normal file
|
After Width: | Height: | Size: 708 KiB |
BIN
public/assets/image/firespace/originpic/test/121212.jpg
Normal file
|
After Width: | Height: | Size: 595 KiB |
BIN
public/assets/image/firespace/originpic/test/222.png
Normal file
|
After Width: | Height: | Size: 993 KiB |
BIN
public/assets/image/firespace/originpic/test/333.png
Normal file
|
After Width: | Height: | Size: 392 KiB |
BIN
public/assets/image/firespace/originpic/test/444.png
Normal file
|
After Width: | Height: | Size: 392 KiB |
BIN
public/assets/image/firespace/originpic/test/555.jpg
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
public/assets/image/firespace/originpic/test/555.png
Normal file
|
After Width: | Height: | Size: 3.6 MiB |
BIN
public/assets/image/firespace/originpic/test/666.jpg
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
public/assets/image/firespace/originpic/test/777.jpg
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
public/assets/image/firespace/originpic/test/888.jpg
Normal file
|
After Width: | Height: | Size: 631 KiB |
BIN
public/assets/image/firespace/originpic/test/999.jpg
Normal file
|
After Width: | Height: | Size: 644 KiB |
BIN
public/assets/image/firespace/thumb/1.jpg
Normal file
|
After Width: | Height: | Size: 180 KiB |
BIN
public/assets/image/firespace/thumb/10.jpg
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
public/assets/image/firespace/thumb/11.jpg
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
public/assets/image/firespace/thumb/12.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
public/assets/image/firespace/thumb/2.jpg
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
public/assets/image/firespace/thumb/3.jpg
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
public/assets/image/firespace/thumb/4.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
public/assets/image/firespace/thumb/5.jpg
Normal file
|
After Width: | Height: | Size: 166 KiB |
BIN
public/assets/image/firespace/thumb/6.jpg
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
public/assets/image/firespace/thumb/7.jpg
Normal file
|
After Width: | Height: | Size: 265 KiB |
BIN
public/assets/image/firespace/thumb/8.jpg
Normal file
|
After Width: | Height: | Size: 164 KiB |
BIN
public/assets/image/firespace/thumb/9.jpg
Normal file
|
After Width: | Height: | Size: 307 KiB |
BIN
public/assets/image/wall_Normal.jpg
Normal file
|
After Width: | Height: | Size: 512 KiB |
BIN
public/assets/model/Paper Bag01.glb
Normal file
BIN
public/assets/model/SM_BoyTshirt.glb
Normal file
BIN
public/assets/model/T-shirt.glb
Normal file
BIN
public/assets/model/TablePAL.glb
Normal file
BIN
public/assets/model/coffee cup.glb
Normal file
BIN
public/assets/model/tbexport.glb
Normal file
1
public/vite.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
32
src/App.vue
Normal file
@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- <div>
|
||||
<a href="https://vite.dev" target="_blank">
|
||||
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
||||
</a>
|
||||
<a href="https://vuejs.org/" target="_blank">
|
||||
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
||||
</a>
|
||||
</div>
|
||||
<HelloWorld msg="Vite + Vue" /> -->
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.logo {
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
transition: filter 300ms;
|
||||
}
|
||||
|
||||
.logo:hover {
|
||||
filter: drop-shadow(0 0 2em #646cffaa);
|
||||
}
|
||||
|
||||
.logo.vue:hover {
|
||||
filter: drop-shadow(0 0 2em #42b883aa);
|
||||
}
|
||||
</style>
|
||||
28
src/Global.ts
Normal file
@ -0,0 +1,28 @@
|
||||
export class Global {
|
||||
private static isInited: boolean = false;
|
||||
public static selectedPrompt: string = "";
|
||||
public static selectedImageOssInfo = {
|
||||
objectName: "",
|
||||
url: "",
|
||||
};
|
||||
public static spaceImagesDesc = new Array<string>();
|
||||
public static spaceImages = new Array<any>();
|
||||
public static maxProductImageSize = 1536; // 生产图最大图片尺寸(长边)
|
||||
public static maxAiImageSize = 1536; // AI生成最大图片尺寸(长边)
|
||||
|
||||
public static bgUserInfo: any = null;
|
||||
|
||||
public static init() {
|
||||
if (Global.isInited) {
|
||||
return;
|
||||
}
|
||||
Global.isInited = true;
|
||||
}
|
||||
|
||||
public static selectImage(id: string) {
|
||||
const imageInfo = Global.spaceImages.find((s) => s.id === id);
|
||||
return imageInfo;
|
||||
}
|
||||
}
|
||||
|
||||
Global.init();
|
||||
98
src/api/BaseApi.ts
Normal file
@ -0,0 +1,98 @@
|
||||
import axios from "axios";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { ToastTool } from "../tools/ToastTool";
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
export class BaseApi {
|
||||
public static readonly baseUrl = import.meta.env.VITE_API_URL as string;
|
||||
|
||||
public maxTryRequestCount = 3; //最大重试请求次数
|
||||
public tryDelayMs = 600; //重试延迟毫秒数
|
||||
public static noTokenHandler: Function | null = null; //没有token时的处理函数,
|
||||
|
||||
public async requestRemoteWithoutToken(
|
||||
option: any,
|
||||
tryCount = 0
|
||||
): Promise<any> {
|
||||
option.hasHeader = false;
|
||||
return await this.requestRemote(option, tryCount);
|
||||
}
|
||||
|
||||
public async requestRemote(option: any, tryCount = 0): Promise<any> {
|
||||
if (option.method == null) {
|
||||
option.method = "get";
|
||||
}
|
||||
if (option.hasHeader == null) {
|
||||
option.hasHeader = true;
|
||||
}
|
||||
|
||||
let token = null;
|
||||
if (option.hasHeader) {
|
||||
const tokenStr = this.getCookie("token");
|
||||
if (tokenStr == null) {
|
||||
if (BaseApi.noTokenHandler != null) {
|
||||
BaseApi.noTokenHandler();
|
||||
}
|
||||
return { data: null };
|
||||
}
|
||||
token = JSON.parse(tokenStr);
|
||||
}
|
||||
|
||||
let scope = this;
|
||||
// 发起一个get 或 post请求
|
||||
let response = await axios({
|
||||
method: option.method,
|
||||
url: `${BaseApi.baseUrl}/${option.url}`,
|
||||
data: option.method === "post" ? option.data : null,
|
||||
params: option.method === "get" ? option.data : null,
|
||||
headers: option.hasHeader
|
||||
? {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${token.access_token}`,
|
||||
}
|
||||
: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}).catch((err: any) => {
|
||||
console.error(err);
|
||||
if (err.response != null && err.response.status === 401) {
|
||||
ToastTool.showWarningMessage("登录信息过期,请重新登录");
|
||||
if (BaseApi.noTokenHandler != null) {
|
||||
BaseApi.noTokenHandler();
|
||||
}
|
||||
return null;
|
||||
} else if (err.response != null && err.response.status === 500) {
|
||||
ToastTool.showErrorMessage("500 InnerException");
|
||||
return null;
|
||||
} else {
|
||||
tryCount++;
|
||||
if (tryCount < scope.maxTryRequestCount) {
|
||||
setTimeout(async () => {
|
||||
return await scope.requestRemote(option, tryCount);
|
||||
}, scope.tryDelayMs);
|
||||
} else {
|
||||
ToastTool.showErrorMessage("服务器维护中");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (response != null) return response.data;
|
||||
else return null;
|
||||
}
|
||||
|
||||
public setCookie(name: string, value: string) {
|
||||
Cookies.set(name, value);
|
||||
}
|
||||
public setCookieForExpires(name: string, value: string, days: number) {
|
||||
Cookies.set(name, value, { expires: days });
|
||||
}
|
||||
public getCookie(name: string): string | null {
|
||||
return Cookies.get(name) || null;
|
||||
}
|
||||
public removeCookie(name: string) {
|
||||
Cookies.remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
const baseApi = new BaseApi();
|
||||
export { baseApi };
|
||||
53
src/api/LoginApi.ts
Normal file
@ -0,0 +1,53 @@
|
||||
import { BaseApi } from "./BaseApi";
|
||||
|
||||
class LoginApi extends BaseApi {
|
||||
public async login(userName: string, password: string) {
|
||||
const token = await this.requestRemoteWithoutToken({
|
||||
method: "post",
|
||||
url: "api/BackstageUser/LoginAdminAndRefreshToken",
|
||||
data: {
|
||||
userName: userName,
|
||||
password: password,
|
||||
},
|
||||
});
|
||||
|
||||
if (token.resCode != 200) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (token.access_token == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
this.setCookie("token", JSON.stringify(token));
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
public checkLogin(): boolean {
|
||||
let token = this.getCookie("token");
|
||||
if (token == null) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public async autoLogin(): Promise<boolean> {
|
||||
let token = this.getCookie("token");
|
||||
if (token != null) {
|
||||
let isOK = await this.requestRemote({
|
||||
method: "get",
|
||||
url: "api/BackstageUser/CheckAuth",
|
||||
});
|
||||
return isOK;
|
||||
// if (isOK) {
|
||||
// this.$router.push({ path: '/main' })
|
||||
// }
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const loginApi = new LoginApi();
|
||||
export { loginApi };
|
||||
47
src/api/MenuApi.ts
Normal file
@ -0,0 +1,47 @@
|
||||
import { BaseApi } from "./BaseApi";
|
||||
|
||||
class MenuApi extends BaseApi {
|
||||
public async menuList(pageData: any): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Menu/MenuList",
|
||||
data: pageData,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
public async allMenuList(): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Menu/AllMenuList",
|
||||
});
|
||||
return data;
|
||||
}
|
||||
public async addOrUpdateMenu(menu: any): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Menu/AddOrUpdateMenu",
|
||||
data: menu,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
public async deleteMenu(id: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Menu/DeleteMenu",
|
||||
data: id,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async menuById(id: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Menu/MenuById",
|
||||
data: id,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
const menuApi = new MenuApi();
|
||||
export { menuApi };
|
||||
33
src/api/ModelApi.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { BaseApi } from "./BaseApi";
|
||||
|
||||
class ModelApi extends BaseApi {
|
||||
public async addOrUpdateModel(model: any): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Model/AddOrUpdateModel",
|
||||
data: model,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async modelList(pageData: any): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Model/ModelList",
|
||||
data: pageData,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async modelById(id: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Model/ModelById",
|
||||
data: id,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
const modelApi = new ModelApi();
|
||||
export { modelApi };
|
||||
24
src/api/ModelPartApi.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { BaseApi } from "./BaseApi";
|
||||
|
||||
class ModelPartApi extends BaseApi {
|
||||
public async addOrUpdateModelParts(model: any): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/ModelPart/AddOrUpdateModelParts",
|
||||
data: model,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async modelPartsFormModelId(modelId: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/ModelPart/ModePartsFormModelId",
|
||||
data: JSON.stringify(modelId),
|
||||
});
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
const modelPartApi = new ModelPartApi();
|
||||
export { modelPartApi };
|
||||
119
src/api/OssApi.ts
Normal file
@ -0,0 +1,119 @@
|
||||
import OSS from "ali-oss";
|
||||
import { BaseApi } from "./BaseApi";
|
||||
|
||||
export class OssApi extends BaseApi {
|
||||
public async getOssObjectName(url: string): Promise<string> {
|
||||
const objectName = await this.requestRemote({
|
||||
method: "post",
|
||||
url: `api/Oss/GetOssObjectName`,
|
||||
data: JSON.stringify(url),
|
||||
});
|
||||
return objectName;
|
||||
}
|
||||
|
||||
public async deleteFileFromOss(objectName: string): Promise<any> {
|
||||
const info = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Oss/GetOssInfo",
|
||||
});
|
||||
if (!info) {
|
||||
return null;
|
||||
}
|
||||
const scope = this;
|
||||
const store = new OSS({
|
||||
accessKeyId: info.token.accessKeyId,
|
||||
accessKeySecret: info.token.accessKeySecret,
|
||||
stsToken: info.token.securityToken,
|
||||
bucket: info.bucket,
|
||||
secure: true,
|
||||
endpoint: info.endpoint,
|
||||
refreshSTSToken: async () => {
|
||||
const info = await scope.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Oss/GetOssInfo",
|
||||
});
|
||||
if (info == null) {
|
||||
return {
|
||||
accessKeyId: "",
|
||||
accessKeySecret: "",
|
||||
stsToken: "",
|
||||
secure: true,
|
||||
bucket: "",
|
||||
endpoint: "",
|
||||
};
|
||||
}
|
||||
return {
|
||||
accessKeyId: info.token.accessKeyId,
|
||||
accessKeySecret: info.token.accessKeySecret,
|
||||
stsToken: info.token.securityToken,
|
||||
secure: true,
|
||||
bucket: info.bucket,
|
||||
endpoint: info.endpoint,
|
||||
};
|
||||
},
|
||||
refreshSTSTokenInterval: 300000,
|
||||
});
|
||||
let result = await store.delete(objectName);
|
||||
return result;
|
||||
}
|
||||
public async uploadFileToOss(
|
||||
objectName: string,
|
||||
blob: Blob,
|
||||
expiresAt: string | null = null
|
||||
): Promise<any> {
|
||||
const info = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Oss/GetOssInfo",
|
||||
});
|
||||
if (!info) {
|
||||
return null;
|
||||
}
|
||||
const scope = this;
|
||||
const store = new OSS({
|
||||
accessKeyId: info.token.accessKeyId,
|
||||
accessKeySecret: info.token.accessKeySecret,
|
||||
stsToken: info.token.securityToken,
|
||||
bucket: info.bucket,
|
||||
secure: true,
|
||||
endpoint: info.endpoint,
|
||||
refreshSTSToken: async () => {
|
||||
const info = await scope.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Oss/GetOssInfo",
|
||||
});
|
||||
if (info == null) {
|
||||
return {
|
||||
accessKeyId: "",
|
||||
accessKeySecret: "",
|
||||
stsToken: "",
|
||||
secure: true,
|
||||
bucket: "",
|
||||
endpoint: "",
|
||||
};
|
||||
}
|
||||
return {
|
||||
accessKeyId: info.token.accessKeyId,
|
||||
accessKeySecret: info.token.accessKeySecret,
|
||||
stsToken: info.token.securityToken,
|
||||
secure: true,
|
||||
bucket: info.bucket,
|
||||
endpoint: info.endpoint,
|
||||
};
|
||||
},
|
||||
refreshSTSTokenInterval: 300000,
|
||||
});
|
||||
let headers = undefined;
|
||||
if (expiresAt) {
|
||||
headers = {
|
||||
Expires: expiresAt,
|
||||
};
|
||||
}
|
||||
let result = await store.put(objectName, blob, {
|
||||
headers: headers,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
const ossApi = new OssApi();
|
||||
export { ossApi };
|
||||
72
src/api/RoleApi.ts
Normal file
@ -0,0 +1,72 @@
|
||||
import { BaseApi } from "./BaseApi";
|
||||
|
||||
class RoleApi extends BaseApi {
|
||||
public async roleList(pageData: any): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Role/RoleList",
|
||||
data: pageData,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async allRoleList(): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Role/AllRoleList"
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async addOrUpdateRole(
|
||||
role: any,
|
||||
selectMenuIds: string[]
|
||||
): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Role/AddOrUpdateRole",
|
||||
data: {
|
||||
role: role,
|
||||
menuIds: selectMenuIds,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
}
|
||||
public async deleteRole(id: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Role/DeleteRole",
|
||||
data: id,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
public async getRoleMenuIds(id: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Role/RoleMenus",
|
||||
data: id,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async roleById(id: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Role/RoleById",
|
||||
data: id,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async roleListByUserId(userId: string): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/Role/RoleListByUserId",
|
||||
data: userId,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
const roleApi = new RoleApi();
|
||||
export { roleApi };
|
||||
37
src/api/UserApi.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { BaseApi } from "./BaseApi";
|
||||
|
||||
class UserApi extends BaseApi {
|
||||
public async backstageUserList(pageData: any): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/BackstageUser/GetBackstageUserList",
|
||||
data: pageData,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async registerAdminAndRefreshToken(
|
||||
user: any,
|
||||
roleIds: Array<string>
|
||||
): Promise<any> {
|
||||
Object.assign(user, { roleIds: roleIds });
|
||||
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/BackstageUser/RegisterAdminAndRefreshToken",
|
||||
data: user,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
public async bgUserInfoAndMenuList(): Promise<any> {
|
||||
const data = await this.requestRemote({
|
||||
method: "post",
|
||||
url: "api/BackstageUser/GetBgUserInfoAndMenuList"
|
||||
});
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
const userApi = new UserApi();
|
||||
export { userApi };
|
||||
77
src/api/dto/ModelPart.ts
Normal file
@ -0,0 +1,77 @@
|
||||
export class ModelPart {
|
||||
public id: string = "";
|
||||
public modelId: string = "";
|
||||
|
||||
/**
|
||||
* 部件关键字(对应模型部件材质名称,唯一)
|
||||
*/
|
||||
public partKey: string = "";
|
||||
/**
|
||||
* 片材名(显示用)
|
||||
*/
|
||||
public partName: string = "";
|
||||
|
||||
/**
|
||||
* 编辑蒙板图
|
||||
*/
|
||||
public maskImageUrl: string = "";
|
||||
|
||||
public uvx: number = 0;
|
||||
public uvy: number = 0;
|
||||
public uvWidth: number = 0;
|
||||
public uvHeight: number = 0;
|
||||
|
||||
public productImageX: number = 0;
|
||||
public productImageY: number = 0;
|
||||
public productImageWidth: number = 0;
|
||||
public productImageHeight: number = 0;
|
||||
|
||||
public partColor: string = "#FFFFFF";
|
||||
|
||||
/**
|
||||
* 是否可以编辑图片
|
||||
*/
|
||||
public isCanEditPicture: boolean = false;
|
||||
|
||||
/**
|
||||
* 是否可以编辑颜色
|
||||
*/
|
||||
public isCanEditColor: boolean = false;
|
||||
/**
|
||||
* 片裁排序值,越小的在越前面
|
||||
*/
|
||||
public sort: number = 0;
|
||||
|
||||
/**
|
||||
* 选择当前材质后,摄像头的Alpha值
|
||||
*/
|
||||
public alpha: number = 0;
|
||||
/**
|
||||
* 选择当前材质后,摄像头的Beta值
|
||||
*/
|
||||
public beta: number = 0;
|
||||
/**
|
||||
* 选择当前材质后,摄像头的Radius值
|
||||
*/
|
||||
public radius: number = 0;
|
||||
|
||||
/**
|
||||
* 选择当前材质后,摄像头的Alpha值,js number 提交后台会损失精度,字符串提交后台精确值
|
||||
*/
|
||||
public alphaStr: string = "0";
|
||||
/**
|
||||
* 选择当前材质后,摄像头的Beta值,js number 提交后台会损失精度,字符串提交后台精确值
|
||||
*/
|
||||
public betaStr: string = "0";
|
||||
/**
|
||||
* 选择当前材质后,摄像头的Radius值,js number 提交后台会损失精度,字符串提交后台精确值
|
||||
*/
|
||||
public radiusStr: string = "0";
|
||||
|
||||
/**
|
||||
* 蒙板图缩放值
|
||||
*/
|
||||
public maskScale: number = 1;
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
BIN
src/assets/img/Back Arrow Dark.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
src/assets/img/audio-input.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/img/bg.jpg
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
src/assets/img/close.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/img/design/hover-tip.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/img/design/left/T区域.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/img/design/left/颜色.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
src/assets/img/design/right/Beto.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/assets/img/design/right/SVG.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/img/design/right/sub-menu/align-bottom.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
src/assets/img/design/right/sub-menu/align-horizontally.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/assets/img/design/right/sub-menu/align-left.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/img/design/right/sub-menu/align-right.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/img/design/right/sub-menu/align-top.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
src/assets/img/design/right/sub-menu/align-vertically.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/assets/img/design/right/sub-menu/mirror-x.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
src/assets/img/design/right/sub-menu/mirror-y.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
src/assets/img/design/right/sub-menu/rotate-left.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/img/design/right/sub-menu/rotate-right.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/img/design/right/sub-menu/search-zoom-in.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/img/design/right/sub-menu/search-zoom-out.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/img/design/right/元素消除.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/img/design/right/图层.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/img/design/right/对齐.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/img/design/right/导出.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/img/design/right/局部重绘.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/img/design/right/工艺.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/img/design/right/扩图.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/img/design/right/放大缩小.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
src/assets/img/design/right/旋转.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
src/assets/img/design/right/模特上身.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
src/assets/img/design/right/添加图片.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
src/assets/img/design/right/背景去除.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/assets/img/design/right/镜像.png
Normal file
|
After Width: | Height: | Size: 19 KiB |