libushang 5 meses atrás
pai
commit
f1dc071835
3 arquivos alterados com 14 adições e 4 exclusões
  1. 1 0
      auto-imports.d.ts
  2. 9 0
      src/utils/validate.ts
  3. 4 4
      src/views/index.vue

+ 1 - 0
auto-imports.d.ts

@@ -316,6 +316,7 @@ declare module 'vue' {
   interface GlobalComponents {}
   interface ComponentCustomProperties {
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
+    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>

+ 9 - 0
src/utils/validate.ts

@@ -15,3 +15,12 @@ export function validatePhone(phoneNumber: string) {
 export function validateFile(fieList: []) {
   return fieList && fieList.length > 0;
 }
+
+/**
+ * 判断url是否是http或https
+ * @returns {Boolean}
+ * @param url
+ */
+export const isHttp = (url: string): boolean => {
+  return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1;
+};

+ 4 - 4
src/views/index.vue

@@ -34,11 +34,11 @@ onMounted(() => {
   console.log('env:', env);
   // if(env === 'development') 
   {
-    setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiZXhwIjoyMDM5Njk2ODMzfQ.Rhd38oo_S1odjg0xnT4n31cCWCAAPXGb8y_V2XcgqzQ')
+    // setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiZXhwIjoyMDM5Njk2ODMzfQ.Rhd38oo_S1odjg0xnT4n31cCWCAAPXGb8y_V2XcgqzQ')
     nextTick(()=>{
       setTimeout(()=> {
         getUserInfo();
-      }, 1000);
+      }, 100);
     })
   }
 })
@@ -78,12 +78,12 @@ const getUserInfo = () => {
 
 <style lang="scss" scoped>
 .container {
-  padding: 39px 8px 20px;
+  padding: 10px 10px 20px;
   .item {
     background: url("@/assets/images/staffBox.png") no-repeat;
   }
   .item2 {
-    margin-top: 20px;
+    margin-top: 10px;
     background: url("@/assets/images/leaderBox.png") no-repeat;
   }
   .item,