Parcourir la source

Merge branch 'master' of https://git.cocorobo.cn/jack/EvenManage

zengyicheng il y a 2 ans
Parent
commit
18a0b6ad62
3 fichiers modifiés avec 424 ajouts et 458 suppressions
  1. 53 64
      src/App.vue
  2. 368 391
      src/components/login.vue
  3. 3 3
      src/router/index.js

+ 53 - 64
src/App.vue

@@ -7,36 +7,51 @@
         $route.path == '/note' ||
         $route.path == '/works',
       appNoHeight: $route.path == '/liveRoom',
-      GMBg:this.$route.query.org=='eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217' && ( $route.path != '/courseGM' &&  $route.path != '/course/addCourseGM'&&  $route.path != '/dataGM')
+      GMBg:
+        this.$route.query.org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217' &&
+        $route.path != '/courseGM' &&
+        $route.path != '/course/addCourseGM' &&
+        $route.path != '/dataGM',
     }"
   >
-    <!-- <div class="app_head" :class="{stuWidth:$route.path == '/student'}"> -->
-    <!-- <div class="logo" @click="goTo('/course')"></div>
-      <span style="margin-left: 10px; color: #fff; font-weight: 600" @click="goTo('/course')"
-        >PBL项目管理平台</span
+    <div
+      class="app_head"
+      v-if="
+        $route.path != '/eventCenter' &&
+        $route.path != '/addRace' &&
+        $route.path != '/anliDetail'
+      "
+    >
+      <div class="logo" @click="goTo('/course')"></div>
+      <span
+        style="margin-left: 10px; color: #fff; font-weight: 600"
+        @click="goTo('/course')"
+        >广东省案例征集</span
       >
       <div class="user_head" v-if="this.$store.state.isLogin">
-        <div class="noticeBox">
+        <!-- <div class="noticeBox">
           <i class="noticeI" @click="goTo('/works')"></i>
           <span v-if="this.$store.state.nCount != 0">{{
             this.$store.state.nCount > 99 ? "99+" : this.$store.state.nCount
           }}</span>
-        </div>
+        </div> -->
         <span class="user_name">{{
           this.$store.state.userInfo ? this.$store.state.userInfo.name : "用户"
         }}</span>
         <div @click="exit">
           <i class="exitI"></i>
-          <el-button type="text" style="color: white" 
-            >退出</el-button
-          >
+          <el-button type="text" style="color: white">退出</el-button>
         </div>
-    </div>-->
-    <!-- </div> -->
+      </div>
+    </div>
     <div
-      :class="{ gHeight: $route.path == '/Grid' }"
       style="width: 100%; height: 100%"
-      :style="{ overflow: $route.path == '/liveRoom' ? 'hidden' : '' }"
+      :class="{
+        ggheight:
+          $route.path != '/eventCenter' &&
+          $route.path != '/addRace' &&
+          $route.path != '/anliDetail',
+      }"
     >
       <!-- main 内容 -->
       <keep-alive v-if="$route.meta.keepAlive">
@@ -69,35 +84,7 @@ export default {
   data() {
     return {
       isShowNav: true, // 是否显示导航 Tab
-      navTabs: [
-        "/class",
-        "/course",
-        "/courseGM",
-        "/data",
-        "/dataGM",
-        "/notice",
-        "/student",
-        "/works",
-        "/worksGM",
-        "/worksDetail",
-        "/course/courseDetail",
-        "/library",
-        "/libraryGM",
-        "/classRoom",
-        "/liveRoom",
-        "/addPPt",
-        "/studyLibrary",
-        "/GridList",
-        "/wordList",
-        "/Ttype",
-        "/banner",
-        // "/eventCenter",
-        // "/addRace",
-        // "/anliDetail",
-        // "/course/addCourse",
-        // "/ask",
-        // "/ask/askList",
-      ], // 导航
+      navTabs: [], // 导航
     };
   },
   // components: {
@@ -118,26 +105,22 @@ export default {
       });
       var _isLogin = this.$cookies.get("tlogin");
       var userInfo = this.$cookies.get("teacherInfo");
-      // if (_isLogin == "1" && userInfo) {
-      loading.close();
-      this.$store.commit("update", ["isLogin", true]);
-      // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
-      this.$store.commit("update", ["userInfo", userInfo]);
-      let router_path = this.$route.path;
-      if (router_path == "/") {
-        this.$router.push("/course");
+      if (_isLogin == "1" && userInfo) {
+        loading.close();
+        this.$store.commit("update", ["isLogin", true]);
+        // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
+        this.$store.commit("update", ["userInfo", userInfo]);
+      } else {
+        this.$store.commit("update", ["isLogin", false]);
+        Message({
+          message: "未登录,请登录",
+          type: "warning",
+        });
+        setTimeout(() => {
+          loading.close();
+          this.$router.push("/login");
+        }, 2000);
       }
-      // } else {
-      //   this.$store.commit("update", ["isLogin", false]);
-      //   Message({
-      //     message: "未登录,请登录",
-      //     type: "warning",
-      //   });
-      //   setTimeout(() => {
-      //     loading.close();
-      //     this.$router.push("/login");
-      //   }, 2000);
-      // }
     },
     getnCount() {
       let params = {
@@ -266,6 +249,11 @@ body {
   border-radius: 5px;
   /* position: absolute; */
 }
+
+.ggheight {
+  height: calc(100% - 67.5px) !important;
+}
+
 .pb_head {
   font-size: 26px;
   /* font-weight: 600; */
@@ -372,12 +360,13 @@ html::-webkit-scrollbar-thumb {
   border-color: #8681b7 !important;
 }
 
-.btnClassGM:focus, .btnClassGM:hover{
+.btnClassGM:focus,
+.btnClassGM:hover {
   background: #8681b7 !important;
   border-color: #8681b7 !important;
 }
 
-.GMBg{
+.GMBg {
   background: rgb(184, 181, 202) !important;
 }
 

+ 368 - 391
src/components/login.vue

@@ -1,62 +1,49 @@
 <template>
-	<div class="login_content">
-		<!-- <el-button type="primary" @click="login()">登录</el-button> -->
-		<div class="login_box" v-show="islogin">
-			<div style="padding: 0px 20px">
-				<div class="login_title">
-					<span>PBL项目式平台</span>
-				</div>
-				<!-- <div class="userLogin">
-          <img src="../assets/username.png" />
-          <el-input v-model="phoneNum" placeholder="手机号码"></el-input>
+  <div class="login_content">
+    <div class="login_box" v-show="islogin">
+      <div style="padding: 0px 20px">
+        <div class="login_title">
+          <span>广东省案例征集</span>
         </div>
-        <div class="userLogin">
-          <img src="../assets/password.png" />
-          <el-input
-            v-model="password"
-            placeholder="密码"
-            type="password"
-          ></el-input>
-        </div> -->
-				<el-form
-					label-position="right"
-					label-width="80px"
-					style="margin-top: 30px"
-				>
-					<el-form-item label="手机号码">
-						<el-input
-							v-model="phoneNum"
-							auto-complete="off"
-							placeholder="请输入手机号码"
-							style="width: 100%"
-							@keyup.enter.native="findPhone"
-						></el-input>
-					</el-form-item>
-					<el-form-item label="密码">
-						<el-input
-							v-model="password"
-							auto-complete="off"
-							placeholder="请输入密码"
-							type="password"
-							style="width: 100%"
-							@keyup.enter.native="findPhone"
-						></el-input>
-					</el-form-item>
-				</el-form>
-				<div style="display: flex; justify-content: flex-end">
-					<el-button type="text" @click="islogin = false">立即注册</el-button>
-				</div>
-				<div class="login_button">
-					<button @click="findPhone()">登录</button>
-				</div>
-			</div>
-		</div>
-		<div class="login_box" v-show="!islogin">
-			<div style="padding: 0px 20px">
-				<div class="login_title">
-					<span>PBL项目平台注册</span>
-				</div>
-				<!-- <div class="userLogin">
+        <el-form
+          label-position="right"
+          label-width="80px"
+          style="margin-top: 30px"
+        >
+          <el-form-item label="账号">
+            <el-input
+              v-model="phoneNum"
+              auto-complete="off"
+              placeholder="请输入账号"
+              style="width: 100%"
+              @keyup.enter.native="findPhone"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="密码">
+            <el-input
+              v-model="password"
+              auto-complete="off"
+              placeholder="请输入密码"
+              type="password"
+              style="width: 100%"
+              @keyup.enter.native="findPhone"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+        <div style="display: flex; justify-content: flex-end">
+          <el-button type="text" @click="islogin = false">立即注册</el-button>
+        </div>
+        <div class="login_button">
+          <button @click="findPhone()">登录</button>
+        </div>
+      </div>
+    </div>
+    <div class="login_box" v-show="!islogin">
+      <div style="padding: 0px 20px">
+        <div class="login_title">
+          <span>PBL项目平台注册</span>
+        </div>
+        <!-- <div class="userLogin">
           <img src="../assets/username.png" />
           <el-input v-model="phoneNum" placeholder="手机号码"></el-input>
         </div>
@@ -64,329 +51,319 @@
           <img src="../assets/password.png" />
           <el-input v-model="password" placeholder="密码" type="password"></el-input>
         </div> -->
-				<el-form
-					label-position="right"
-					label-width="80px"
-					style="margin-top: 30px"
-					:rules="rules2"
-					ref="ruleForm2"
-					:model="registerForm"
-				>
-					<el-form-item label="手机号码" prop="phone">
-						<el-input
-							v-model="registerForm.rphoneNum"
-							auto-complete="off"
-							placeholder="请输入手机号码"
-							style="width: 100%"
-						></el-input>
-					</el-form-item>
-					<el-form-item label="密码" prop="pass">
-						<el-input
-							v-model="registerForm.rpassword"
-							auto-complete="off"
-							placeholder="请输入密码"
-							type="password"
-							style="width: 100%"
-						></el-input>
-					</el-form-item>
-					<el-form-item label="确认密码" prop="checkPass">
-						<el-input
-							v-model="registerForm.repassword"
-							auto-complete="off"
-							placeholder="请再输入一遍密码"
-							type="password"
-							style="width: 100%"
-						></el-input>
-					</el-form-item>
-					<el-form-item label="学校" prop="school">
-						<el-select v-model="registerForm.school" placeholder="请选择学校">
-							<el-option
-								v-for="(item, index) in schoolArray"
-								:key="index"
-								:label="item.name"
-								:value="item.id"
-							>
-							</el-option>
-						</el-select>
-					</el-form-item>
-				</el-form>
-				<div style="display: flex; justify-content: flex-end">
-					<el-button type="text" @click="islogin = true">返回登录</el-button>
-				</div>
-				<div class="login_button">
-					<button @click="register()">注册</button>
-				</div>
-			</div>
-		</div>
-	</div>
+        <el-form
+          label-position="right"
+          label-width="80px"
+          style="margin-top: 30px"
+          :rules="rules2"
+          ref="ruleForm2"
+          :model="registerForm"
+        >
+          <el-form-item label="手机号码" prop="phone">
+            <el-input
+              v-model="registerForm.rphoneNum"
+              auto-complete="off"
+              placeholder="请输入手机号码"
+              style="width: 100%"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="密码" prop="pass">
+            <el-input
+              v-model="registerForm.rpassword"
+              auto-complete="off"
+              placeholder="请输入密码"
+              type="password"
+              style="width: 100%"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="确认密码" prop="checkPass">
+            <el-input
+              v-model="registerForm.repassword"
+              auto-complete="off"
+              placeholder="请再输入一遍密码"
+              type="password"
+              style="width: 100%"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="学校" prop="school">
+            <el-select v-model="registerForm.school" placeholder="请选择学校">
+              <el-option
+                v-for="(item, index) in schoolArray"
+                :key="index"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div style="display: flex; justify-content: flex-end">
+          <el-button type="text" @click="islogin = true">返回登录</el-button>
+        </div>
+        <div class="login_button">
+          <button @click="register()">注册</button>
+        </div>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-	export default {
-		data() {
-			var validatePass = (rule, value, callback) => {
-				var _this = this;
-				if (_this.registerForm.rpassword === "") {
-					callback(new Error("请输入密码"));
-				} else {
-					if (_this.registerForm.rpassword.length < 6) {
-						callback(new Error("输入的密码需不少于6位"));
-					} else if (_this.registerForm.repassword !== "") {
-						_this.$refs.ruleForm2.validateField("checkPass");
-					}
-					callback();
-				}
-			};
-			var validatePass2 = (rule, value, callback) => {
-				var _this = this;
-				if (_this.registerForm.repassword === "") {
-					callback(new Error("请再次输入密码"));
-				} else if (
-					_this.registerForm.repassword !== _this.registerForm.rpassword
-				) {
-					callback(new Error("两次输入密码不一致!"));
-				} else {
-					callback();
-				}
-			};
-			// 验证手机
-			var checkPhone = (rule, value, callback) => {
-				var _this = this;
-				let reg = /^1\d{10}$/;
-				if (_this.registerForm.rphoneNum === "") {
-					callback(new Error("请输入手机号码"));
-				} else {
-					if (!reg.test(_this.registerForm.rphoneNum)) {
-						callback(new Error("请输入11位手机号"));
-					} else {
-						let params = { un: _this.registerForm.rphoneNum };
-						this.ajax
-							.get(this.$store.state.api + "findPhone", params)
-							.then((res) => {
-								if (res.data[0].length > 0) {
-									callback(new Error("此手机号已注册"));
-								} else {
-									callback();
-								}
-								console.log(res.data[0]);
-							})
-							.catch((err) => {
-								callback();
-								console.error(err);
-							});
-					}
-				}
-			};
-			return {
-				islogin: true,
-				phoneNum: "",
-				password: "",
-				sqlPassword: "",
-				registerForm: {
-					rphoneNum: "",
-					rpassword: "",
-					repassword: "",
-					school: "",
-				},
-				schoolArray: [],
-				now: "",
-				rules2: {
-					phone: [
-						{
-							required: true,
-							type: "number",
-							validator: checkPhone,
-							trigger: ["blur", "change"],
-						},
-					],
-					pass: [{ required: true, validator: validatePass, trigger: "blur" }],
-					checkPass: [
-						{ required: true, validator: validatePass2, trigger: "blur" },
-					],
-					school: [
-						{ required: true, message: "请选择活动区域", trigger: "blur" },
-					],
-				},
-				userInfo: [],
-			};
-		},
-		created() {
-			// this.getOrg();
-			this.getSchool();
-		},
-		methods: {
-			time() {
-				if (!this.now) {
-					this.now = new Date().getTime();
-					return true;
-				} else {
-					let time = new Date().getTime();
-					if (time - this.now > 3000) {
-						this.now = time;
-						return true;
-					} else {
-						return false;
-					}
-				}
-			},
-			register() {
-				this.$refs.ruleForm2.validate((valid) => {
-					if (valid) {
-						if (this.time()) {
-							let params = [
-								{
-									username: this.registerForm.rphoneNum,
-									userpassword: this.registerForm.repassword,
-									oid: this.registerForm.school,
-								},
-							];
-							this.ajax
-								.post(this.$store.state.api + "register", params)
-								.then((res) => {
-									this.$message({
-										message: "注册成功",
-										type: "success",
-									});
-									this.registerForm = {
-										rphoneNum: "",
-										rpassword: "",
-										repassword: "",
-										school: "",
-									};
-									this.islogin = true;
-								})
-								.catch((err) => {
-									this.$message.error("注册失败");
-									console.error(err);
-								});
-						}
-					} else {
-						return false;
-					}
-				});
-			},
-			findPhone() {
-				let params = { un: this.phoneNum };
-				this.ajax
-					.get(this.$store.state.api + "findPhone", params)
-					.then((res) => {
-						if (res.data[0].length > 0) {
-							if (res.data[0][0].state == 0) {
-								this.$message.error("此账号已被屏蔽登录,请咨询管理员");
-								return;
-							}
-							if (res.data[0][0].type == 1) {
-								// this.sqlPassword = res.data[0][0].userpassword;
-								// this.userInfo = res.data[0][0]
-								this.isU = 1;
-							} else {
-								this.isU = 2;
-							}
-						} else {
-							this.isU = false;
-						}
-						this.login();
-						console.log(res.data[0][0]);
-					})
-					.catch((err) => {
-						console.error(err);
-					});
-			},
-			login() {
-				if (this.time()) {
-					var _this = this;
-					var isU = _this.isU;
-					if (isU == 1) {
-						let params = [
-							{
-								uname: this.phoneNum,
-								upassword: this.password,
-								// sqlpassword: this.sqlPassword,
-							},
-						];
-						_this.ajax
-							.post(_this.$store.state.api + "login", params)
-							.then((res) => {
-								if (res.data.status == "1") {
-									_this.$message({
-										message: "登录成功",
-										type: "success",
-									});
+export default {
+  data() {
+    var validatePass = (rule, value, callback) => {
+      var _this = this;
+      if (_this.registerForm.rpassword === "") {
+        callback(new Error("请输入密码"));
+      } else {
+        if (_this.registerForm.rpassword.length < 6) {
+          callback(new Error("输入的密码需不少于6位"));
+        } else if (_this.registerForm.repassword !== "") {
+          _this.$refs.ruleForm2.validateField("checkPass");
+        }
+        callback();
+      }
+    };
+    var validatePass2 = (rule, value, callback) => {
+      var _this = this;
+      if (_this.registerForm.repassword === "") {
+        callback(new Error("请再次输入密码"));
+      } else if (
+        _this.registerForm.repassword !== _this.registerForm.rpassword
+      ) {
+        callback(new Error("两次输入密码不一致!"));
+      } else {
+        callback();
+      }
+    };
+    // 验证手机
+    var checkPhone = (rule, value, callback) => {
+      var _this = this;
+      let reg = /^1\d{10}$/;
+      if (_this.registerForm.rphoneNum === "") {
+        callback(new Error("请输入手机号码"));
+      } else {
+        if (!reg.test(_this.registerForm.rphoneNum)) {
+          callback(new Error("请输入11位手机号"));
+        } else {
+          let params = { un: _this.registerForm.rphoneNum };
+          this.ajax
+            .get(this.$store.state.api + "findPhone", params)
+            .then((res) => {
+              if (res.data[0].length > 0) {
+                callback(new Error("此手机号已注册"));
+              } else {
+                callback();
+              }
+              console.log(res.data[0]);
+            })
+            .catch((err) => {
+              callback();
+              console.error(err);
+            });
+        }
+      }
+    };
+    return {
+      islogin: true,
+      phoneNum: "",
+      password: "",
+      sqlPassword: "",
+      registerForm: {
+        rphoneNum: "",
+        rpassword: "",
+        repassword: "",
+        school: "",
+      },
+      schoolArray: [],
+      now: "",
+      rules2: {
+        phone: [
+          {
+            required: true,
+            type: "number",
+            validator: checkPhone,
+            trigger: ["blur", "change"],
+          },
+        ],
+        pass: [{ required: true, validator: validatePass, trigger: "blur" }],
+        checkPass: [
+          { required: true, validator: validatePass2, trigger: "blur" },
+        ],
+        school: [
+          { required: true, message: "请选择活动区域", trigger: "blur" },
+        ],
+      },
+      userInfo: [],
+    };
+  },
+  created() {
+    // this.getOrg();
+    this.getSchool();
+  },
+  methods: {
+    time() {
+      if (!this.now) {
+        this.now = new Date().getTime();
+        return true;
+      } else {
+        let time = new Date().getTime();
+        if (time - this.now > 3000) {
+          this.now = time;
+          return true;
+        } else {
+          return false;
+        }
+      }
+    },
+    register() {
+      this.$refs.ruleForm2.validate((valid) => {
+        if (valid) {
+          if (this.time()) {
+            let params = [
+              {
+                username: this.registerForm.rphoneNum,
+                userpassword: this.registerForm.repassword,
+                oid: this.registerForm.school,
+              },
+            ];
+            this.ajax
+              .post(this.$store.state.api + "register", params)
+              .then((res) => {
+                this.$message({
+                  message: "注册成功",
+                  type: "success",
+                });
+                this.registerForm = {
+                  rphoneNum: "",
+                  rpassword: "",
+                  repassword: "",
+                  school: "",
+                };
+                this.islogin = true;
+              })
+              .catch((err) => {
+                this.$message.error("注册失败");
+                console.error(err);
+              });
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    findPhone() {
+      let params = { un: this.phoneNum };
+      this.ajax
+        .get(this.$store.state.api + "findUsername", params)
+        .then((res) => {
+          if (res.data[0].length > 0) {
+            if (res.data[0][0].type == 0) {
+              this.$message.error("此账号已被屏蔽登录,请咨询管理员");
+              return;
+            }
+              this.isU = res.data[0][0].type;
+          } else {
+            this.isU = false;
+          }
+          this.login();
+          console.log(res.data[0][0]);
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    login() {
+      if (this.time()) {
+        var _this = this;
+        let isU = _this.isU;
+          let params = [
+            {
+              uname: this.phoneNum,
+              upassword: this.password,
+              // sqlpassword: this.sqlPassword,
+            },
+          ];
+          _this.ajax
+            .post(_this.$store.state.api + "loginRace", params)
+            .then((res) => {
+              if (res.data.status == "1") {
+                _this.$message({
+                  message: "登录成功",
+                  type: "success",
+                });
 
-									_this.userInfo = res.data[0][0];
-									_this.$cookies.set("tlogin", "1", -1);
+                _this.userInfo = res.data[0][0];
+                _this.$cookies.set("tlogin", "1", -1);
 
-									_this.$cookies.set("tuserid", _this.userInfo.userid, -1);
-									_this.$cookies.set("teacherInfo", _this.userInfo, -1);
-									// window.sessionStorage.setItem("login", true);
-									// window.sessionStorage.setItem("userInfo", JSON.stringify(this.userInfo));
-									_this.$store.commit("update", ["isLogin", true]);
-									_this.$store.commit("update", ["userInfo", _this.userInfo]);
-									// console.log(_this.$store.state);
-									_this.$router.push("/course?userid=" + _this.userInfo.userid);
-								} else {
-									this.$message.error("密码错误");
-								}
-								console.log(res.data);
-							})
-							.catch((err) => {
-								this.$message.error("登录失败");
-								console.error(err);
-							});
-					} else if (isU == 2) {
-						this.$message.error("此账号角色不是老师");
-					} else {
-						this.$message.error("此账号还未注册请去注册");
-					}
+                _this.$cookies.set("tuserid", _this.userInfo.userid, -1);
+                _this.$cookies.set("teacherInfo", _this.userInfo, -1);
+                // window.sessionStorage.setItem("login", true);
+                // window.sessionStorage.setItem("userInfo", JSON.stringify(this.userInfo));
+                _this.$store.commit("update", ["isLogin", true]);
+                _this.$store.commit("update", ["userInfo", _this.userInfo]);
+				if(isU == 1){
+					this.$router.push('/eventCenter')
 				}
+                // console.log(_this.$store.state);
+              } else {
+                this.$message.error("密码错误");
+              }
+              console.log(res.data);
+            })
+            .catch((err) => {
+              this.$message.error("登录失败");
+              console.error(err);
+            });
+      }
 
-				//   sessionStorage.removeItem("key");
-			},
-			//查询学校
-			// getOrg() {
-			//   this.ajax
-			//     .get(this.$store.state.api + "getAllOrg", "")
-			//     .then((res) => {
-			//       this.schoolArray = res.data[0];
-			//       console.log(res.data[0]);
-			//     })
-			//     .catch((err) => {
-			//       console.error(err);
-			//     });
-			// },
-			getSchool() {
-				this.ajax
-					.get(this.$store.state.api + "selectOrg", "")
-					.then((res) => {
-						this.schoolArray = res.data[0];
-					})
-					.catch((err) => {
-						console.error(err);
-					});
-			},
-		},
-	};
+      //   sessionStorage.removeItem("key");
+    },
+    //查询学校
+    // getOrg() {
+    //   this.ajax
+    //     .get(this.$store.state.api + "getAllOrg", "")
+    //     .then((res) => {
+    //       this.schoolArray = res.data[0];
+    //       console.log(res.data[0]);
+    //     })
+    //     .catch((err) => {
+    //       console.error(err);
+    //     });
+    // },
+    getSchool() {
+      this.ajax
+        .get(this.$store.state.api + "selectOrg", "")
+        .then((res) => {
+          this.schoolArray = res.data[0];
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+};
 </script>
 
 <style scoped>
-	.login_content {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		height: calc(100% - (67.5px * 2));
-		/* position: absolute; */
-		width: 100%;
-	}
-	.login_box {
-		width: 23%;
-		min-width: 400px;
-		margin: 0 auto;
-		background: #fff;
-		padding: 20px;
-		box-shadow: 0 0 20px #eee;
-	}
+.login_content {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: calc(100% - (67.5px * 2));
+  /* position: absolute; */
+  width: 100%;
+}
+.login_box {
+  width: 23%;
+  min-width: 400px;
+  margin: 0 auto;
+  background: #fff;
+  padding: 20px;
+  box-shadow: 0 0 20px #eee;
+}
 
-	/* .userLogin img {
+/* .userLogin img {
 	  width: 50%;
 	  display: inline-block;
 	  width: 18px;
@@ -398,35 +375,35 @@
 	  z-index: 999;
 	} */
 
-	/* .el-input >>> input {
+/* .el-input >>> input {
 	  width: 100%;
 	  padding: 15px 0 15px 40px;
 	  outline: none;
 	  border: 1px solid #ccc;
 	  font-size: 14px;
 	} */
-	/* .userLogin {
+/* .userLogin {
 	  margin-top: 25px;
 	  position: relative;
 	} */
-	.login_button {
-		margin-top: 10px;
-	}
-	.login_button button {
-		width: 100%;
-		color: #fff;
-		background: #2a97ff;
-		padding: 10px;
-		border-radius: 10px;
-		border: none;
-		font-size: 18px;
-		text-align: center;
-		outline: none;
-		cursor: pointer;
-	}
-	.login_title {
-		text-align: center;
-		font-size: 26px;
-		font-weight: 600;
-	}
+.login_button {
+  margin-top: 10px;
+}
+.login_button button {
+  width: 100%;
+  color: #fff;
+  background: #2a97ff;
+  padding: 10px;
+  border-radius: 10px;
+  border: none;
+  font-size: 18px;
+  text-align: center;
+  outline: none;
+  cursor: pointer;
+}
+.login_title {
+  text-align: center;
+  font-size: 26px;
+  font-weight: 600;
+}
 </style>

+ 3 - 3
src/router/index.js

@@ -30,21 +30,21 @@ export default new Router({
         name: 'eventCenter',
         component: eventCenter,
         meta: {
-            requireAuth: '' // 不需要鉴权
+            requireAuth: true // 不需要鉴权
         }
     }, {
         path: '/addRace',
         name: 'addRace',
         component: addRace,
         meta: {
-            requireAuth: '' // 不需要鉴权
+            requireAuth: true // 不需要鉴权
         }
     }, {
         path: '/anliDetail',
         name: 'anliDetail',
         component: anliDetail,
         meta: {
-            requireAuth: '' // 不需要鉴权
+            requireAuth: true // 不需要鉴权
         }
     }, ]
 })