王浩宇 1 year ago
parent
commit
81e0ee852b
  1. 1
      common/http.js
  2. 6
      pages/general/general.vue

1
common/http.js

@ -80,6 +80,7 @@ export function post(url, data, header){
export function upload(url, data, header){ export function upload(url, data, header){
header.Authorization = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}` header.Authorization = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`
const token = uni.getStorageSync("token") const token = uni.getStorageSync("token")
// const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIyODczMTUiLCJzdWIiOiIiLCJ1c2VyX25hbWUiOiJodGNzIiwiaXNzIjoiS2VOaW5nIiwicmVhbF9uYW1lIjoiaHRjcyIsImNsaWVudF9pZCI6InNhYmVyIiwiZW5hYmxlZCI6dHJ1ZSwicm9sZV9pZCI6IjE2ODExMjM0NjUzNjc0OTg3NTQiLCJzY29wZSI6WyJhbGwiXSwiY3VzdG9tZXJJZCI6IiIsImlzUHVibGljIjpmYWxzZSwib2F1dGhfaWQiOiIiLCJleHAiOjE2OTk2ODQ4MjUsImlhdCI6MTY5OTU5ODQyNSwianRpIjoiMjcyNjJkZmUtMDUwOC00N2IyLTliMzItOTlmYzQ1NWNkN2FlIiwiYXZhdGFyIjoiIiwidXNlcklkIjoiIiwiYXV0aG9yaXRpZXMiOlsiR0VORVJBTF9VU0VSIl0sInJvbGVfbmFtZSI6IkdFTkVSQUxfVVNFUiIsInBvc3RfaWQiOiIiLCJ1c2VyX2lkIjoiMTcyMjg2NjY2ODg4ODY5ODg4MSIsIm5pY2tfbmFtZSI6Imh0Y3MiLCJ0ZW5hbnRJZCI6IjRiNTM0YmYwLThjMzEtM2UxZi1hOGRkLTk4MzgxMDRjNDcwNyIsImRldGFpbCI6eyJ0eXBlIjoid2ViIn0sImRlcHRfaWQiOiIxNzIyODY2NTYyOTExMjE5NzE0IiwiYWNjb3VudCI6Imh0Y3MifQ.PHDd2CMP3ej4-x7MLJO3dItwDI6LrW0eviUwrJ0sqRs'
if (token) { if (token) {
header['Blade-Auth'] = 'bearer ' + token header['Blade-Auth'] = 'bearer ' + token
} }

6
pages/general/general.vue

@ -126,12 +126,12 @@
clickSign() { clickSign() {
this.$http.get("/fire-customer/sign/getServerTime", {}, {}).then(res => { this.$http.get("/fire-customer/sign/getServerTime", {}, {}).then(res => {
this.serverTime = res.data this.serverTime = res.data
let n = new Date(res.data).getTime() let n = new Date(res.data.replace(/-/g, '/')).getTime()
let bl = false let bl = false
try { try {
this.ruleList.forEach((rule) => { this.ruleList.forEach((rule) => {
let s = new Date(rule.startTime).getTime() let s = new Date(rule.startTime.replace(/-/g, '/')).getTime()
let e = new Date(rule.endTime).getTime() let e = new Date(rule.endTime.replace(/-/g, '/')).getTime()
if (s <= n && n <= e) { if (s <= n && n <= e) {
if (rule.bb) { if (rule.bb) {
uni.showToast({ uni.showToast({

Loading…
Cancel
Save