|
@@ -8,12 +8,13 @@
|
|
|
<child :val="val" @childByValue="childByValue" />
|
|
|
<br />
|
|
|
<el-button @click="login">登入</el-button>
|
|
|
+ <el-button @click="out">登出</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import child from "@/views/work/child";
|
|
|
-import { loginByUsername } from "@/api/login";
|
|
|
+import { loginByUsername, logout } from "@/api/login";
|
|
|
|
|
|
export default {
|
|
|
name: "work",
|
|
@@ -37,7 +38,12 @@ export default {
|
|
|
this.input = chi;
|
|
|
},
|
|
|
login: function() {
|
|
|
- loginByUsername("admin", "system");
|
|
|
+ // document.cookie = "csrftoken=";
|
|
|
+ document.cookie = "";
|
|
|
+ loginByUsername("linjj", "admin");
|
|
|
+ },
|
|
|
+ out: function() {
|
|
|
+ logout();
|
|
|
}
|
|
|
}
|
|
|
};
|