20240517
This commit is contained in:
@@ -4,7 +4,7 @@ import $http from '@/config/requestConfig'
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
|
||||
export default {
|
||||
... mapMutations(["setUserInfo"]) ,
|
||||
...mapMutations(["setUserInfo"]),
|
||||
showToast(title, icon) {
|
||||
return uni.showToast({
|
||||
title: title,
|
||||
@@ -51,6 +51,35 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//用户协议
|
||||
async getAgreement(id) {
|
||||
console.log('id at line 56:', id)
|
||||
var data = {
|
||||
id: id
|
||||
}
|
||||
var result = {
|
||||
title:'',
|
||||
content:''
|
||||
}
|
||||
await $http
|
||||
.request({
|
||||
url: "sys/agreement/getAgreement",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: data,
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}).then((res) => {
|
||||
console.log('res at line 111:', res)
|
||||
if (res.code == 0) {
|
||||
result = res.agreement
|
||||
}
|
||||
|
||||
})
|
||||
return result
|
||||
},
|
||||
async getCheckCourseStatus(data) {
|
||||
var result
|
||||
await $http
|
||||
@@ -83,16 +112,16 @@ export default {
|
||||
content: "确定要退出当前账户吗?",
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
setUserInfo({ token: null });
|
||||
uni.reLaunch({
|
||||
url: "/pages/user/login/login",
|
||||
});
|
||||
setUserInfo({ token: null });
|
||||
uni.reLaunch({
|
||||
url: "/pages/user/login/login",
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
// 取消操作
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
// this.signShow = false;
|
||||
// this.setUserInfo({ token: null });
|
||||
|
||||
Reference in New Issue
Block a user