Browse Source

正式bug修改

喻文俊 3 years ago
parent
commit
54210709aa

+ 4 - 4
.env.development

@@ -2,19 +2,19 @@
 EVN = 'development'
 
 # 网站地址
-# LOCALHOSE = 'https://zp-b.caimei365.com'
-LOCALHOSE = 'http://192.168.2.81:8888'
+LOCALHOSE = 'https://zp.caimei365.com'
+# LOCALHOSE = 'http://192.168.2.81:8888'
 # LOCALHOSE = 'http://192.168.1.102:8888'
 
 # 接口api地址
-BASE_URL = 'https://zplma-b.caimei365.com'
+BASE_URL = 'https://zplma.caimei365.com'
 # BASE_URL = 'http://192.168.2.68:8012'
 
 # 静态资源文件地址
 STATIC_URL = 'https://static.caimei365.com/www/authentic'
 
 # 采美网
-CIMEI_LOCAL = 'https://www-b.caimei365.com'
+CIMEI_LOCAL = 'https://www.caimei365.com'
 
 # 项目运行地址
 HOST = '192.168.2.81'

+ 1 - 0
.env.production

@@ -15,6 +15,7 @@ CIMEI_LOCAL = 'https://www.caimei365.com'
 
 # 项目运行地址
 HOST = '172.31.165.23'
+# HOST = '192.168.2.81'
 
 # 项目端口号
 PORT = '8105'

+ 9 - 0
components/LdmLogin/index.vue

@@ -68,6 +68,15 @@ export default {
   },
   methods: {
     async onSubmit() {
+      // 验证手机号是否合法
+      if (!isMobile(this.formData.mobile)) {
+        this.$toast('请输入正确的手机号')
+        return
+      }
+      if (!this.formData.verifyCode) {
+        this.$toast('请输入验证码')
+        return
+      }
       try {
         this.formData.authUserId = this.authUserId
         const res = await this.$http.api.customLogin(this.formData)

+ 9 - 0
components/SimpleLogin/index.vue

@@ -64,6 +64,15 @@ export default {
   },
   methods: {
     async onSubmit() {
+      // 验证手机号是否合法
+      if (!isMobile(this.formData.mobile)) {
+        this.$toast('请输入正确的手机号')
+        return
+      }
+      if (!this.formData.verifyCode) {
+        this.$toast('请输入验证码')
+        return
+      }
       try {
         this.formData.authUserId = this.authUserId
         const res = await this.$http.api.customLogin(this.formData)

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "version": "1.0.0",
   "private": true,
   "scripts": {
-    "dev": "cross-env ENV=development nuxt",
+    "dev": "cross-env ENV=production NODE_ENV=production nuxt",
     "build:dev": "cross-env NODE_ENV=development ENV=development nuxt build",
     "build:stage": "cross-env NODE_ENV=staging ENV=staging nuxt build",
     "build:prod": "cross-env NODE_ENV=production ENV=production nuxt build",

+ 7 - 2
pages/_template/app/approve/club/detail.vue

@@ -20,7 +20,7 @@
           <div class="navigation" @click="onMapNav">导航</div>
           <div
             class="distance"
-            v-if="clubInfo.distance"
+            v-if="clubInfo.distance && clubInfo.distance < 99999"
             v-text="'距你' + clubInfo.distance + 'km'"
           ></div>
         </div>
@@ -77,7 +77,12 @@ export default {
   computed: {
     ...mapGetters(['routePrefix']),
     address() {
-      return this.clubInfo.area + this.clubInfo.address || '未知'
+      return (
+        (this.clubInfo.area &&
+          this.clubInfo.area + this.clubInfo.address &&
+          this.clubInfo.address) ||
+        '未知'
+      )
     },
     isEmpty() {
       return this.clubInfo.productList

+ 1 - 1
pages/_template/app/approve/club/index.vue

@@ -60,7 +60,7 @@
               </div>
             </div>
           </template>
-          <div class="empty" v-for="i in emptyList" :key="i"></div>
+          <div class="empty" v-for="i in emptyList" :key="'empty-' + i"></div>
         </div>
         <!-- 列表为空 -->
         <SimpleEmpty

+ 2 - 0
pages/_template/app/index.vue

@@ -133,6 +133,7 @@ export default {
       width: 120px;
       height: 120px;
       border-radius: 50%;
+      background: #fff;
     }
     .name {
       font-size: 30px;
@@ -193,6 +194,7 @@ export default {
       width: 14.8vw;
       height: 14.8vw;
       border-radius: 50%;
+      background: #fff;
     }
     .name {
       font-size: 4vw;

+ 1 - 0
utils/index.js

@@ -31,6 +31,7 @@ export function drawLogo(text = '', len = 4) {
 // 跳转到授权页面
 export function toAuthorization(appId, payload) {
   const type = payload.routePrefix.split('/')[2]
+  console.log(process.env.LOCALHOSE)
   const url = `${process.env.LOCALHOSE}/auth?authUserId=${payload.authUserId}&type=${type}&appId=${appId}`
   const redirect_uri = encodeURIComponent(url)
   window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`

+ 2 - 2
utils/storage.js

@@ -1,5 +1,5 @@
 import { encrypt, decrypt } from '@/utils/crypto'
-const encryptFlag = process.env.NODE_ENV === 'production'
+const encryptFlag = false
 
 // 将数据添加到缓存中(期限)
 export function setStorage(key, value, options = {}) {
@@ -39,7 +39,7 @@ export function getStorage(key) {
 
   // 解密
   if (encryptFlag) {
-    payload.data = decrypt(payload.data)
+    payload.data = JSON.parse(decrypt(payload.data))
   }
 
   return payload.data