Bytom Wallet for Chrome
Revisão | e6092d5d3765fa5cfc7f123c2e7054ec83fd320a (tree) |
---|---|
Hora | 2021-02-25 15:27:58 |
Autor | j <coffce404@gmai...> |
Commiter | j |
feat: support modify testnet url
@@ -22,7 +22,7 @@ export const camelize = (object) => { | ||
22 | 22 | |
23 | 23 | export const networks = { |
24 | 24 | mainnet:'https://bcapi.movapi.com', |
25 | - testnet:'http://161.189.9.64' | |
25 | + testnet: localStorage.getItem('testnet') || 'http://52.83.11.181' | |
26 | 26 | } |
27 | 27 | |
28 | 28 | export const networksJS = { |
@@ -78,7 +78,7 @@ | ||
78 | 78 | <i class="iconfont icon_arrow_1"></i> |
79 | 79 | </div> |
80 | 80 | </div> |
81 | - <div class="version"> | |
81 | + <div class="version" @click="onVersionClick"> | |
82 | 82 | {{ $t("setting.version") }}[AIV]{version}[/AIV] |
83 | 83 | </div> |
84 | 84 | </div> |
@@ -87,11 +87,13 @@ | ||
87 | 87 | <script> |
88 | 88 | import { mapGetters, mapState } from 'vuex' |
89 | 89 | import {apis} from '@/utils/BrowserApis'; |
90 | +import { log } from 'util'; | |
90 | 91 | |
91 | 92 | export default { |
92 | 93 | name: "", |
93 | 94 | data() { |
94 | 95 | return { |
96 | + versionClickCount: 0 | |
95 | 97 | }; |
96 | 98 | }, |
97 | 99 | computed: { |
@@ -124,6 +126,17 @@ export default { | ||
124 | 126 | ]) |
125 | 127 | }, |
126 | 128 | methods: { |
129 | + onVersionClick () { | |
130 | + this.versionClickCount++ | |
131 | + if (this.versionClickCount > 9) { | |
132 | + this.versionClickCount = 0 | |
133 | + const url = window.prompt('testnet') | |
134 | + if (url) { | |
135 | + this.$toast.success('重新打开插件后生效') | |
136 | + localStorage.setItem('testnet', url) | |
137 | + } | |
138 | + } | |
139 | + } | |
127 | 140 | }, |
128 | 141 | mounted: function () { |
129 | 142 |