I. background
Shortly after joining the new company, I met a colleague who was leaving and handed over the project to me. Colleagues leave their jobs in a hurry, so the handover is not very good, which is also an objective reason for the more problems behind. As shown in the title, the front end is developed by vue.js+node.js, the back end is developed by c # development interface, and a c # website is needed to display data. The last job was erp, powerbuilder, so this project still involves a lot of unfamiliar knowledge.
II. Problems encountered
1. Construction of Wechat Test Environment
Weixin's test environment is still a bit cumbersome (for beginners), but when I look back, I don't know what to write, so I'll look for tutorials online.
/// <SUMMARY> /// Download and save multimedia files,Return to Multimedia Save Path /// </SUMMARY> /// <PARAM name="ACCESS_TOKEN"></PARAM> /// <PARAM name="MEDIA_ID"></PARAM> /// <RETURNS></RETURNS> public string GetMultimedia(string ACCESS_TOKEN, string MEDIA_ID) { string file = string.Empty; string strpath = string.Empty; string stUrl = Common.TextHelper.WXUploadMediaUrl+"?access_token=" + ACCESS_TOKEN + "&media_id=" + MEDIA_ID; HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(stUrl); req.Method = "GET"; using (WebResponse wr = req.GetResponse()) { HttpWebResponse myResponse = (HttpWebResponse)req.GetResponse(); strpath = myResponse.ResponseUri.ToString(); WebClient mywebclient = new WebClient(); string basePath = AppDomain.CurrentDomain.BaseDirectory + "Attachment";//Attachment temporary storage path string amrFile = DateTime.Now.ToString("yyyyMMddhhmmssms")+".amr"; string mp3File= DateTime.Now.ToString("yyyyMMddhhmmssms")+".mp3"; try { mywebclient.DownloadFile(strpath, Path.Combine(basePath, amrFile)); ConvertToMp3(Path.Combine(basePath, amrFile), Path.Combine(basePath, mp3File)); file = mp3File; //file = amrFile; } catch (Exception ex) { //savepath = ex.ToString(); } } return file ; }
public string ConvertToMp3(string pathBefore, string pathLater) { string c = System.Web.HttpContext.Current.Server.MapPath("/ffmpeg/") + @"ffmpeg.exe -i " + pathBefore + " " + pathLater; log.WriteLine(c); string str = RunCmd(c); return str; } /// <summary> /// implement Cmd command /// </summary> private string RunCmd(string c) { try { ProcessStartInfo info = new ProcessStartInfo("cmd.exe"); info.RedirectStandardOutput = false; info.UseShellExecute = false; Process p = Process.Start(info); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.Start(); p.StandardInput.WriteLine(c); p.StandardInput.AutoFlush = true; Thread.Sleep(1000); p.StandardInput.WriteLine("exit"); p.WaitForExit(); string outStr = p.StandardOutput.ReadToEnd(); p.Close(); return outStr; } catch (Exception ex) { return "error" + ex.Message; } }
function rotate(row) { var deg = eval('get' + $("#" + row).css('transform'));//structure getmatrix function,Return the last rotation var step = 90;//How many degrees do you rotate each time? $("#" + row).css({ 'transform': 'rotate(' + (deg + step) % 360 + 'deg)' }); } function getmatrix(a, b, c, d, e, f) { var aa = Math.round(180 * Math.asin(a) / Math.PI); var bb = Math.round(180 * Math.acos(b) / Math.PI); var cc = Math.round(180 * Math.asin(c) / Math.PI); var dd = Math.round(180 * Math.acos(d) / Math.PI); var deg = 0; if (aa == bb || -aa == bb) { deg = dd; } else if (-aa + bb == 180) { deg = 180 + cc; } else if (aa + bb == 180) { deg = 360 - cc || 360 - dd; } return deg >= 360 ? 0 : deg; //return (aa+','+bb+','+cc+','+dd); }
Reference documents: http://m.blog.csdn.net/cengjingcanghai123/article/details/53537242
Three. Conclusion
It took nearly a month, and although the process was bumpy, the task was accomplished on the whole. There are many shortcomings, such as front-end style thieves and uglies (although I am not the front-end, but small companies can only incorporate front-end and back-end), such as a slightly inefficient (this is because I did pb, c, although basic, but the actual development experience is not much). Generally speaking, I'm satisfied with my performance. After all, I'm not familiar with all the things involved. I can finish my task in one month and score 60 points. My advantages lie in logical ability and database (the last job was erp, abused out), and my shortcomings are obvious (the foundation is not good enough, so we still need to make up for the foundation), I hope to make further efforts! If this article can solve some of the ape's problems and make some apes step on a pit less, I'm very happy! Writing is not good, gossip, beg for light cruelty!