init
3
.eslintrc.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: require.resolve('@umijs/max/eslint'),
|
||||||
|
};
|
12
.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/node_modules
|
||||||
|
/.env.local
|
||||||
|
/.umirc.local.ts
|
||||||
|
/config/config.local.ts
|
||||||
|
/src/.umi
|
||||||
|
/src/.umi-production
|
||||||
|
/src/.umi-test
|
||||||
|
/.umi
|
||||||
|
/.umi-production
|
||||||
|
/.umi-test
|
||||||
|
/dist
|
||||||
|
/.mfsu
|
17
.lintstagedrc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"*.{md,json}": [
|
||||||
|
"prettier --cache --write"
|
||||||
|
],
|
||||||
|
"*.{js,jsx}": [
|
||||||
|
"max lint --fix --eslint-only",
|
||||||
|
"prettier --cache --write"
|
||||||
|
],
|
||||||
|
"*.{css,less}": [
|
||||||
|
"max lint --fix --stylelint-only",
|
||||||
|
"prettier --cache --write"
|
||||||
|
],
|
||||||
|
"*.ts?(x)": [
|
||||||
|
"max lint --fix --eslint-only",
|
||||||
|
"prettier --cache --parser=typescript --write"
|
||||||
|
]
|
||||||
|
}
|
8
.prettierrc
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 80,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"proseWrap": "never",
|
||||||
|
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }],
|
||||||
|
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
|
||||||
|
}
|
3
.stylelintrc.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: require.resolve('@umijs/max/stylelint'),
|
||||||
|
};
|
75
.umirc.ts
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
import { defineConfig } from '@umijs/max';
|
||||||
|
// import logo from './src/assets/images/logo.png'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
antd: {},
|
||||||
|
access: {},
|
||||||
|
model: {},
|
||||||
|
initialState: {},
|
||||||
|
request: {},
|
||||||
|
layout: {},
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
redirect: '/home',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '首页',
|
||||||
|
path: '/home',
|
||||||
|
component: './Home',
|
||||||
|
icon: 'HomeOutlined',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ' 基础图层',
|
||||||
|
path: '/baseMap',
|
||||||
|
component: './BaseMap',
|
||||||
|
icon: 'BlockOutlined',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// name: '权限演示',
|
||||||
|
// path: '/access',
|
||||||
|
// component: './Access',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
name: ' CRUD 示例',
|
||||||
|
path: '/table',
|
||||||
|
component: './Table',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ' 登录',
|
||||||
|
path: '/login',
|
||||||
|
component: './Login',
|
||||||
|
// 不展示菜单
|
||||||
|
menuRender: false,
|
||||||
|
// 不展示在菜单栏里
|
||||||
|
hideInMenu: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ' 关于我们',
|
||||||
|
path: '/about',
|
||||||
|
component: './About',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// name: ' 3D',
|
||||||
|
// path: '/three',
|
||||||
|
// component: './three',
|
||||||
|
// // 不展示菜单
|
||||||
|
// menuRender: false,
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
npmClient: 'yarn',
|
||||||
|
headScripts: [
|
||||||
|
`https://webapi.amap.com/maps?v=2.0&key=0aafe5ec0678bcfc99f005cc1c5f2faa`
|
||||||
|
],
|
||||||
|
links: [
|
||||||
|
{ rel: 'icon', href: './src/assets/images/logo.png'},
|
||||||
|
],
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
'target': 'http://101.42.40.202:8081',//8.142.119.212:8083
|
||||||
|
'changeOrigin': true,
|
||||||
|
// 'pathRewrite': { '^/api' : '' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
2
jest-setup.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import '@testing-library/jest-dom';
|
||||||
|
import '@umijs/max/test-setup'
|
27
jest.config.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { Config, configUmiAlias, createConfig } from '@umijs/max/test';
|
||||||
|
|
||||||
|
export default async () => {
|
||||||
|
try{
|
||||||
|
return (await configUmiAlias({
|
||||||
|
...createConfig({
|
||||||
|
target: 'browser',
|
||||||
|
jsTransformer: 'esbuild',
|
||||||
|
// config opts for esbuild , it will pass to esbuild directly
|
||||||
|
jsTransformerOpts: { jsx: 'automatic' },
|
||||||
|
}),
|
||||||
|
|
||||||
|
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'src/**/*.{ts,js,tsx,jsx}',
|
||||||
|
'!src/.umi/**',
|
||||||
|
'!src/.umi-test/**',
|
||||||
|
'!src/.umi-production/**'
|
||||||
|
],
|
||||||
|
// if you require some es-module npm package, please uncomment below line and insert your package name
|
||||||
|
// transformIgnorePatterns: ['node_modules/(?!.*(lodash-es|your-es-pkg-name)/)']
|
||||||
|
})) as Config.InitialOptions;
|
||||||
|
}catch(e){
|
||||||
|
console.log(e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
};
|
20
mock/userAPI.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
const users = [
|
||||||
|
{ id: 0, name: 'Umi', nickName: 'U', gender: 'MALE' },
|
||||||
|
{ id: 1, name: 'Fish', nickName: 'B', gender: 'FEMALE' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
'GET /api/v1/queryUserList': (req: any, res: any) => {
|
||||||
|
res.json({
|
||||||
|
success: true,
|
||||||
|
data: { list: users },
|
||||||
|
errorCode: 0,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'PUT /api/v1/user/': (req: any, res: any) => {
|
||||||
|
res.json({
|
||||||
|
success: true,
|
||||||
|
errorCode: 0,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
16240
package-lock.json
generated
Normal file
52
package.json
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"author": "licuizhu <1065490369@qq.com>",
|
||||||
|
"scripts": {
|
||||||
|
"build": "max build",
|
||||||
|
"dev": "max dev",
|
||||||
|
"format": "prettier --cache --write .",
|
||||||
|
"postinstall": "max setup",
|
||||||
|
"prepare": "husky install",
|
||||||
|
"setup": "max setup",
|
||||||
|
"start": "npm run dev",
|
||||||
|
"test": "TS_NODE_TRANSPILE_ONLY=yes jest --passWithNoTests"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@ant-design/icons": "^4.7.0",
|
||||||
|
"@ant-design/pro-components": "^2.0.1",
|
||||||
|
"@antv/l7": "^2.12.0",
|
||||||
|
"@antv/l7-maps": "^2.12.0",
|
||||||
|
"@umijs/max": "^4.0.40",
|
||||||
|
"antd": "^5.0.0",
|
||||||
|
"axios": "^1.3.5",
|
||||||
|
"dat.gui": "^0.7.9",
|
||||||
|
"gsap": "^3.11.5",
|
||||||
|
"mobx": "^6.9.0",
|
||||||
|
"mobx-react-lite": "^3.4.3",
|
||||||
|
"three": "^0.152.2",
|
||||||
|
"uuid": "^9.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@testing-library/jest-dom": "^5.16.4",
|
||||||
|
"@testing-library/react": "^13",
|
||||||
|
"@types/jest": "^27",
|
||||||
|
"@types/react": "^18.0.0",
|
||||||
|
"@types/react-dom": "^18.0.0",
|
||||||
|
"@types/testing-library__jest-dom": "^5.14.5",
|
||||||
|
"husky": "^8.0.3",
|
||||||
|
"jest": "^27",
|
||||||
|
"lint-staged": "^13.0.3",
|
||||||
|
"prettier": "^2.7.1",
|
||||||
|
"prettier-plugin-organize-imports": "^2",
|
||||||
|
"prettier-plugin-packagejson": "^2",
|
||||||
|
"ts-node": "^10",
|
||||||
|
"typescript": "^4"
|
||||||
|
},
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "npm run lint:css && npm run lint:js && npm run lint:ts",
|
||||||
|
"post-merge": "post-npm-install",
|
||||||
|
"post-rebase": "post-npm-install"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
10
src/access.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
export default (initialState: API.UserInfo) => {
|
||||||
|
// 在这里按照初始化数据定义项目中的权限,统一管理
|
||||||
|
// 参考文档 https://next.umijs.org/docs/max/access
|
||||||
|
const canSeeAdmin = !!(
|
||||||
|
initialState && initialState.name !== 'dontHaveAccess'
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
canSeeAdmin,
|
||||||
|
};
|
||||||
|
};
|
25
src/api/index.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
|
// 密码登录
|
||||||
|
export function passwordLogin( params ) {
|
||||||
|
return request('/api/user/login', {
|
||||||
|
method: 'GET',
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取导航栏
|
||||||
|
export function queryUserMenu() {
|
||||||
|
return request('/api/user/queryUserMenu', {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 基本图层
|
||||||
|
// 获取图层明细点位数据/热力图数据
|
||||||
|
export function getLayerPoints( params ) {
|
||||||
|
return request('/api/basicMap/getLayerPoints', {
|
||||||
|
method: 'GET',
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
20
src/app.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// 运行时配置
|
||||||
|
|
||||||
|
// 全局初始化数据配置,用于 Layout 用户信息和权限初始化
|
||||||
|
// 更多信息见文档:https://next.umijs.org/docs/api/runtime-config#getinitialstate
|
||||||
|
export async function getInitialState(): Promise<{ name: string }> {
|
||||||
|
return {
|
||||||
|
name: 'logout',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
import logo from './assets/images/logo.png'
|
||||||
|
export const layout = () => {
|
||||||
|
return {
|
||||||
|
logo: logo,
|
||||||
|
title: '班布地图',
|
||||||
|
menu: {
|
||||||
|
locale: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
0
src/assets/.gitkeep
Normal file
BIN
src/assets/icon/arrow_down.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
src/assets/icon/arrow_down_big.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/icon/arrow_right.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
src/assets/icon/arrow_right_big.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/icon/base_map.png
Normal file
After Width: | Height: | Size: 848 B |
BIN
src/assets/icon/base_map_big.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
src/assets/icon/close_nav.png
Normal file
After Width: | Height: | Size: 679 B |
BIN
src/assets/icon/close_nav_big.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/icon/delete.png
Normal file
After Width: | Height: | Size: 510 B |
BIN
src/assets/icon/delete_big.png
Normal file
After Width: | Height: | Size: 1011 B |
BIN
src/assets/icon/eye_hide.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/icon/eye_hide_big.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
src/assets/icon/eye_show.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/icon/eye_show_big.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
src/assets/icon/flag.png
Normal file
After Width: | Height: | Size: 837 B |
BIN
src/assets/icon/flag_big.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
src/assets/icon/home.png
Normal file
After Width: | Height: | Size: 785 B |
BIN
src/assets/icon/home_big.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
src/assets/icon/logout.png
Normal file
After Width: | Height: | Size: 650 B |
BIN
src/assets/icon/logout_big.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/assets/icon/open_nav.png
Normal file
After Width: | Height: | Size: 687 B |
BIN
src/assets/icon/open_nav_big.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/icon/position_icon1.png
Normal file
After Width: | Height: | Size: 829 B |
BIN
src/assets/icon/position_icon1_big.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
src/assets/icon/position_icon2.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
src/assets/icon/position_icon2_big.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
src/assets/icon/position_icon3.png
Normal file
After Width: | Height: | Size: 779 B |
BIN
src/assets/icon/position_icon3_big.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/assets/icon/question.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/assets/icon/question_big.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
src/assets/icon/triangle_down.png
Normal file
After Width: | Height: | Size: 388 B |
BIN
src/assets/icon/triangle_down_big.png
Normal file
After Width: | Height: | Size: 830 B |
BIN
src/assets/images/bg_login.png
Normal file
After Width: | Height: | Size: 5.6 MiB |
BIN
src/assets/images/bm.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
src/assets/images/faviconbig.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
src/assets/images/homepage.jpeg
Normal file
After Width: | Height: | Size: 240 KiB |
BIN
src/assets/images/logo.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/images/logo_2.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
src/assets/images/nav-bg.png
Normal file
After Width: | Height: | Size: 163 KiB |
BIN
src/assets/images/rectangle.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
src/assets/images/rectangle1.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/images/upload_file.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
src/assets/images/upload_file_big.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/images/upload_file_white.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
src/assets/images/upload_file_white_big.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/three/1fbx.fbx
Normal file
BIN
src/assets/three/LE_Poliform_Sideboard_Pandora.FBX
Normal file
BIN
src/assets/three/Sun System/Sun System.FBX
Normal file
BIN
src/assets/three/Sun System/Sun System.max
Normal file
BIN
src/assets/three/Sun System/tietu/4kjupiter.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
src/assets/three/Sun System/tietu/DDS/1_earth_16k.DDS
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/4kjupiter.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/Mars_2k-050104.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/Neptune.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/StarsMap_2500x1250.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/Uranus.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/line.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/mercurymap.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/saturnringcolor.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/sun4_rgb_cyl_www.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/th_saturn.dds
Normal file
BIN
src/assets/three/Sun System/tietu/DDS/venus4_rgb_cyl_www.dds
Normal file
BIN
src/assets/three/Sun System/tietu/Mars_2k-050104.png
Normal file
After Width: | Height: | Size: 2.5 MiB |
BIN
src/assets/three/Sun System/tietu/StarsMap_2500x1250.jpg
Normal file
After Width: | Height: | Size: 565 KiB |
BIN
src/assets/three/Sun System/tietu/mercurymap.jpg
Normal file
After Width: | Height: | Size: 279 KiB |
BIN
src/assets/three/Sun System/tietu/saturnringcolor.jpg
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
src/assets/three/Sun System/tietu/saturnringpattern.gif
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/assets/three/Sun System/tietu/sun4_rgb_cyl_www.jpg
Normal file
After Width: | Height: | Size: 8.0 MiB |
BIN
src/assets/three/Sun System/tietu/venus4_rgb_cyl_www.jpg
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
src/assets/three/boxMet.jpg
Normal file
After Width: | Height: | Size: 976 KiB |
11
src/assets/three/need_some_space/license.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Model Information:
|
||||||
|
* title: Need some space?
|
||||||
|
* source: https://sketchfab.com/3d-models/need-some-space-d6521362b37b48e3a82bce4911409303
|
||||||
|
* author: Loïc Norgeot (https://sketchfab.com/norgeotloic)
|
||||||
|
|
||||||
|
Model License:
|
||||||
|
* license type: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
|
||||||
|
* requirements: Author must be credited. Commercial use is allowed.
|
||||||
|
|
||||||
|
If you use this 3D model in your project be sure to copy paste this credit wherever you share it:
|
||||||
|
This work is based on "Need some space?" (https://sketchfab.com/3d-models/need-some-space-d6521362b37b48e3a82bce4911409303) by Loïc Norgeot (https://sketchfab.com/norgeotloic) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
|
BIN
src/assets/three/need_some_space/scene.bin
Normal file
146
src/assets/three/need_some_space/scene.gltf
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
{
|
||||||
|
"accessors": [
|
||||||
|
{
|
||||||
|
"bufferView": 0,
|
||||||
|
"componentType": 5126,
|
||||||
|
"count": 50000,
|
||||||
|
"max": [
|
||||||
|
288.8330078125,
|
||||||
|
313.2330017089844,
|
||||||
|
225.4040069580078
|
||||||
|
],
|
||||||
|
"min": [
|
||||||
|
-58.488800048828125,
|
||||||
|
-81.83899688720703,
|
||||||
|
-15.739500045776367
|
||||||
|
],
|
||||||
|
"type": "VEC3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bufferView": 1,
|
||||||
|
"componentType": 5126,
|
||||||
|
"count": 50000,
|
||||||
|
"max": [
|
||||||
|
1.0,
|
||||||
|
1.0,
|
||||||
|
1.0,
|
||||||
|
1.0
|
||||||
|
],
|
||||||
|
"min": [
|
||||||
|
0.6745098233222961,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
1.0
|
||||||
|
],
|
||||||
|
"type": "VEC4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"asset": {
|
||||||
|
"extras": {
|
||||||
|
"author": "Loïc Norgeot (https://sketchfab.com/norgeotloic)",
|
||||||
|
"license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)",
|
||||||
|
"source": "https://sketchfab.com/3d-models/need-some-space-d6521362b37b48e3a82bce4911409303",
|
||||||
|
"title": "Need some space?"
|
||||||
|
},
|
||||||
|
"generator": "Sketchfab-12.63.0",
|
||||||
|
"version": "2.0"
|
||||||
|
},
|
||||||
|
"bufferViews": [
|
||||||
|
{
|
||||||
|
"buffer": 0,
|
||||||
|
"byteLength": 600000,
|
||||||
|
"byteStride": 12,
|
||||||
|
"name": "floatBufferViews",
|
||||||
|
"target": 34962
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"buffer": 0,
|
||||||
|
"byteLength": 800000,
|
||||||
|
"byteOffset": 600000,
|
||||||
|
"byteStride": 16,
|
||||||
|
"name": "floatBufferViews",
|
||||||
|
"target": 34962
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buffers": [
|
||||||
|
{
|
||||||
|
"byteLength": 1400000,
|
||||||
|
"uri": "scene.bin"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extensionsUsed": [
|
||||||
|
"KHR_materials_unlit"
|
||||||
|
],
|
||||||
|
"materials": [
|
||||||
|
{
|
||||||
|
"doubleSided": true,
|
||||||
|
"extensions": {
|
||||||
|
"KHR_materials_unlit": {}
|
||||||
|
},
|
||||||
|
"name": "Scene_-_Root",
|
||||||
|
"pbrMetallicRoughness": {
|
||||||
|
"metallicFactor": 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"meshes": [
|
||||||
|
{
|
||||||
|
"name": "Object_0",
|
||||||
|
"primitives": [
|
||||||
|
{
|
||||||
|
"attributes": {
|
||||||
|
"COLOR_0": 1,
|
||||||
|
"POSITION": 0
|
||||||
|
},
|
||||||
|
"material": 0,
|
||||||
|
"mode": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"matrix": [
|
||||||
|
0.012779689393937588,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
2.8376610825414845e-18,
|
||||||
|
-0.012779689393937588,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.012779689393937588,
|
||||||
|
2.8376610825414845e-18,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
1.0
|
||||||
|
],
|
||||||
|
"name": "Sketchfab_model"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"name": "Geode"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mesh": 0,
|
||||||
|
"name": "Object_2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scene": 0,
|
||||||
|
"scenes": [
|
||||||
|
{
|
||||||
|
"name": "Sketchfab_Scene",
|
||||||
|
"nodes": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
src/assets/three/sofa/13151.jpg
Normal file
After Width: | Height: | Size: 240 KiB |
BIN
src/assets/three/sofa/38d4d5ebd2e9.jpg
Normal file
After Width: | Height: | Size: 13 MiB |
BIN
src/assets/three/sofa/3e470486133943.5d90c478ced28.png
Normal file
After Width: | Height: | Size: 889 KiB |
BIN
src/assets/three/sofa/6b6963b29938.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
src/assets/three/sofa/ae8ff62094e9.jpg
Normal file
After Width: | Height: | Size: 13 MiB |
BIN
src/assets/three/sofa/c3b2fdf4355b.jpg
Normal file
After Width: | Height: | Size: 772 KiB |
BIN
src/assets/three/sofa/d0e888b757c8.png
Normal file
After Width: | Height: | Size: 2.7 MiB |
After Width: | Height: | Size: 1.4 MiB |
BIN
src/assets/three/sofa/teddi fbx.FBX
Normal file
BIN
src/assets/three/toryWhite.jpg
Normal file
After Width: | Height: | Size: 174 KiB |
19
src/components/AuthRoute/index.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// 判断本地是否有token,如果有,就返回子组件,否则就重定向到登录Login
|
||||||
|
import { getToken } from "../../utils";
|
||||||
|
import { Navigate } from "react-router-dom";
|
||||||
|
|
||||||
|
function AuthRouter ({ children }) {
|
||||||
|
const isToken = getToken();
|
||||||
|
if (isToken) {
|
||||||
|
return <>{ children }</>
|
||||||
|
} else {
|
||||||
|
return <Navigate to="/login" replace/>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
AuthRouter
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用
|
||||||
|
// <AuthRouter> <Layout/> </AuthRouter>
|