|
|
@@ -28,14 +28,16 @@
|
|
|
<el-input
|
|
|
:value="getToken"
|
|
|
class="flex-item"
|
|
|
+ placeholder="Please click on the right button to refresh the token"
|
|
|
readonly>
|
|
|
<el-button
|
|
|
slot="append"
|
|
|
icon="el-icon-refresh"
|
|
|
:loading="loading.token"
|
|
|
- title="Refresh New Redemption Code"
|
|
|
+ title="Refresh Token"
|
|
|
@click="getConfigTokens"/>
|
|
|
</el-input>
|
|
|
+ <div class="token-tips" v-if="!showToken">Please save your token safe by yourself. It will only be displayed once.</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
prop="remarks"
|
|
|
@@ -103,7 +105,8 @@ export default {
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
},
|
|
|
- showToken: setting.enableOCPIToken
|
|
|
+ showToken: setting.enableOCPIToken,
|
|
|
+ refreshToken: false
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -118,18 +121,20 @@ export default {
|
|
|
this.getConfigAddress();
|
|
|
this.getConfigTokens();
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.refreshToken = false;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
getToken() {
|
|
|
- if (this.showToken) {
|
|
|
+ if (this.showToken || this.refreshToken) {
|
|
|
return this.form.token;
|
|
|
- } else if (this.form.token) {
|
|
|
+ } /*else if (this.form.token) {
|
|
|
const tk1 = this.form.token.substring(0, 6);
|
|
|
const tk2 = this.form.token.substring(this.form.token.length - 5);
|
|
|
return tk1 + "********************" + tk2;
|
|
|
- } else {
|
|
|
+ }*/ else {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
@@ -175,6 +180,7 @@ export default {
|
|
|
ocpi.getSendConfigTokens().then(res => {
|
|
|
this.loading.token = false;
|
|
|
if (res.data) {
|
|
|
+ this.refreshToken = true;
|
|
|
this.form.token = res.data
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
@@ -276,4 +282,11 @@ export default {
|
|
|
max-width: none;
|
|
|
}
|
|
|
}
|
|
|
+.token-tips {
|
|
|
+ color: #000;
|
|
|
+ font-size: 13px;
|
|
|
+ padding-top: 10px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 16px;
|
|
|
+}
|
|
|
</style>
|