修改
This commit is contained in:
11
src/App.vue
11
src/App.vue
@@ -5,8 +5,17 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'App'
|
||||
name: 'App',
|
||||
computed: {
|
||||
...mapGetters(['userRole']),
|
||||
},
|
||||
mounted () {
|
||||
if (this.userRole === 1) {
|
||||
window.JsToAndroid.setHomePackage('com.android.launcher3')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -140,6 +140,11 @@ export default {
|
||||
this.dialogVisible = false
|
||||
this.$i18n.locale = this.dataForm.selectedLanguage
|
||||
window.localStorage.setItem('locale', this.dataForm.selectedLanguage)
|
||||
if (this.dataForm.selectedLanguage === 'en-us') {
|
||||
window.JsToAndroid.switchLanguage('ENGLISH')
|
||||
} else {
|
||||
window.JsToAndroid.switchLanguage('CHINESE')
|
||||
}
|
||||
this.setServerUrl(this.dataForm.serverIp)
|
||||
this.$emit('refreshWebsocket')
|
||||
},
|
||||
@@ -178,11 +183,7 @@ export default {
|
||||
}
|
||||
},
|
||||
initLink () {
|
||||
let link = 'stservice://systech.com:8088/router?data=reboot'
|
||||
const a = document.createElement('a')
|
||||
a.href = link
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.JsToAndroid.reboot()
|
||||
},
|
||||
synchronizedMapConfirm () {
|
||||
this.$confirm(this.$t('Aresuremap'), this.$t('Prompt'), {
|
||||
|
||||
@@ -49,6 +49,7 @@ export default {
|
||||
exitUser () {
|
||||
this.dialogVisible = false
|
||||
this.setUserRole(2)
|
||||
window.JsToAndroid.setHomePackage('com.systech.nuolizhineng')
|
||||
},
|
||||
dataFormSubmit () {
|
||||
this.dialogVisible = false
|
||||
@@ -57,6 +58,7 @@ export default {
|
||||
}
|
||||
if (this.dataForm.password === config.password) {
|
||||
this.setUserRole(1)
|
||||
window.JsToAndroid.setHomePackage('com.android.launcher3')
|
||||
this.$message({
|
||||
message: this.$t('Loginsuccessful'),
|
||||
type: 'success'
|
||||
|
||||
Reference in New Issue
Block a user