1
This commit is contained in:
38
config/template/vue_file/apiServer.ejs
Normal file
38
config/template/vue_file/apiServer.ejs
Normal file
@@ -0,0 +1,38 @@
|
||||
import http from '@/libs/http';
|
||||
class <%=fileName%>ClServer {
|
||||
async all(param) {
|
||||
let res= await http.get('/<%=modelName%>/all', param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
async page(row) {
|
||||
let res= await http.post('/<%=modelName%>/page', row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/<%=modelName%>/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
async add(row) {
|
||||
let res= await http.post('/<%=modelName%>/add', row);
|
||||
return res;
|
||||
}
|
||||
|
||||
async edit(row) {
|
||||
let res= await http.post('/<%=modelName%>/edit', row);
|
||||
return res;
|
||||
}
|
||||
|
||||
async del(row) {
|
||||
let res= await http.post('/<%=modelName%>/del', row);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
const <%=fileName%>Server = new <%=fileName%>ClServer();
|
||||
export default <%=fileName%>Server;
|
||||
|
||||
Reference in New Issue
Block a user