Browse Source

commit

master
yyy9608 8 months ago
parent
commit
445564d321
  1. 3
      package.json
  2. 4
      public/index.html
  3. 8
      src/App.vue
  4. BIN
      src/assets/logo-black.png
  5. BIN
      src/assets/logo.png
  6. 354
      src/components/layout.vue
  7. 2
      src/components/myModal.vue
  8. 7
      src/lang/index.js
  9. 150
      src/router/index.js
  10. 6
      src/store/index.js
  11. 1094
      src/views/FileStorage.vue
  12. 543
      src/views/HomeIndex.vue
  13. 56
      src/wallet/metamask.js

3
package.json

@ -4,7 +4,8 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
"build": "vue-cli-service build",
"deploy:prod": "npm run build && scp -r ./dist/* vpsDcminer:/data/wwwroot/netdisk"
},
"dependencies": {
"@antv/l7": "^2.15.5",

4
public/index.html

@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
<meta name="viewport"
content="width=device-width, initial-scale=0.3, minimum-scale=0.3, maximum-scale=1, user-scalable=yes">
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=yes">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Titan Storage</title>
<title>BUZZ Netdisk</title>
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
</head>
<body>

8
src/App.vue

@ -40,6 +40,12 @@ export default {
};
</script>
<style lang="less">
.el-progress-bar {
padding:0px !important;
width:85% !important;
}
.language-color-two {
margin-left: 20px;
font-size: 18px;
@ -545,6 +551,8 @@ input:focus {
}
}
.metacustomClass {
max-width: 95vw;
.el-button--default {
background: #67c23a !important;
color: #fff !important;

BIN
src/assets/logo-black.png

After

Width: 90  |  Height: 64  |  Size: 5.1 KiB

BIN
src/assets/logo.png

After

Width: 150  |  Height: 108  |  Size: 6.8 KiB

354
src/components/layout.vue

@ -1,88 +1,48 @@
<template>
<el-container>
<el-aside width="324px">
<div class="aside">
<div style="margin-left: 30px">
<img
style="width: 226px; height: 34px"
src="../assets/newimages/TTs-logonew.svg"
/>
</div>
<div
style="margin-bottom: 24px; position: relative; z-index: 10"
@click="tabid(1, '/home/dashboard')"
:class="$route.path == '/home/dashboard' ? 'asideColoe' : ''"
>
<img
class="imgMargin-left"
v-if="$route.path == '/home/dashboard'"
src="../assets/storageImg/Dashboard-1.png"
/>
<img
class="imgMargin-left"
v-else
src="../assets/storageImg/Dashboard.png"
/>
{{ $t("仪表盘") }}
</div>
<div
style="margin-bottom: 24px; position: relative; z-index: 10"
@click="tabid(2, '/home/fileStorage')"
:class="$route.path == '/home/fileStorage' ? 'asideColoe' : ''"
>
<img
class="imgMargin-left"
v-if="$route.path == '/home/fileStorage'"
src="../assets/storageImg/Folder-1.png"
/>
<img
class="imgMargin-left"
v-else
src="../assets/storageImg/Folder.png"
/>
{{ $t("文件") }}
</div>
<div
style="margin-bottom: 24px; position: relative; z-index: 10"
@click="tabid(3, '/home/key')"
:class="$route.path == '/home/key' ? 'asideColoe' : ''"
>
<img
class="imgMargin-left"
v-if="$route.path == '/home/key'"
src="../assets/storageImg/Other-1.png"
/>
<img
class="imgMargin-left"
v-else
src="../assets/storageImg/Other.png"
/>
API Keys
</div>
<div
style="margin-bottom: 24px; position: relative; z-index: 10"
@click="tabid(4, '/home/center')"
:class="$route.path == '/home/center' ? 'asideColoe' : ''"
>
<img
class="imgMargin-left"
v-if="$route.path == '/home/center'"
src="../assets/storageImg/Invite Friends-1.png"
/>
<img
class="imgMargin-left"
v-else
src="../assets/storageImg/Invite Friends.png"
/>
{{ $t("个人中心") }}
</div>
<div class="lianjie">
<div class="footer-img">
<img src="../assets/storageImg/img7.png" />
<div>
<el-main style="background: #f6f6f6;max-width:100vw;padding:0">
<div style="max-width:100vw;min-height:100vh"><router-view /></div>
</el-main>
<el-container v-if="false">
<el-aside width="324px">
<div class="aside">
<div style="margin-left: 30px">
<img style="width: 226px; height: 34px" src="../assets/newimages/TTs-logonew.svg" />
</div>
</div>
<!-- <div class="lianjie">
<div style="margin-bottom: 24px; position: relative; z-index: 10" @click="tabid(1, '/home/dashboard')"
:class="$route.path == '/home/dashboard' ? 'asideColoe' : ''">
<img class="imgMargin-left" v-if="$route.path == '/home/dashboard'"
src="../assets/storageImg/Dashboard-1.png" />
<img class="imgMargin-left" v-else src="../assets/storageImg/Dashboard.png" />
{{ $t("仪表盘") }}
</div>
<div style="margin-bottom: 24px; position: relative; z-index: 10" @click="tabid(2, '/home/fileStorage')"
:class="$route.path == '/home/fileStorage' ? 'asideColoe' : ''">
<img class="imgMargin-left" v-if="$route.path == '/home/fileStorage'"
src="../assets/storageImg/Folder-1.png" />
<img class="imgMargin-left" v-else src="../assets/storageImg/Folder.png" />
{{ $t("文件") }}
</div>
<div style="margin-bottom: 24px; position: relative; z-index: 10" @click="tabid(3, '/home/key')"
:class="$route.path == '/home/key' ? 'asideColoe' : ''">
<img class="imgMargin-left" v-if="$route.path == '/home/key'" src="../assets/storageImg/Other-1.png" />
<img class="imgMargin-left" v-else src="../assets/storageImg/Other.png" />
API Keys
</div>
<div style="margin-bottom: 24px; position: relative; z-index: 10" @click="tabid(4, '/home/center')"
:class="$route.path == '/home/center' ? 'asideColoe' : ''">
<img class="imgMargin-left" v-if="$route.path == '/home/center'"
src="../assets/storageImg/Invite Friends-1.png" />
<img class="imgMargin-left" v-else src="../assets/storageImg/Invite Friends.png" />
{{ $t("个人中心") }}
</div>
<div class="lianjie">
<div class="footer-img">
<img src="../assets/storageImg/img7.png" />
</div>
</div>
<!-- <div class="lianjie">
<div class="lianjie-item">
<div class="item" @click="jumplink('https://filecoinproject.slack.com/archives/C03QG9433HA')">
<img style="width:34px;height:32px;" src="../assets/WEB3/slack.svg">
@ -98,35 +58,33 @@
</div>
</div>
</div> -->
</div>
</el-aside>
<el-container>
<el-header>
<div class="el-header-title">
<div>Titan | Storage</div>
<div>
<div class="lianje-new-color">
<div @click="jumplink('https://medium.com/@8355697')">
<img src="../assets/storageImg/Frame 427318627.png" />
</div>
<div @click="jumplink('https://t.me/titannet_dao')">
<img src="../assets/storageImg/Frame 427318628.png" />
</div>
<div @click="jumplink('https://twitter.com/Titannet_dao')">
<img src="../assets/storageImg/Frame 427318629.png" />
</div>
<div
@click="
</div>
</el-aside>
<el-container>
<el-header>
<div class="el-header-title">
<div>Titan | Storage</div>
<div>
<div class="lianje-new-color">
<div @click="jumplink('https://medium.com/@8355697')">
<img src="../assets/storageImg/Frame 427318627.png" />
</div>
<div @click="jumplink('https://t.me/titannet_dao')">
<img src="../assets/storageImg/Frame 427318628.png" />
</div>
<div @click="jumplink('https://twitter.com/Titannet_dao')">
<img src="../assets/storageImg/Frame 427318629.png" />
</div>
<div @click="
jumplink(
'https://filecoinproject.slack.com/archives/C03QG9433HA'
)
"
>
<img src="../assets/storageImg/Frame 427318630.png" />
">
<img src="../assets/storageImg/Frame 427318630.png" />
</div>
<div></div>
</div>
<div></div>
</div>
<!-- <el-dropdown style="margin-right:10px;">
<!-- <el-dropdown style="margin-right:10px;">
<el-button type="success">
简体中文<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
@ -139,69 +97,42 @@
</el-dropdown-menu>
</el-dropdown> -->
<el-dropdown>
<!-- <span v-if="address" class="el-dropdown-link">{{`${address.slice(0, 6)}....${address.slice(address.length - 4,address.length)}` || emailAddress}}</span>
<el-dropdown>
<!-- <span v-if="address" class="el-dropdown-link">{{`${address.slice(0, 6)}....${address.slice(address.length - 4,address.length)}` || emailAddress}}</span>
<span v-else class="el-dropdown-link">{{emailAddress}}</span> -->
<div class="login-el-icon--right">
<img
v-if="loginType == 1"
class="iconImgSize"
src="../assets/storageImg/Frame 427318626.png"
/>
<img
v-if="loginType == 2"
class="iconImgSize"
src="../assets/storageImg/Frame 427318625-1.png"
/>
<img
v-if="loginType == 3"
class="iconImgSize"
src="../assets/storageImg/Frame 427318625.png"
/>
<span
v-if="address.indexOf('@') > -1"
class="el-dropdown-link1"
>{{ address }}</span
>
<span v-else class="el-dropdown-link1">{{
`${address.slice(0, 6)}....${address.slice(
address.length - 4,
address.length
)}` || emailAddress
}}</span>
<i
style="cursor: pointer"
class="el-icon-arrow-down el-icon--right"
></i>
</div>
<div class="login-el-icon--right">
<img v-if="loginType == 1" class="iconImgSize" src="../assets/storageImg/Frame 427318626.png" />
<img v-if="loginType == 2" class="iconImgSize" src="../assets/storageImg/Frame 427318625-1.png" />
<img v-if="loginType == 3" class="iconImgSize" src="../assets/storageImg/Frame 427318625.png" />
<span v-if="address.indexOf('@') > -1" class="el-dropdown-link1">{{ address }}</span>
<span v-else class="el-dropdown-link1">{{
`${address.slice(0, 6)}....${address.slice(
address.length - 4,
address.length
)}` || emailAddress
}}</span>
<i style="cursor: pointer" class="el-icon-arrow-down el-icon--right"></i>
</div>
<el-dropdown-menu slot="dropdown" style="width: 100px">
<el-dropdown-item @click.native="loginout"
>{{ $t("登出") }}
</el-dropdown-item>
<!-- <el-dropdown-item>狮子头</el-dropdown-item>
<el-dropdown-menu slot="dropdown" style="width: 100px">
<el-dropdown-item @click.native="loginout">{{ $t("登出") }}
</el-dropdown-item>
<!-- <el-dropdown-item>狮子头</el-dropdown-item>
<el-dropdown-item>螺蛳粉</el-dropdown-item>
<el-dropdown-item disabled>双皮奶</el-dropdown-item>
<el-dropdown-item divided>蚵仔煎</el-dropdown-item> -->
</el-dropdown-menu>
</el-dropdown>
<!-- <div class="language-color" @click="langToggle(selectLang=='zh'?'en':'zh')">
</el-dropdown-menu>
</el-dropdown>
<!-- <div class="language-color" @click="langToggle(selectLang=='zh'?'en':'zh')">
<span>{{selectLang =='zh'?'English':'简体中文'}}</span>
<img class="language-img" src="../assets/storageImg/Frame.png">
</div> -->
<div
class="language-color-two"
@click="langToggle(selectLang == 'zh' ? 'en' : 'zh')"
>
<span :class="selectLang == 'en' ? 'activelanguage' : ''"
>En</span
>
<span>/</span>
<span :class="selectLang == 'zh' ? 'activelanguage' : ''"
>中文</span
>
</div>
<!-- <div class="language">
<div class="language-color-two" @click="langToggle(selectLang == 'zh' ? 'en' : 'zh')">
<span :class="selectLang == 'en' ? 'activelanguage' : ''">En</span>
<span>/</span>
<span :class="selectLang == 'zh' ? 'activelanguage' : ''">中文</span>
</div>
<!-- <div class="language">
<el-select class="language-color" v-model="selectLang" placeholder="Select" @change="langToggle">
<el-option
v-for="item in options"
@ -212,8 +143,8 @@
</el-select>
</div> -->
</div>
<!-- <div>
</div>
<!-- <div>
<div @click="loginout">登出</div>
<div>
{{
@ -227,18 +158,19 @@
<img src="../assets/images/arrow-down.svg" />
</div>
</div> -->
</div>
</div>
<!-- <div
<!-- <div
style="width: 100%; height: 1px; background: #ddd; opacity: 0.5"
></div> -->
</el-header>
<el-main style="background: #f6f6f6">
<div style="min-width: 1200px"><router-view /></div>
</el-main>
<!-- <el-footer>Footer</el-footer> -->
</el-header>
<el-main style="background: #f6f6f6">
<div style="min-width: 1200px"><router-view /></div>
</el-main>
<!-- <el-footer>Footer</el-footer> -->
</el-container>
</el-container>
</el-container>
</div>
</template>
<script>
@ -265,7 +197,7 @@ export default {
],
};
},
mounted() {},
mounted() { },
props: {
msg: String,
},
@ -303,18 +235,22 @@ export default {
.language-color-two {
margin-left: 20px;
font-size: 18px;
.activelanguage {
color: #06c270 !important;
font-weight: bolder;
}
> span:nth-child(2) {
>span:nth-child(2) {
margin: 0 3px;
}
> span:nth-child(1),
> span:nth-child(3) {
>span:nth-child(1),
>span:nth-child(3) {
cursor: pointer;
}
}
.language-color {
width: 111px;
height: 38px;
@ -327,24 +263,28 @@ export default {
align-items: center;
justify-content: center;
cursor: pointer;
.language-img {
width: 15px !important;
height: 15px !important;
margin-left: 5px;
}
}
.el-dropdown-link1 {
color: #718096 !important;
font-size: 20px !important;
font-weight: 500;
cursor: pointer;
}
.iconImgSize {
width: 28px;
height: 28px;
margin-right: 12px;
vertical-align: middle;
}
.login-el-icon--right {
/deep/ .el-icon--right {
width: 16px !important;
@ -353,26 +293,32 @@ export default {
font-weight: bold;
}
}
.language {
/deep/ .el-select .el-input__inner:focus {
border: none !important;
}
}
.lianjie {
position: absolute;
bottom: 43px;
left: 0;
.footer-img {
> img {
>img {
width: 324px;
height: auto;
}
}
.lianjie-item {
display: flex;
.item2 {
margin: 0 10px;
}
.item {
width: 54px;
height: 54px;
@ -391,48 +337,60 @@ export default {
.el-select .el-input.is-focus .el-input__inner {
border-color: none !important;
}
/deep/ .language-color.el-select .el-input .el-select__caret {
color: #fff !important;
}
.language-color {
margin-left: 10px;
/deep/ .el-input.is-active .el-input__inner,
.el-input__inner:focus {
border: none !important;
}
/deep/ .el-range-editor.is-active,
.el-range-editor.is-active:hover,
.el-select .el-input.is-focus .el-input__inner {
border: none !important;
}
/deep/ .el-select .el-input .el-select__caret {
color: #fff !important;
}
/deep/ .el-input__inner {
background: #67c23a !important;
color: #fff !important;
}
/deep/ .el-range-editor.is-active,
.el-range-editor.is-active:hover,
.el-select .el-input.is-focus .el-input__inner {
border-color: #67c23a !important;
}
/deep/ .el-select-dropdown__item.selected {
color: #67c23a !important;
}
}
.language-color.el-select {
width: 120px;
}
// .el-header {
// height: 81px !important;
// }
.el-main {
padding: 34px 36px 46px 36px !important;
}
.el-header {
padding: 0 !important;
}
// .el-header-title{
// height: 80px;
// background: #FFFFFF;
@ -461,44 +419,55 @@ export default {
box-sizing: border-box;
box-shadow: 2px 2px 8px 0px rgba(82, 90, 102, 0.08),
1px 1px 2px 0px rgba(82, 90, 102, 0.04);
> div:nth-child(1) {
>div:nth-child(1) {
color: rgba(31, 44, 55, 0.8);
font-weight: bold;
font-size: 20px;
}
> div:nth-child(2) {
>div:nth-child(2) {
display: flex;
// margin-right:100px;
align-items: center;
.lianje-new-color {
margin-right: 30px;
display: flex;
align-items: center;
> div:nth-child(5) {
>div:nth-child(5) {
width: 1px;
height: 25px;
background: rgba(17, 193, 109, 0.8);
}
> div {
>div {
cursor: pointer;
}
display: flex;
> div:nth-child(2) {
>div:nth-child(2) {
margin: 0 15px;
}
> div:nth-child(4) {
>div:nth-child(4) {
margin: 0 30px 0 15px;
}
> div {
>div {
display: flex;
align-items: center;
justify-content: center;
> img {
>img {
width: 40px;
height: 40px;
}
}
}
// >div{
// cursor: pointer;
// >img{
@ -509,11 +478,13 @@ export default {
// }
}
}
/deep/ .el-aside {
background: #090c0e;
border-radius: 0px 32px 32px 0px;
color: #666;
}
.aside {
// padding: 103px 20px;
padding-top: 98px;
@ -523,6 +494,7 @@ export default {
height: 100%;
box-sizing: border-box;
color: #adb4aa;
// .aside-img{
// width:24px;
// height:24px;
@ -534,7 +506,8 @@ export default {
color: #000;
color: #fff !important;
}
> div:nth-child(2),
>div:nth-child(2),
:nth-child(3),
:nth-child(4),
:nth-child(5) {
@ -548,6 +521,7 @@ export default {
display: flex;
align-items: center;
border-radius: 30px !important;
.imgMargin-left {
width: 24px;
height: 24px;
@ -555,10 +529,12 @@ export default {
margin-left: 54px;
}
}
> div:nth-child(2) {
>div:nth-child(2) {
margin-top: 60px;
}
> div:nth-child(1) {
>div:nth-child(1) {
cursor: pointer;
// font-size: 24px;
// font-weight: bold;

2
src/components/myModal.vue

@ -25,7 +25,7 @@ export default {
},
width: {
type: Number | String,
default: "50%",
default: "100%",
},
append: {
type: Boolean,

7
src/lang/index.js

@ -19,9 +19,9 @@ const messages = {
}
let lang = '';
try{
lang = JSON.parse(localStorage.getItem('login-info')).lang || 'en';
lang = JSON.parse(localStorage.getItem('login-info')).lang || 'zh';
} catch(err) {
lang = 'en';
lang = 'zh';
}
const i18n = new VueI18n({
messages,
@ -29,4 +29,5 @@ const i18n = new VueI18n({
silentFallbackWarn: true, // 抑制警告
})
ElementLocale.i18n((key, value) => i18n.t(key, value))
export default i18n
export default i18n

150
src/router/index.js

@ -24,46 +24,46 @@ const routes = [
name: 'homeindex',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/HomeIndex.vue')
},
{
path: '/redirect',
name: 'redirect',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/redirect.vue')
},
{
path: '/Upload',
name: 'Upload',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/Upload.vue')
},
{
path: '/newUpload',
name: 'newUpload',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/newUpload.vue')
},
{
path: '/newUploadcopy',
name: 'newUploadcopy',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/newUploadcopy.vue')
},
{
path: '/preview',
name: 'preview',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/preview.vue')
},
{
path: '/storagenetwork',
name: 'storagenetwork',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/storagenetwork.vue')
},
{
path: '/distribution',
name: 'distribution',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/distribution.vue')
},
{
path: '/distributionstatus',
name: 'distributionstatus',
component: () => import(/* webpackChunkName: "homeindex" */ '../views/distributionstatus.vue')
},
// {
// path: '/redirect',
// name: 'redirect',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/redirect.vue')
// },
// {
// path: '/Upload',
// name: 'Upload',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/Upload.vue')
// },
// {
// path: '/newUpload',
// name: 'newUpload',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/newUpload.vue')
// },
// {
// path: '/newUploadcopy',
// name: 'newUploadcopy',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/newUploadcopy.vue')
// },
// {
// path: '/preview',
// name: 'preview',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/preview.vue')
// },
// {
// path: '/storagenetwork',
// name: 'storagenetwork',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/storagenetwork.vue')
// },
// {
// path: '/distribution',
// name: 'distribution',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/distribution.vue')
// },
// {
// path: '/distributionstatus',
// name: 'distributionstatus',
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/distributionstatus.vue')
// },
{
@ -74,25 +74,25 @@ const routes = [
needAuth: true
},
children: [
{
path: 'dashboard',
name: 'dashboard',
meta: {
needAuth: true
},
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/dashboard.vue')
},
{
path: 'upload',
name: 'upload',
meta: {
needAuth: true
},
component: () => import(/* webpackChunkName: "upload" */ '../views/Upload.vue')
},
// {
// path: 'dashboard',
// name: 'dashboard',
// meta: {
// needAuth: true
// },
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// // component: () => import(/* webpackChunkName: "about" */ '../views/dashboard.vue')
// },
// {
// path: 'upload',
// name: 'upload',
// meta: {
// needAuth: true
// },
// component: () => import(/* webpackChunkName: "upload" */ '../views/Upload.vue')
// },
//文件存储
{
path: 'fileStorage',
@ -103,23 +103,23 @@ const routes = [
component: () => import(/* webpackChunkName: "homeindex" */ '../views/FileStorage.vue')
},
// api Key
{
path: 'key',
name: 'key',
meta: {
needAuth: true
},
component: () => import(/* webpackChunkName: "homeindex" */ '../views/Apikey.vue')
},
// {
// path: 'key',
// name: 'key',
// meta: {
// needAuth: true
// },
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/Apikey.vue')
// },
//个人中心
{
path: 'center',
name: 'center',
meta: {
needAuth: true
},
component: () => import(/* webpackChunkName: "homeindex" */ '../views/center.vue')
},
// {
// path: 'center',
// name: 'center',
// meta: {
// needAuth: true
// },
// component: () => import(/* webpackChunkName: "homeindex" */ '../views/center.vue')
// },
]
},
{

6
src/store/index.js

@ -10,7 +10,7 @@ export default new Vuex.Store({
publicKey: "",
token: '',
emailAddress: '',
lang: 'en',
lang: 'zh',
usertoken: '',
loginType: 1, //1:filecoin 2:metamask 3:web2
},
@ -42,7 +42,7 @@ export default new Vuex.Store({
},
setToken(state, params) {
state.token = params;
router.push('/home/dashboard')
router.push('/home/fileStorage')
},
onlyToken(state, params) {
state.token = params;
@ -54,7 +54,7 @@ export default new Vuex.Store({
state.address = params;
await ingredients(params)
if (router.currentRoute.path.indexOf('/home') === -1) {
router.push('/home/dashboard')
router.push('/home/fileStorage')
} else {
window.location.reload()
}

1094
src/views/FileStorage.vue
File diff suppressed because it is too large
View File

543
src/views/HomeIndex.vue
File diff suppressed because it is too large
View File

56
src/wallet/metamask.js

@ -28,35 +28,39 @@ const getSign = (address, callback) => {
}
async function metamask(callback) {
if (!window.ethereum) {
MessageBox.alert(i18n.t('请安装MetaMask钱包后再登录'), {
customClass: 'metacustomClass'
})
callback()
window.location.reload()
return
};
if (window.ethereum.networkVersion != parseInt(chain.chainId)) {
try {
await window.ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: chain.chainId }],
})
getAccount(callback)
} catch (res) {
if (res && res.code == 4902) {
try {
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [chain],
})
getAccount(callback)
} catch (err) {
callback()
}
const chainId = await window.ethereum.request({
method:'eth_chainId'
})
if (parseInt(chainId) != parseInt(chain.chainId)) {
MessageBox.alert('请切换到FIL网络后再登录', {
customClass: 'metacustomClass'
})
// try {
// await window.ethereum.request({
// method: 'wallet_switchEthereumChain',
// params: [{ chainId: chain.chainId }],
// })
// getAccount(callback)
// } catch (res) {
// if (res && res.code == 4902) {
// try {
// await window.ethereum.request({
// method: 'wallet_addEthereumChain',
// params: [chain],
// })
// getAccount(callback)
// } catch (err) {
// callback()
// }
} else {
callback()
}
}
// } else {
// callback()
// }
// }
} else {
getAccount(callback)

Loading…
Cancel
Save