diff --git a/about.html b/about.html
index 50165f5..753f516 100644
--- a/about.html
+++ b/about.html
@@ -390,12 +390,13 @@
this.nowteaminfos = this.aboutObj.teamlist[index];
},
async getAbouts(){
- let res = await axios.get(baseUrl+'api/index/about');
- if (res.data.code === 1) {
- this.aboutObj = res.data.data;
+ let res = await publikRequesFunction('api/index/about','get',{});
+ console.log(res,'nowRequest');
+ if (res.code === 1) {
+ this.aboutObj = res.data;
this.nowteaminfos = this.aboutObj.teamlist[0];
}
- }
+ }
}
})
diff --git a/all-order.html b/all-order.html
index aab2d0a..c9dfb42 100644
--- a/all-order.html
+++ b/all-order.html
@@ -330,32 +330,21 @@
// 返回格式化后的日期字符串
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
- getallorderList(){
+ async getallorderList(){
this.tableLoading = true;
let _that = this;
- $.ajax({
- url: `${baseUrl}api/project/getorderlist`,
- type: "get",
- data: {
- ..._that.orderSearchObj,
- trade: _that.timeFilter,
- state: _that.activeTab
- },
- headers: {
- token: _that.userInfoObj.token
- },
- success(res){
- if (res.code === 1) {
- _that.orderListObj = res.data;
- _that.tableLoading = false;
- } else {
- _that.$message.error(res.msg)
- }
- },
- error(error) {
- _that.$message.error(error)
- }
- })
+ const params = {
+ ..._that.orderSearchObj,
+ trade: _that.timeFilter,
+ state: _that.activeTab
+ };
+ let res = await publikRequesFunction('api/project/getorderlist','get',params);
+ if (res.code === 1) {
+ _that.orderListObj = res.data;
+ _that.tableLoading = false;
+ } else {
+ _that.$message.error(res.msg)
+ }
},
changeTab(tab) {
this.activeTab = tab;
@@ -448,7 +437,7 @@
this.orderLoading.close();
}
},
- submitOrderHash(id,tx){
+ async submitOrderHash(id,tx){
//求购卖出支付结果api/project/wtbrevpayres
//买入支付结果api/common/payresult
let api = "";
@@ -462,28 +451,16 @@
obj = { wtbid: id,tx }
}
try {
- $.ajax({
- url: `${baseUrl + api}`,
- type: "post",
- data: {...obj},
- headers: {
- token: _that.userInfoObj.token
- },
- success(res){
- if (res.code === 1) {
- _that.$message.success('success');
- _that.orderLoading.close();
- setTimeout(()=>{
- _that.getallorderList();
- },1000);
- } else {
- _that.$message.error(res.msg)
- }
- },
- error(err) {
- _that.$message.error(err)
- }
- })
+ let res = await publikRequesFunction(api,'post',obj);
+ if (res.code === 1) {
+ _that.$message.success('success');
+ _that.orderLoading.close();
+ setTimeout(()=>{
+ _that.getallorderList();
+ },1000);
+ } else {
+ _that.$message.error(res.msg)
+ }
} catch (error) {
_that.$message.error(error)
}
diff --git a/contact.html b/contact.html
index 8d3d8f7..1c9188c 100644
--- a/contact.html
+++ b/contact.html
@@ -293,7 +293,7 @@
});
},
methods:{
- sendContact(){
+ async sendContact(){
let _that = this;
let tipMessage = this.currentLanguage == 'zh' ? '請輸入完整信息' : "Please enter complete information";
if(!this.firstName || !this.secondName || !this.contactObj.email || !this.contactObj.contact){
@@ -301,29 +301,15 @@
return
}
this.contactObj.name = this.firstName + this.secondName;
- $.ajax({
- url:`${baseUrl}api/common/contactus`,
- data:{
- ..._that.contactObj
- },
- headers:{
- token: this.userToken
- },
- type:"post",
- success(res){
- if(res.code === 1){
- _that.firstName = "";
- _that.secondName = "";
- _that.contactObj = {};
- _that.$message.success("success");
- }else{
- _that.$message.error("failed");
- }
- },
- error(err){
- _that.$message.error("failed");
- }
- });
+ let res = await publikRequesFunction('api/common/contactus','post',{..._that.contactObj});
+ if(res.code === 1){
+ _that.firstName = "";
+ _that.secondName = "";
+ _that.contactObj = {};
+ _that.$message.success("success");
+ }else{
+ _that.$message.error("failed");
+ }
},
// <-- -------------------------錢包登錄開始 --------------------------->
copyText(txt){
diff --git a/game-detail.html b/game-detail.html
index c439485..4199b2b 100644
--- a/game-detail.html
+++ b/game-detail.html
@@ -271,7 +271,6 @@
if (user) {
this.userIsLogin = true;
}
- this.getgamesInfo();
// 钱包登录开始
const provider = window.web3?.currentProvider;
let accounts1 = [];
@@ -404,9 +403,9 @@
this.currentLanguage = mobileLang()
},
async getgamesInfo(){
- let res = await axios.get(baseUrl+"api/index/gameinfo");
- if(res.data.code == 1){
- this.gamesinfomation = res.data.data;
+ let res = await publikRequesFunction('api/index/gameinfo','get',{});
+ if(res.code == 1){
+ this.gamesinfomation = res.data;
}
},
}
diff --git a/index.html b/index.html
index 20ebf00..5fafeb1 100644
--- a/index.html
+++ b/index.html
@@ -573,7 +573,6 @@
downloadObj: {},
pageIngomation: [],
videoList: [],
- categoriesTabList: [],
outlookList: [],
saleList: [],//限時商品列表
times: {
@@ -609,7 +608,6 @@
}
this.getDownload();
this.getgamesVideo();
- this.getCategoriestable();
this.getOutlook();
this.loadCloseAuth()
this.loadSaleList();
@@ -764,21 +762,11 @@
mobileLang() {
this.currentLanguage = mobileLang()
},
- getRoleList() {
- let _that = this;
- $.ajax({
- url: baseUrl+"api/index/getrole",
- type: 'get',
- dataType: "json",
- success(res) {
- if (res.code === 1) {
- _that.roleList = res.data;
- }
- },
- error(rej) {
- console.log("failed");
- }
- })
+ async getRoleList() {
+ let res = await publikRequesFunction('api/index/getrole','get',{});
+ if (res.code === 1) {
+ this.roleList = res.data;
+ }
},
//新聞詳情
toNewDetail() {
@@ -826,13 +814,8 @@
// this.$message.success('success');
},
async orderPayResult(id, tx) {
- let res = await axios.post(baseUrl+'api/common/payresult', { id, tx }, { headers: { 'token': this.token, 'Content-Type': 'application/json' } });
- if (res.data.code === 1) {
- // if (this.orderList[this.orderList.length - 1].id == id) {
- // this.orderLoading.close();
- // }
- } else {
- // this.orderLoading.close();
+ let res = await publikRequesFunction('api/common/payresult','post',{id, tx});
+ if (res.code != 1) {
this.$message.error('error');
}
},
@@ -845,28 +828,21 @@
}
this.buy.fromaddress = this.userMoneyAdressAll;
let tipMessage = this.currentLanguage == 'zh' ? '交易中,請勿刷新頁面...' : 'During the transaction, please do not refresh the page';
- // this.orderLoading = this.$loading({ lock: true, text: tipMessage, spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' });
- let res = await axios.post(baseUrl+'api/project/createpurchaseorder', { ...this.buy }, {
- headers: {
- 'token': this.token, // 使用 Bearer 認證方式攜帶 Token
- 'Content-Type': 'application/json' // 確保發送 JSON 格式的數據
- }
- })
+ let res = await publikRequesFunction('api/project/createpurchaseorder','post',{...this.buy});
console.log(res, '订单');
- if (res.data.code === 1) {
- this.orderList = res.data.data;
+ if (res.code === 1) {
+ this.orderList = res.data;
this.buyButtonVisible = false;
this.websentMoney();
} else {
- this.$message.error(res.data.msg);
- // this.orderLoading.close();
+ this.$message.error(res.msg);
}
},
//獲取限時折購商品
async loadSaleList() {
- let res = await axios.get(`${baseUrl}api/index/getpurchase`);
- if (res.data.code === 1) {
- this.saleList = res.data.data;
+ let res = await publikRequesFunction('api/index/getpurchase','get',{});
+ if (res.code === 1) {
+ this.saleList = res.data;
this.isShowSale = this.saleList.length > 0
setInterval(() => {
if (this.currentSaleIndex === this.saleList.length - 1) {
@@ -885,58 +861,40 @@
window.location.href = 'login.html'
},
async getOutlook() {
- let res = await axios.get(`${baseUrl}api/index/getlist?
- cateid=4&
- keywordsen=&
- keywordscn=&
- page=1&
- listrow=5&
- `);
- if (res.data.code === 1) {
- this.outlookList = res.data.data.data;
- }
- },
- async getCategoriestable() {
- let res = await axios.get(`${baseUrl}api/index/getlist?
- cateid=1&
- keywordsen=&
- keywordscn=&
- page=1&
- listrow=4&
- `);
- if (res.data.code === 1) {
- this.categoriesTabList = res.data.data.data;
+ let res = await publikRequesFunction('api/index/getlist','get',{
+ cateid:4,
+ keywordsen:"",
+ keywordscn:"",
+ page:1,
+ listrow:5,
+ });
+ if (res.code === 1) {
+ this.outlookList = res.data.data;
}
},
async getgamesVideo() {
- let res = await axios.get(baseUrl+'api/index/getmedia?page=1&listrow=8');
- if (res.data.code === 1) {
- this.videoList = res.data.data.data;
- console.log(this.videoList,'ssxxx');
-
+ let res = await publikRequesFunction('api/index/getmedia','get',{page:1,listrow:8});
+ if (res.code === 1) {
+ this.videoList = res.data.data;
}
},
async getDownload() {
- let res = await axios.get(baseUrl+'api/');
- if (res.data.code === 1) {
- this.downloadObj = res.data.data;
+ let res = await publikRequesFunction('api/','get',{});
+ if (res.code === 1) {
+ this.downloadObj = res.data;
}
},
async getInfomation() {
- let res = await axios.get(`${baseUrl}api/index/getlist?
- cateid=3&
- keywordsen=&
- keywordscn=&
- page=1&
- listrow=4&
- `);
- if (res.data.code === 1) {
- this.pageIngomation = res.data.data.data;
+ let res = await publikRequesFunction('api/index/getlist','get',{
+ cateid:3,
+ keywordsen:"",
+ keywordscn:"",
+ page:1,
+ listrow:4,
+ });
+ if (res.code === 1) {
+ this.pageIngomation = res.data.data;
this.hotnewsindex(0)
- // setTimeout(()=>{
- // const container = this.$refs.container;
- // container.clientHeight > 188 && this.$refs.newsLeft.classList.add('ellipsis');
- // },500)
}
},
optionsTemp(timestamp) {
@@ -947,16 +905,15 @@
return Y + M + D;
},
//请求获取显示抢购弹框关闭按钮权限
- loadCloseAuth() {
- axios.get(baseUrl+'api/index/getcloseauth').then(res => {
- if (res.data.code === 1) {
- console.log(res.data.data, 6666)
- this.isShowClose = Boolean(res.data.data.closeauth)
- this.interval = setInterval(() => {
- this.updateCountdown(res.data.data.purastarttime)
- }, 1000);
- }
- })
+ async loadCloseAuth() {
+ let res = await publikRequesFunction('api/index/getcloseauth','get',{});
+ if (res.code === 1) {
+ console.log(res.data, 6666)
+ this.isShowClose = Boolean(res.data.closeauth)
+ this.interval = setInterval(() => {
+ this.updateCountdown(res.data.purastarttime)
+ }, 1000);
+ }
},
// 更新倒計時的函數
diff --git a/mechanism.html b/mechanism.html
index 761758e..54d5e5c 100644
--- a/mechanism.html
+++ b/mechanism.html
@@ -384,9 +384,9 @@
this.page = val;
},
async getonrules() {
- let res = await axios.get(baseUrl+'api/user/getrewardrule');
- if (res.data.code == 1) {
- this.rewardRules = res.data.data;
+ let res = await publikRequesFunction('api/user/getrewardrule','get',{});
+ if (res.code == 1) {
+ this.rewardRules = res.data;
}
},
}
diff --git a/news-detail.html b/news-detail.html
index 322b1f5..c520b78 100644
--- a/news-detail.html
+++ b/news-detail.html
@@ -247,7 +247,6 @@
}
});
this.getReadDetail();
-
},
methods: {
// <-- -------------------------钱包登录开始 --------------------------->
@@ -358,12 +357,9 @@
return Y + M + D;
},
async getReadDetail() {
- let res = await axios.get(`
- ${baseUrl}api/index/getdetail?
- id=${this.readId}
- `);
- if (res.data.code === 1) {
- let news = JSON.stringify(res.data.data);
+ let res = await publikRequesFunction('api/index/getdetail','get',{id:this.readId});
+ if (res.code === 1) {
+ let news = JSON.stringify(res.data);
news = news.replaceAll('samsar Dao','Samsara Dao').replaceAll('Samsar Dao','Samsara Dao')
this.readeDetalObj = JSON.parse(news)
}
diff --git a/news.html b/news.html
index 5c921bb..5ce76e3 100644
--- a/news.html
+++ b/news.html
@@ -416,16 +416,16 @@
return Y + M + D;
},
async getCategoriestable() {
- let res = await axios.get(`${baseUrl}api/index/getlist?
- cateid=3&
- keywordsen=&
- keywordscn=&
- page=${this.page}&
- listrow=${this.listrow}&
- `);
- if (res.data.code === 1) {
- this.categoriesTabList = res.data.data
- this.categoriesTabList.data = res.data.data.data.map(item=>{
+ let res = await publikRequesFunction('api/index/getlist','get',{
+ cateid:3,
+ keywordsen:"",
+ keywordscn:"",
+ page:this.page,
+ listrow:this.listrow
+ });
+ if (res.code === 1) {
+ this.categoriesTabList = res.data
+ this.categoriesTabList.data = res.data.data.map(item=>{
item.sub_en = item.sub_en.replaceAll('samsar Dao','Samsara Dao').replaceAll('Samsar Dao','Samsara Dao')
item.title_en = item.title_en.replaceAll('samsar Dao','Samsara Dao').replaceAll('Samsar Dao','Samsara Dao')
item.text_en = item.text_en.replaceAll('samsar Dao','Samsara Dao').replaceAll('Samsar Dao','Samsara Dao')
diff --git a/nft.html b/nft.html
index 11793fa..1d545d3 100644
--- a/nft.html
+++ b/nft.html
@@ -706,43 +706,31 @@
_that.$message("Failed");
});
},
- creatRenewalOrder(){
+ async creatRenewalOrder(){
let _that = this;
let tip = this.currentLanguage == 'zh' ? '提示' : 'tips';
let confirm = this.currentLanguage == 'zh' ? '確定' : 'confirm';
let cancel = this.currentLanguage == 'zh' ? '取消' : 'cancel';
- $.ajax({
- url: `${baseUrl}api/project/leasenft`,
- type: "post",
- data: {
- id: _that.nftrenewalInfos.id,
- fromaddress:_that.userMoneyAdressAll
- },
- headers:{
- token: _that.userInfos.token
- },
- success(res) {
- if (res.code === 1) {
- let tipmessage = _that.currentLanguage == 'zh' ? `請前往支付續租費${res.data.bnb} BNB(包含GAS費:${res.data.gasfee} BNB)` : `Please go to pay the renewal fee ${res.data.bnb} BNB (including GAS fee: ${res.data.gasfee} BNB)`;
- _that.$confirm(tipmessage, tip, {
- confirmButtonText: confirm,
- cancelButtonText: cancel,
- dangerouslyUseHTMLString: true
- }).then(() => {
- let tipMessage1 = _that.currentLanguage == 'zh' ? '交易中,請勿刷新頁面...' : 'During the transaction, please do not refresh the page';
- _that.orderLoading = _that.$loading({ lock: true, text: tipMessage1, spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' });
- _that.websentMoney(res.data,'renewal');
- }).catch(() => {
- _that.$message("Failed");
- });
- } else {
- _that.$message.error(res.msg)
- }
- },
- error(err) {
- _that.$message.error(err)
- }
- });
+ let res = await publikRequesFunction('api/project/leasenft','post',{
+ id: _that.nftrenewalInfos.id,
+ fromaddress:_that.userMoneyAdressAll
+ });
+ if (res.code === 1) {
+ let tipmessage = _that.currentLanguage == 'zh' ? `請前往支付續租費${res.data.bnb} BNB(包含GAS費:${res.data.gasfee} BNB)` : `Please go to pay the renewal fee ${res.data.bnb} BNB (including GAS fee: ${res.data.gasfee} BNB)`;
+ _that.$confirm(tipmessage, tip, {
+ confirmButtonText: confirm,
+ cancelButtonText: cancel,
+ dangerouslyUseHTMLString: true
+ }).then(() => {
+ let tipMessage1 = _that.currentLanguage == 'zh' ? '交易中,請勿刷新頁面...' : 'During the transaction, please do not refresh the page';
+ _that.orderLoading = _that.$loading({ lock: true, text: tipMessage1, spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' });
+ _that.websentMoney(res.data,'renewal');
+ }).catch(() => {
+ _that.$message("Failed");
+ });
+ } else {
+ _that.$message.error(res.msg)
+ }
},
submitNft() {
let _that = this;
@@ -763,7 +751,7 @@
_that.creatOrder()
},
//創建交易訂單
- creatOrder(){
+ async creatOrder(){
let tip = this.currentLanguage == 'zh' ? '提示' : 'tips';
let confirm = this.currentLanguage == 'zh' ? '確定' : 'confirm';
let cancel = this.currentLanguage == 'zh' ? '取消' : 'cancel';
@@ -787,36 +775,24 @@
}
apiUrl = "api/project/sale"
}
- $.ajax({
- url: baseUrl + apiUrl,
- type: "post",
- data: params,
- headers: {
- token: _that.userInfos.token
- },
- success(res) {
- if (res.code === 1) {
- let tipmessage = _that.currentLanguage == 'zh' ? `請前往支付版權費(${res.data.salefee} BNB)
和墊付GAS費(${res.data.gasfee} BNB)` : `Please go to pay the copyright fee (${res.data.salefee} BNB)
and advance the GAS fee (${res.data.gasfee} BNB)`;
- _that.$confirm(tipmessage, tip, {
- confirmButtonText: confirm,
- cancelButtonText: cancel,
- dangerouslyUseHTMLString: true
- }).then(() => {
- _that.dialogVisible = false;
- let tipMessage = _that.currentLanguage == 'zh' ? '交易中,請勿刷新頁面...' : 'During the transaction, please do not refresh the page';
- _that.orderLoading = _that.$loading({ lock: true, text: tipMessage, spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' });
- _that.websentMoney(res.data);
- }).catch(() => {
- _that.$message("Failed");
- });
- } else {
- _that.$message.error(res.msg)
- }
- },
- error(err) {
- _that.$message.error(err)
- }
- });
+ let res = await publikRequesFunction(apiUrl,'post',params);
+ if (res.code === 1) {
+ let tipmessage = _that.currentLanguage == 'zh' ? `請前往支付版權費(${res.data.salefee} BNB)
和墊付GAS費(${res.data.gasfee} BNB)` : `Please go to pay the copyright fee (${res.data.salefee} BNB)
and advance the GAS fee (${res.data.gasfee} BNB)`;
+ _that.$confirm(tipmessage, tip, {
+ confirmButtonText: confirm,
+ cancelButtonText: cancel,
+ dangerouslyUseHTMLString: true
+ }).then(() => {
+ _that.dialogVisible = false;
+ let tipMessage = _that.currentLanguage == 'zh' ? '交易中,請勿刷新頁面...' : 'During the transaction, please do not refresh the page';
+ _that.orderLoading = _that.$loading({ lock: true, text: tipMessage, spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' });
+ _that.websentMoney(res.data);
+ }).catch(() => {
+ _that.$message("Failed");
+ });
+ } else {
+ _that.$message.error(res.msg)
+ }
},
//發起版權費+GAS費支付
async websentMoney(item,renewalTxt) {
@@ -859,34 +835,22 @@
}
},
//支付完成提交hash
- submitHash(id,tx,renewalTxt){
+ async submitHash(id,tx,renewalTxt){
let _that = this;
let apiURL = "";
renewalTxt == 'renewal' ? apiURL = 'api/common/payresult' : _that.isLease ? apiURL = "api/project/payedleaseorder" : apiURL = "api/project/payedsaleorder"
try {
- $.ajax({
- url: baseUrl + apiURL,
- type: "post",
- data: {id,tx},
- headers: {
- token: _that.userInfos.token
- },
- success(res){
- if (res.code === 1) {
- _that.$message.success('success');
- _that.orderLoading.close();
- setTimeout(()=>{
- _that.loadData();
- },1000)
- } else {
- _that.$message.error(err)
- _that.orderLoading.close();
- }
- },
- error(err) {
- _that.$message.error(err)
- }
- })
+ let res = await publikRequesFunction(apiURL,'post',{id,tx});
+ if (res.code === 1) {
+ _that.$message.success('success');
+ _that.orderLoading.close();
+ setTimeout(()=>{
+ _that.loadData();
+ },1000)
+ } else {
+ _that.$message.error(err)
+ _that.orderLoading.close();
+ }
} catch (error) {
_that.$message.error(error)
_that.orderLoading.close();
@@ -1015,45 +979,38 @@
maskString(str) {
return str.replace(/^(.{3})(.*)(.{3})$/, function (match, p1, p2, p3) { return p1 + '*'.repeat(p2.length / 2) + p3; });
},
- loadTopType() {
- axios.get(baseUrl + '/api/project/gettype', {
- headers: {
- token: this.userInfos.token,
- },
- }).then(res => {
- this.nfttypeList = res.data.data;
+ async loadTopType() {
+ let res = await publikRequesFunction('api/project/gettype','get',{});
+ if(res.code === 1){
+ this.nfttypeList = res.data;
this.typeactive = this.nfttypeList[0].id
this.getnfttypeList()
- })
+ }
},
// 獲取分類
- getnfttypeList() {
+ async getnfttypeList() {
+ let _that = this;
this.attrCurrent = []
- axios.get(baseUrl + '/api/project/gettpllist?typeid=' + this.typeactive + '&showown=1&listrow=500', {
- headers: {
- token: this.userInfos.token,
- },
- }).then(res => {
- this.attributeList = res.data.data.data
-
- if (this.attributeList.filter(item => { return item.own > 0 }).length > 0) {
- this.loadData()
+ let res = await publikRequesFunction('api/project/gettpllist','get',{
+ typeid:this.typeactive,showown:1,listrow:500
+ });
+ if(res.code === 1){
+ this.attributeList = res.data.data
+ if (_that.attributeList.filter(item => { return item.own > 0 }).length > 0) {
+ _that.loadData()
} else {
this.attrCurrent = []
this.nftList = []
this.total = 0
}
- })
- .catch(err => {
- // console.log(err);
- })
+ }
},
cheangetypeact(tplid) {
if (tplid == this.typeactive) { return }
this.typeactive = tplid
this.getnfttypeList()
},
- loadData() {
+ async loadData() {
this.showGoodClass = false
const loading = this.$loading({
lock: true,
@@ -1067,25 +1024,14 @@
params.tplid = this.attrCurrent.length > 1 ? this.attrCurrent.join(',') : this.attrCurrent[0]
params.typeid = 0
}
- axios.get(baseUrl + '/api/user/mynftlist', {
- params,
- headers: {
- token: token,
- },
- })
- .then(({ data: res }) => {
- loading.close()
- if (res.code == 1) {
- this.total = res.data.total
- this.nftList = res.data.data
- } else {
- this.$message(res.msg)
- }
- })
- .catch(err => {
- loading.close()
- this.$message(err.response.data.msg)
- })
+ let res = await publikRequesFunction('api/user/mynftlist','get',params);
+ loading.close()
+ if (res.code == 1) {
+ this.total = res.data.total
+ this.nftList = res.data.data
+ } else {
+ this.$message(res.msg)
+ }
},
//分頁
handlePageChange(page) {
@@ -1139,24 +1085,14 @@
confirmButtonText: confirm,
cancelButtonText: cancel,
type: 'warning'
- }).then(() => {
- $.ajax({
- url: baseUrl + apiSelect,
- type: 'post',
- data: {id},
- headers:{token: _that.userInfos.token},
- success(res){
- if(res.code === 1){
- _that.$message.success("success");
- setTimeout(()=>{
- _that.loadData()
- },1000)
- }
- },
- error(error){
- _that.$message.error("error");
- }
- });
+ }).then(async () => {
+ let res = await publikRequesFunction(apiSelect,'post',{id});
+ if(res.code === 1){
+ _that.$message.success("success");
+ setTimeout(()=>{
+ _that.loadData()
+ },1000)
+ }
}).catch(() => {
_that.$message("Failed");
});
diff --git a/profile.html b/profile.html
index 8700f68..4ab31d9 100644
--- a/profile.html
+++ b/profile.html
@@ -690,9 +690,9 @@
},
async getuserInfos(){
if(!this.userInfos?.token){return}
- let res = await axios.post(baseUrl+'api/user/index',{},{headers:{token:this.userInfos?.token}});
- if(res.data.code == 1){
- this.userInfos = res.data.data.userinfo;
+ let res = await publikRequesFunction('api/user/index','post',{});
+ if(res.code == 1){
+ this.userInfos = res.data.userinfo;
this.getonrules();
}
},
@@ -704,9 +704,9 @@
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
- let res = await axios.get(baseUrl+'api/user/getlogs?type='+this.ifications+'&page='+this.page,{ headers:{token:this.userInfos.token}});
- if(res.data.code == 1){
- this.rewardRules = res.data.data;
+ let res = await publikRequesFunction('api/user/getlogs','get',{type:this.ifications,page:this.page});
+ if(res.code == 1){
+ this.rewardRules = res.data;
}
loading.close()
},
diff --git a/static/js/getIsUser.js b/static/js/getIsUser.js
index cf34b81..ac245ad 100644
--- a/static/js/getIsUser.js
+++ b/static/js/getIsUser.js
@@ -17,7 +17,10 @@ if (userInfo) {
document.getElementById('isshouother').style.display = 'none';
}
-if(!userInfo && window.location.pathname != '/login.html' && window.location.pathname != '/signup.html'){
+let nowPath = window.location.pathname;
+console.log(nowPath,'当前路径');
+
+if(!userInfo && !nowPath.includes('login.html') && !nowPath.includes('signup.html')){
let language = window.localStorage.getItem("languageNow");
let message = language == 'zh' ? '請先登入或註冊' : 'Please log in or register first';
const html ="