1.安装sha1
npm install sha1 --save
2.在需要的页面引入sha1
<script>
import sha1 from "sha1";
import qs from "qs";
export default {
components: {},
data() {
return {
msg: "Fj|uU920fsJ19fk1610699564624",
getkefuflag: false,
3.使用sha1加密
var newtime = new Date().getTime();
var token = sha1("Fj|uU920fsJ19fk" + newtime).substring(0, 18);
var data = {
companyId: id,
token: token,
timestamp: newtime,
};
this.$fsesl.post("/fs/getId6dList", qs.stringify(data)).then((res)
一般用法
sha1("message");