123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- var Authorization = localStorage.getItem("token")
- var LayuiGetJson = param => {
- return new Promise((resovle, reject) => {
- $.ajax({
- type: param.type || "get",
- async: param.async || true,
- url: param.url,
- data: param.data || {},
- headers:{
- "Content-Type": "application/json;charset=utf-8",
- "Authorization": "Bearer " + Authorization
- },
- success: res => {
- resovle(res);
- },
- error: err => {
- reject(err);
- }
- })
- })
- }
- var LayuiPostJson = param => {
- return new Promise((resovle, reject) => {
- $.ajax({
- type: param.type || "post",
- async: param.async || true,
- url: param.url,
- data: param.data || {},
- header:{
- "Content-Type": "application/json;charset=utf-8",
- "Authorization":"Bearer " + Authorization
- },
- success: res => {
- resovle(res);
- },
- error: err => {
- reject(err);
- }
- })
- })
- }
- // 接口配置
- const HOST = "http://47.108.130.28:8000"
- var LOGINAPI = HOST + "/v1/login"
- var ACCOUNTINFOAPI = HOST + "/v1/admin/account"
|