Skip to content

Commit b53bc98

Browse files
committed
changed chinese texts in login page to english
1 parent cd43126 commit b53bc98

File tree

5 files changed

+47
-27
lines changed

5 files changed

+47
-27
lines changed

Vue/src/libs/appconst.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const AppConsts= {
2-
userManagement:{
1+
const AppConsts = {
2+
userManagement: {
33
defaultAdminUserName: 'admin'
44
},
5-
localization:{
6-
defaultLocalizationSourceName: 'AbpVue'
5+
localization: {
6+
defaultLocalizationSourceName: 'AbpProjectName'
77
},
8-
authorization:{
8+
authorization: {
99
encrptedAuthTokenName: 'enc_auth_token'
1010
}
1111
}

Vue/src/libs/util.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import abp from '../abp';
77
let util = {
88

99
};
10+
1011
util.title = function (title) {
1112
title = title || 'iView admin';
1213
window.document.title = title;
@@ -22,17 +23,20 @@ util.ajax = axios.create({
2223
baseURL: ajaxUrl,
2324
timeout: 30000
2425
});
26+
2527
util.ajax.interceptors.request.use(function (config) {
26-
if(!!abp.auth.getToken()){
27-
config.headers.common["Authorization"]="Bearer "+abp.auth.getToken();
28+
if (!!abp.auth.getToken()) {
29+
config.headers.common["Authorization"] = "Bearer " + abp.auth.getToken();
2830
}
29-
config.headers.common[".AspNetCore.Culture"]=abp.utils.getCookieValue("Abp.Localization.CultureName");
30-
config.headers.common["Abp.TenantId"]=abp.multiTenancy.getTenantIdCookie();
31+
32+
config.headers.common[".AspNetCore.Culture"] = abp.utils.getCookieValue("Abp.Localization.CultureName");
33+
config.headers.common["Abp.TenantId"] = abp.multiTenancy.getTenantIdCookie();
3134
return config;
32-
}, function (error) {
33-
35+
}, function (error) {
36+
3437
return Promise.reject(error);
3538
});
39+
3640
util.inOf = function (arr, targetArr) {
3741
let res = true;
3842
arr.forEach(item => {
@@ -63,7 +67,7 @@ util.getRouterObjByName = function (routers, name) {
6367
if (!name || !routers || !routers.length) {
6468
return null;
6569
}
66-
// debugger;
70+
6771
let routerObj = null;
6872
for (let item of routers) {
6973
if (item.name === name) {
@@ -107,6 +111,7 @@ util.setCurrentPath = function (vm, name) {
107111
});
108112
}
109113
});
114+
110115
let currentPathArr = [];
111116
if (name === 'home_index') {
112117
currentPathArr = [
@@ -146,6 +151,7 @@ util.setCurrentPath = function (vm, name) {
146151
return false;
147152
}
148153
})[0];
154+
149155
if (currentPathObj.children.length <= 1 && currentPathObj.name === 'home') {
150156
currentPathArr = [
151157
{
@@ -190,6 +196,7 @@ util.setCurrentPath = function (vm, name) {
190196
];
191197
}
192198
}
199+
193200
vm.$store.commit('setCurrentPath', currentPathArr);
194201

195202
return currentPathArr;
@@ -212,6 +219,7 @@ util.openNewPage = function (vm, name, argu, query) {
212219
}
213220
i++;
214221
}
222+
215223
if (!tagHasOpened) {
216224
let tag = vm.$store.state.app.tagsList.filter((item) => {
217225
if (item.children) {
@@ -220,7 +228,9 @@ util.openNewPage = function (vm, name, argu, query) {
220228
return name === item.name;
221229
}
222230
});
231+
223232
tag = tag[0];
233+
224234
if (tag) {
225235
tag = tag.children ? tag.children[0] : tag;
226236
if (argu) {
@@ -232,13 +242,15 @@ util.openNewPage = function (vm, name, argu, query) {
232242
vm.$store.commit('increateTag', tag);
233243
}
234244
}
245+
235246
vm.$store.commit('setCurrentPageName', name);
236247
};
237248

238249
util.toDefaultPage = function (routers, name, route, next) {
239250
let len = routers.length;
240251
let i = 0;
241252
let notHandle = true;
253+
242254
while (i < len) {
243255
if (routers[i].name === name && routers[i].children && routers[i].redirect === undefined) {
244256
route.replace({
@@ -248,17 +260,18 @@ util.toDefaultPage = function (routers, name, route, next) {
248260
next();
249261
break;
250262
}
263+
251264
i++;
252265
}
266+
253267
if (notHandle) {
254268
next();
255269
}
256270
};
257271

258272
util.fullscreenEvent = function (vm) {
259273
vm.$store.commit('initCachepage');
260-
// 权限菜单过滤相关
261274
vm.$store.commit('updateMenulist');
262-
// 全屏相关
263275
};
276+
264277
export default util;

Vue/src/main.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,29 @@ import AppConsts from './libs/appconst'
1515
util.ajax.get('/AbpUserConfiguration/GetAll').then(result=>{
1616
Vue.use(VueI18n);
1717
Vue.use(iView);
18+
1819
window.abp=$.extend(true,abp,result.data.result);
19-
Vue.prototype.L=function(text,...args){
20-
let localizedText=window.abp.localization.localize(text,AppConsts.localization.defaultLocalizationSourceName);
20+
21+
Vue.prototype.L = function(text,...args){
22+
debugger;
23+
let localizedText = window.abp.localization.localize(text,AppConsts.localization.defaultLocalizationSourceName);
2124
if (!localizedText) {
2225
localizedText=text;
2326
}
27+
2428
if (!args || !args.length) {
2529
return localizedText;
2630
}
31+
2732
args.unshift(localizedText);
2833
return abp.utils.formatString.apply(this, args)
2934
}
35+
3036
Vue.filter('l', function (value) {
3137
if (!value) return ''
3238
return window.abp.localization.localize(value,AppConsts.localization.defaultLocalizationSourceName);
33-
})
39+
});
40+
3441
new Vue({
3542
el: '#app',
3643
router: router,

Vue/src/views/login.vue

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
v-model="modalShow"
5353
@on-ok="changeTenant"
5454
>
55-
<Input :placeholder="'TenancyName'|l" v-model="changedTenancyName"></Input>
56-
<p>{{'LeaveEmptyToSwitchToHost'|l}}</p>
55+
<Input :placeholder="'TenancyName' | l" v-model="changedTenancyName"></Input>
56+
<p>{{'LeaveEmptyToSwitchToHost' | l}}</p>
5757
<div slot="footer">
5858
<Button @click="modalShow=false">{{'Cancel'|l}}</Button>
5959
<Button @click="changeTenant" type="primary">{{'Save'|l}}</Button>
@@ -63,8 +63,10 @@
6363
</template>
6464

6565
<script>
66+
6667
import Cookies from 'js-cookie';
6768
import abp from '../abp'
69+
6870
export default {
6971
data () {
7072
return {
@@ -81,10 +83,10 @@ export default {
8183
},
8284
rules: {
8385
userNameOrEmailAddress: [
84-
{ required: true, message: '账号不能为空', trigger: 'blur' }
86+
{ required: true, message: this.L('ThisFieldIsRequired'), trigger: 'blur' }
8587
],
8688
password: [
87-
{ required: true, message: '密码不能为空', trigger: 'blur' }
89+
{ required: true, message: this.L('ThisFieldIsRequired'), trigger: 'blur' }
8890
]
8991
}
9092
};
@@ -126,7 +128,7 @@ export default {
126128
});
127129
break;
128130
case 3:
129-
let message2=this.L('ThereIsNoTenantDefinedWithName{0}',this.changedTenancyName)
131+
let message2 = this.L('ThereIsNoTenantDefinedWithName{0}',this.changedTenancyName)
130132
this.$Modal.error({
131133
title:'',
132134
content:message2
@@ -141,18 +143,14 @@ export default {
141143
this.$refs.loginForm.validate(async (valid) => {
142144
if (valid) {
143145
this.$Message.loading({
144-
content:'登录中...',
146+
content: this.L('PleaseWait'),
145147
duration:0
146148
})
147149
await this.$store.dispatch({
148150
type:'user/login',
149151
data:this.form
150152
})
151153
location.reload();
152-
// this.$store.commit('setAvator', 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3448484253,3685836170&fm=27&gp=0.jpg');
153-
// this.$router.push({
154-
// name: 'home_index'
155-
// });
156154
}
157155
});
158156
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Localization/SourceFiles/AbpProjectName.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,7 @@
8484
<text name="EditUser">Edit user</text>
8585
<text name="TenantIdIsNotActive{0}">TenantId {0} is not active</text>
8686
<text name="UnknownTenantId{0}">Unknown tenantId {0}</text>
87+
<text name="ThisFieldIsRequired">This field is required</text>
88+
<text name="PleaseWait">Please wait...</text>
8789
</texts>
8890
</localizationDictionary>

0 commit comments

Comments
 (0)