Browse Source

环境配置,中英文

asd26269546 1 year ago
parent
commit
ccdbf29baf
13 changed files with 85 additions and 891 deletions
  1. 11 0
      .env.development
  2. 4 4
      .env.prod
  3. 12 0
      .env.prodSmt
  4. 12 0
      .env.smt
  5. 4 4
      .env.staging
  6. 6 3
      package.json
  7. 2 1
      src/lang/cn.js
  8. 19 863
      src/lang/en.js
  9. 3 3
      src/lang/index.js
  10. 1 3
      src/utils/axios.js
  11. 1 1
      src/views/home/index.vue
  12. 9 8
      src/views/login.vue
  13. 1 1
      src/views/message/index.vue

+ 11 - 0
.env.development

@@ -0,0 +1,11 @@
+# 页面标题
+VUE_APP_TITLE = ByteSailing
+
+# 开发环境
+VUE_APP_ENV = 'development'
+
+# 若依管理系统/生产环境
+VUE_APP_BASE_API = '/test-api'
+
+# 是否在打包时开启压缩,支持 gzip 和 brotli
+VUE_APP_COMPRESS = gzip

+ 4 - 4
.env.prod

@@ -1,11 +1,11 @@
 # 页面标题
-VITE_APP_TITLE = ByteSailing
+VUE_APP_TITLE = ByteSailing
 
 # 生产环境配置
-VITE_APP_ENV = 'production'
+VUE_APP_ENV = 'production'
 
 # 若依管理系统/生产环境
-VITE_APP_BASE_API = '/prod-api'
+VUE_APP_BASE_API = '/prod-api'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
-VITE_BUILD_COMPRESS = gzip
+VUE_APP_COMPRESS = gzip

+ 12 - 0
.env.prodSmt

@@ -0,0 +1,12 @@
+# 页面标题
+VUE_APP_TITLE = ByteSailing
+
+# 生产环境配置
+VUE_APP_ENV = 'prodSmt'
+
+# 若依管理系统/生产环境
+VUE_APP_BASE_API = '/prod-api'
+
+# 是否在打包时开启压缩,支持 gzip 和 brotli
+VUE_APP_COMPRESS = gzip
+

+ 12 - 0
.env.smt

@@ -0,0 +1,12 @@
+# 页面标题
+VUE_APP_TITLE = ByteSailing
+
+# 生产环境配置
+VUE_APP_ENV = 'devSmt'
+
+# 若依管理系统/生产环境
+VUE_APP_BASE_API = '/test-api'
+
+# 是否在打包时开启压缩,支持 gzip 和 brotli
+VUE_APP_COMPRESS = gzip
+

+ 4 - 4
.env.staging

@@ -1,11 +1,11 @@
 # 页面标题
-VITE_APP_TITLE = ByteSailing
+VUE_APP_TITLE = ByteSailing
 
 # 生产环境配置
-VITE_APP_ENV = 'staging'
+VUE_APP_ENV = 'staging'
 
 # 若依管理系统/生产环境
-VITE_APP_BASE_API = '/test-api'
+VUE_APP_BASE_API = '/test-api'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
-VITE_BUILD_COMPRESS = gzip
+VUE_APP_COMPRESS = gzip

+ 6 - 3
package.json

@@ -3,11 +3,14 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build",
+    "serve": "vue-cli-service serve  --mode development",
+    "build": "vue-cli-service build --mode staging",
     "build:prod": "vue-cli-service build --mode prod",
     "build:staging": "vue-cli-service build --mode staging",
-    "dev": "vue-cli-service serve"
+    "dev": "vue-cli-service serve --mode development",
+    "dev:smt": "vue-cli-service serve --mode smt",
+    "build:prodSmt": "vue-cli-service build --mode prodSmt",
+    "build:stagingSmt": "vue-cli-service build --mode smt"
   },
   "dependencies": {
     "@zxing/library": "^0.20.0",

+ 2 - 1
src/lang/cn.js

@@ -41,7 +41,7 @@ export const lang = {
 		productDetails:"产品明细",
 		equipmentParameters:"设备参数",
 		model:"型号",
-
+		fileUpload:"文件上传",
 	},
 	email:{
 		//收件箱,写邮件,搜索,邮箱,所有收件箱,账户,请选择邮箱,联系人,客户,收件箱,未读邮件,草稿箱,已发送,已删除,垃圾邮箱,发件人,收件人,时间,附件,下载,
@@ -882,6 +882,7 @@ export const lang = {
 			
 		},
 		loginText:'登录',
+		rememberPassword:'记住密码',
 		demo:"demo",
 		agreement:{
 			text:"已阅读并同意:Bytesailing",

File diff suppressed because it is too large
+ 19 - 863
src/lang/en.js


+ 3 - 3
src/lang/index.js

@@ -15,11 +15,11 @@ const i18n = createI18n({
     'en-us': require('./en.js').lang,
   }
 })
-console.log(require('./cn.js').lang)
-get('/open/multilingual/getJson',{}).then(res=>{
+console.log(require('./en.js').lang)
+//get('/open/multilingual/getJson',{}).then(res=>{
   // console.log(JSON.parse(res.data),'下载')
   // window.localStorage.setItem('lang',res.data)
   // i18n.global.setLocaleMessage('zh-cn', require('./cn.js').lang)
-})
+//})
 
 export default i18n

+ 1 - 3
src/utils/axios.js

@@ -13,9 +13,7 @@ import 'vant/lib/index.css'
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
 const service = axios.create({
-  // axios中请求配置有baseURL选项,表示请求URL公共部分
-  //baseURL: 'test-api',
-  baseURL: 'prod-api',
+  baseURL: process.env.VUE_APP_BASE_API,
   // 超时
   timeout: 10000
 })

+ 1 - 1
src/views/home/index.vue

@@ -84,7 +84,7 @@ const logout = () => {
 		proxy.get('logout').then((res) => {
             if (res.code == 200) {
                 showSuccessToast(proxy.t('userCenter.logOutSuccess'),)
-				localStorage.clear()
+				//localStorage.clear()
                 //清除路由历史记录
                 proxy.$router.replace('/?id=$CORPID$')
             } else {

+ 9 - 8
src/views/login.vue

@@ -9,30 +9,30 @@
 				v-model="loginForm.tenantId"
 				name=""
 				label=""
-				placeholder="请输入租户ID"
-				:rules="[{ required: true, message: '请填写租户id' }]"
+				:placeholder="$t('login.form.tenantId')"
+				:rules="[{ required: true, message: $t('login.form.tenantId') }]"
 			/>
 			<van-field
 				v-model="loginForm.username"
 				name=""
 				label=""
-				placeholder="请输入账号"
-				:rules="[{ required: true, message: '请填写用户名' }]"
+				:placeholder="$t('login.form.username')"
+				:rules="[{ required: true, message: $t('login.form.username') }]"
 			/>
 			<van-field
 				v-model="loginForm.password"
 				type="password"
 				name=""
 				label=""
-				placeholder="请输入密码"
-				:rules="[{ required: true, message: '请填写密码' }]"
+				:placeholder="$t('login.form.password')"
+				:rules="[{ required: true, message: $t('login.form.password') }]"
 			/>
 
 			<van-form @submit="onSubmit">
 				<van-cell-group inset> </van-cell-group>
 				<div style="margin: 16px">
 					<van-button round block type="primary" native-type="submit">
-						提交
+						{{$t('common.submit')}}
 					</van-button>
 				</div>
 				<div
@@ -45,7 +45,7 @@
 							v-model="rememberMe"
 						></van-checkbox>
 					</div>
-					记住密码
+					{{$t('login.rememberPassword')}}
 				</div>
 			</van-form>
 		</div>
@@ -187,6 +187,7 @@ const getInfo = () => {
 		}
 	})
 }
+console.log(process.env)
 onMounted(() => {
 	let username = window.localStorage.getItem('username')
 	let password = window.localStorage.getItem('password')

+ 1 - 1
src/views/message/index.vue

@@ -59,7 +59,7 @@
                 </div>
                 <div class="text-center">
                     <div class="title">{{$t('message.privateLetter')}}</div>
-                    <div class="content">asdlojaskldajsdlakj</div>
+                    <div class="content">asdlojasklasds案发生的阿萨德爱上dajsdlakj阿萨德阿萨德阿萨德啊啥的啊撒 啊 啊啊</div>
                 </div>
                 <div class="text-right">
                     <div class="time-or-num">

Some files were not shown because too many files changed in this diff