添加登录代码

This commit is contained in:
2023-05-15 14:30:16 +08:00
parent 8e3beb44d9
commit 9cb8aa0bac
16 changed files with 330 additions and 21 deletions

View File

@@ -32,7 +32,7 @@ const request={
avatarUrl:params.avatarUrl
}
return net.request({
api:'/api/token',
api:'/api/v1/token',
data,
header:{
'content-type': 'application/x-www-form-urlencoded'
@@ -58,6 +58,12 @@ const request={
return true;
}
},
bindingWX:function(data:any) {
return net.request({
api:'/api/user/binding/wechat',
data
})
},
getWineList:function(data:any) {
return net.request({
api:'/api/v1/wine',

View File

@@ -1,7 +1,7 @@
// var baseUrl = "https://dfhd.guwengkj.com";
// var baseUrl = "https://wine.api.echol.cn";
var baseUrl = "http://192.168.1.40:8083";
// const APPID = "wx3d38ce1103a82225";
// const SECRET = '3c41ca428b4d0f43cfaef6f567a1cc06';
// const APPID = "wx29f3e0dc2f7f2c54";
// const SECRET = '95a893451cf25b696612a7d1735a04b8';
const service = {
request:(options:any) => {
let {api,data={},method="POST",header='',callback} = options
@@ -18,6 +18,7 @@ const service = {
'content-type': 'application/json'
}
}
// let auth = base64encode("admin:admin")
header["Authorization"]=token || 'Basic ZGV2OmRldjEyMw== '
return new Promise((resolve,reject)=>{
wx.request({